Hello Vlad,

Sorry for the misunderstanding,

‘database’ or ‘databases’ I don’t remember is a folder inside you web2py
applications directory.

~/web2py/applications/yourapplication/database

Inside of that DAL keeps metadata informations about the tables managed.

I was referring to the filesystem permissions for that folder.




Il giorno lun 18 lug 2022 alle 15:22 Eliezer (Vlad) Tseytkin <
westgate6...@gmail.com> ha scritto:

> I am not familiar with "databases folder permissions" - where can I look
> this up, the way web2py uses them so that I would be able to ask
> elephantsql customer support about it?
>
> It seems strange to me: when I start from an empty database - everything
> works like a charm, the way it has to.
> but when I pg_dump and pg_restore the database from elsewhere (seems to
> restore everything correctly) - this is where problems start: migrate=True
> attempts to recreate the existing tables; migrate=False works perfectly
> fine (and fake_migrate worked by itself, but didn't help to fix the
> issue...)
>
>
>
> On Sun, Jul 17, 2022 at 11:31 AM Massimiliano <mbelle...@gmail.com> wrote:
>
>> Should be
>>
>> migrate = True
>> fake_migrate = True
>> db = DAL(db_uri, migrate=migrate, fake_migrate=fake_migrate)
>>
>> And after one run, that recreate metadata files in databases folder:
>>
>> migrate = True
>> fake_migrate = False
>> db = DAL(db_uri, migrate=migrate, fake_migrate=fake_migrate)
>>
>> maybe you can also check your databases folder permissions. Web2py needs
>> to be able to write into.
>>
>> Il giorno dom 17 lug 2022 alle ore 17:17 Vlad <westgate6...@gmail.com>
>> ha scritto:
>>
>>> Massimiliano, thank you for the suggestion.
>>>
>>> I tried fake_migrate=True - it works fine, but then I switched it back
>>> to migrate=True  , and it crashed again.
>>> (migrate=False works perfectly.)
>>>
>>> Any ideas?
>>>
>>> On Sunday, July 17, 2022 at 5:42:11 AM UTC-4 Massimiliano wrote:
>>>
>>>> You can try fake_migrate=True so that DAL recreates tables metafata
>>>> files in the database folder.
>>>> Once done, you can restore fake_migrate=False and migrate=True.
>>>>
>>>> Should work
>>>>
>>>> Il giorno dom 17 lug 2022 alle ore 07:06 Vlad <westga...@gmail.com> ha
>>>> scritto:
>>>>
>>>>> I've been using PythonAnywhere Postgres hosting for a while. Used
>>>>> pg_dump and pg_restore to recreate the database in ElephantSQL.
>>>>> Not sure if this has contributed to the problem, but had to use
>>>>> options that drop owner and privileges (otherwise pg_restore generated
>>>>> errors, complaining about non-existing roles etc.)
>>>>> In the end, everything works perfectly except that I must use
>>>>> migrate=false option only.
>>>>> If migrate=true - it attempts to recreate all the tables and,
>>>>> obviously, complains that tables already exist - because they do exist.
>>>>> Greatly appreciate suggestions on how to fix this.
>>>>>
>>>>> A side question on efficiency: visually I notice that PythonAnywhere
>>>>> postgres hosting works quicker (but ElephantSQL is theoretically better
>>>>> hosting). Is it because in PA both app and db run "in close proximity",
>>>>> presumably on the same server?
>>>>>
>>>>> --
>>>>> Resources:
>>>>> - http://web2py.com
>>>>> - http://web2py.com/book (Documentation)
>>>>> - http://github.com/web2py/web2py (Source code)
>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "web2py-users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to web2py+un...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/web2py/abcae64b-e9b3-4d30-9ae7-98ff01cb51ban%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/web2py/abcae64b-e9b3-4d30-9ae7-98ff01cb51ban%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>
>>>>
>>>> --
>>>> Massimiliano
>>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/872ddea5-4c39-4cf8-ad94-ac852f674dd3n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/web2py/872ddea5-4c39-4cf8-ad94-ac852f674dd3n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> Massimiliano
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>>
> You received this message because you are subscribed to a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/web2py/xb6DXxF-HdQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/CANPTPxJ5R_ocbegJTeY2otBQYea5ctLmdww3yzed4zVszESRzA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/web2py/CANPTPxJ5R_ocbegJTeY2otBQYea5ctLmdww3yzed4zVszESRzA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/CABZ%2BKCBhU0r3M2UxwXi%3D3kMU8Qf2DFZBx8yvMcb0fy3mftUR3w%40mail.gmail.com
> <https://groups.google.com/d/msgid/web2py/CABZ%2BKCBhU0r3M2UxwXi%3D3kMU8Qf2DFZBx8yvMcb0fy3mftUR3w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
-- 
Massimiliano

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CANPTPxJpKi9-X2SkGsxVi0VVCRYe4ErWzCtiFyvbHgecM_ampg%40mail.gmail.com.

Reply via email to