Sorry if it sounds obvious,  but I suppose you have checked that you can 
write to that dir and the permissions are correct?  It is best to have dirs 
and files belonging to the same user that your webservice uses.  e.g.  I 
chown my files www-data:www-data

BTW  I remove|rename my databases/*.table files prior to running 
fake_migrate_all,  as it seems that it does not like to overwrite what is 
already there (which is not surprising),  although I don't think this point 
has anything much to do with your ticket.


On Saturday, October 20, 2012 4:53:46 PM UTC+1, lyn2py wrote:
>
> Thanks Massimo, I have looked at the error log files (production site), 
> and found this traceback:
>
> __db_meta_setup: 
> /home/www-data/web2py/applications/app/cache/cache.shelve.db: unexpected 
> file type or format
> ERROR:web2py:Traceback (most recent call last):
>   File "/home/www-data/web2py/gluon/restricted.py", line 209, in restricted
>     exec ccode in environment
>   File "applications/myapp/compiled/models/db2.py", line 36, in <module>
>   File "/home/www-data/web2py/gluon/tools.py", line 1497, in define_tables
>     format='%(first_name)s %(last_name)s (%(id)s)'))
>   File "/home/www-data/web2py/gluon/dal.py", line 7095, in define_table
>     table = self.lazy_define_table(tablename,*fields,**args)
>   File "/home/www-data/web2py/gluon/dal.py", line 7126, in 
> lazy_define_table
>     polymodel=polymodel)
>   File "/home/www-data/web2py/gluon/dal.py", line 896, in create_table
>     logfile = self.file_open(table._loggername, 'a')
>   File "/home/www-data/web2py/gluon/dal.py", line 646, in file_open
>     fileobj = portalocker.LockedFile(filename,mode)
>   File "/home/www-data/web2py/gluon/portalocker.py", line 121, in __init__
>     self.file = open(filename,mode.replace('w','a'))
> IOError: [Errno 2] No such file or directory: 
> '/home/www-data/web2py/applications/app/databases/sql.log'
>
> Hope it helps!
>
>
> On Saturday, October 20, 2012 8:21:10 PM UTC+8, Massimo Di Pierro wrote:
>>
>> When you get an unkown error there is a traceback in the console or 
>> apache logs. Can I see the traceback?
>>
>> On Saturday, 20 October 2012 04:04:22 UTC-5, lyn2py wrote:
>>>
>>> I performed as Massimo's suggestion,
>>> fake_migrate_all=True,migrate_enabled=True
>>>
>>> But I ran into an Internal Error: Unknown. (no ticket).
>>>
>>>
>>>
>>> On Thursday, October 18, 2012 8:17:23 PM UTC+8, Massimo Di Pierro wrote:
>>>>
>>>> You mean you do not see the .table files?
>>>>
>>>> Try:
>>>> fake_migrate_all=True,migrate_enabled=True
>>>> could be an error in the book.
>>>>
>>>> On Thursday, 18 October 2012 01:29:42 UTC-5, lyn2py wrote:
>>>>>
>>>>> Hello all, something went wrong with the database table files, and 
>>>>> they were accidentally completely removed (the whole database folder).
>>>>>
>>>>> I need to rebuild all the database files, so I did:
>>>>> db = DAL('postgres://........',fake_migrate_all=True,migrate_enabled=
>>>>> False)
>>>>>
>>>>> According to the manual, this is supposed to rebuild the database 
>>>>> table files, but I still don't see the database folder appearing in the 
>>>>> app's folder.
>>>>>
>>>>> May I know what I should do to fix migrations?
>>>>>
>>>>> Thank you!
>>>>>
>>>>

-- 



Reply via email to