I'm having the same issue. I only have one DB associated with my Heroku 
account, and it's properly being set in get_db(), as it shows up in the 
stack trace. Heroku says that the DB has no tables in it.

I was curious to see if perhaps there were leftover .table files in the 
filesystem when I was using sqlite. However, I looked through and did not 
find any, nor was there a database folder.

Unfortunately with the free tier of the Postgresql addon I haven't figured 
out how to see the Postgresql error logs. The command you're supposed to 
use, "heroku logs -p postgres", always comes back empty for me.

This is basically a critical show stopper for me, and I have no idea how to 
work around it.

Thank you,
Zak

On Thursday, March 13, 2014 3:10:49 PM UTC-7, Massimo Di Pierro wrote:
>
> web2py stores metadata about DB tables which have been created. This is 
> necessary for migrations. Normally this metadata is store in *.table files. 
> Heroku has a strange filesystem that gets wiped up at random times. For 
> this reason the *.table files are not in the "normal filesystem". Web2py 
> creates a filesystem in database in a table called "web2py_filesystem" and 
> stores the *.table files in there.
>
> One possible cause of problems is that heroku can have more than one 
> database. When you connect with web2py you need to specify which one. For 
> example:
>
> db = get_db('HEROKU_POSTGRESQL_YELLOW_URL').
>
> If you do not specify web2py may pick up the wrong one.
>
> Massimo
>
> On Thursday, 13 March 2014 10:40:59 UTC-5, Chris DeGroot wrote:
>>
>> I am looking again at the Heroku logs, specifically the line
>>
>> ERROR:web2py.dal:Could not retrieve applications/CaeSuite/databases/
>> 9e6a7c1bb77d791a89631de258057aed_web2py_session_CaeSuite.table
>>
>> Why is it looking for a file in */databases? 
>>
>> Chris
>>
>> On Thursday, March 13, 2014 10:14:32 AM UTC-4, Massimo Di Pierro wrote:
>>>
>>> Is this is a problem that worked before and then stopped working? Have 
>>> you changed anything on the database side? Do you have data that you need 
>>> to recovered.
>>>
>>> If at all an option, try delete the database and make a new one. 
>>>
>>> Somehow there is a problem with the web2py_filesystem table where 
>>> web2py stores metadata on platforms that lack a persistent filesystem. This 
>>> an be recovered but it is complicated to explain without direct access to 
>>> the system. It really depends on how it got there and what is in there.
>>>
>>> Massimo
>>>
>>>
>>> On Wednesday, 12 March 2014 17:53:08 UTC-5, Chris DeGroot wrote:
>>>>
>>>> Hello;
>>>>
>>>> I have tried everything I could think of to solve this problem, but I 
>>>> just can't find a solution.  I am trying to deploy my application to 
>>>> Heroku, following the instructions in the web2py manual.  The welcome app 
>>>> works fine, so I think generally I have deployed the app properly.  The 
>>>> application works on my local machine.  The error I am getting looks like 
>>>> this:
>>>>
>>>> Traceback (most recent call last):
>>>>   File "/app/web2py/gluon/restricted.py", line 217, in restricted
>>>>     exec ccode in environment
>>>>   File "/app/web2py/applications/CaeSuite/models/db.py" 
>>>> <https://warm-basin-8163.herokuapp.com/admin/default/edit/CaeSuite/models/db.py>,
>>>>  line 16, in <module>
>>>>     db = get_db(name=None, pool_size=10)
>>>>   File "/app/web2py/gluon/contrib/heroku.py", line 26, in get_db
>>>>     current.session.connect(current.request, current.response, db=db)
>>>>   File "/app/web2py/gluon/globals.py", line 869, in connect
>>>>     migrate=table_migrate,
>>>>   File "/app/web2py/gluon/dal.py", line 8223, in define_table
>>>>     table = self.lazy_define_table(tablename,*fields,**args)
>>>>   File "/app/web2py/gluon/dal.py", line 8260, in lazy_define_table
>>>>     polymodel=polymodel)
>>>>   File "/app/web2py/gluon/dal.py", line 1102, in create_table
>>>>     query), table)
>>>>   File "/app/web2py/gluon/dal.py", line 850, in log
>>>>     logfile = self.file_open(table._loggername, 'a')
>>>>   File "/app/web2py/gluon/dal.py", line 4578, in file_open
>>>>     return DatabaseStoredFile(self.db,filename,mode)
>>>>   File "/app/web2py/gluon/dal.py", line 4506, in __init__
>>>>     self.db.executesql(sql)
>>>>   File "/app/web2py/gluon/dal.py", line 8433, in executesql
>>>>     adapter.execute(query)
>>>>   File "/app/web2py/gluon/dal.py", line 1969, in execute
>>>>     return self.log_execute(*a, **b)
>>>>   File "/app/web2py/gluon/dal.py", line 1963, in log_execute
>>>>     ret = self.cursor.execute(command, *a[1:], **b)
>>>> InternalError: current transaction is aborted, commands ignored until end 
>>>> of transaction block
>>>>
>>>> Variablesself.cursor.execute<built-in method execute of 
>>>> psycopg2._psycopg.cursor 
>>>> object>self<gluon.contrib.heroku.HerokuPostgresAdapter 
>>>> object>self.cursor<cursor object at 0x287a338; closed: 0>b{}a('CREATE 
>>>> TABLE IF NOT EXISTS web2py_filesystem (path VARCHAR(255), content TEXT, 
>>>> PRIMARY KEY(path));',)retundefinedcommand'CREATE TABLE IF NOT EXISTS 
>>>> web2py_filesystem (path VARCHAR(255), content TEXT, PRIMARY KEY(path));'
>>>>
>>>>
>>>> I would really appreciate any help!!  Thanks,
>>>>
>>>>
>>>> Chris
>>>>
>>>>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to