web2py on heroku getting "InternalError: current transaction is aborted..." Ticket

148 views
Skip to first unread message

Ismael Serratos

unread,
Dec 27, 2013, 11:45:24 PM12/27/13
to web...@googlegroups.com
Hello everybody, today I tried to push my application to Heroku by using the setup-web2py-heroku.sh script. It works fine, but when opening my app I get a ticket with this content:

web2py™Version 2.8.2-stable+timestamp.2013.11.28.13.54.07
PythonPython 2.7.4: /app/.heroku/python/bin/python (prefix: /app/.heroku/python)

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
Traceback (most recent call last):
File "/app/gluon/restricted.py", line 217, in restricted
exec ccode in environment
File "/app/applications/init/models/db.py", line 16, in <module>
db = get_db(name="HEROKU_POSTGRESQL_RED_URL", pool_size=10)
File "/app/gluon/contrib/heroku.py", line 26, in get_db
current.session.connect(current.request, current.response, db=db)
File "/app/gluon/globals.py", line 833, in connect
migrate=table_migrate,
File "/app/gluon/dal.py", line 8139, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
File "/app/gluon/dal.py", line 8176, in lazy_define_table
polymodel=polymodel)
File "/app/gluon/dal.py", line 1056, in create_table
query), table)
File "/app/gluon/dal.py", line 815, in log
logfile = self.file_open(table._loggername, 'a')
File "/app/gluon/dal.py", line 4488, in file_open
return DatabaseStoredFile(self.db,filename,mode)
File "/app/gluon/dal.py", line 4416, in __init__
self.db.executesql(sql)
File "/app/gluon/dal.py", line 8349, in executesql
adapter.execute(query)
File "/app/gluon/dal.py", line 1916, in execute
return self.log_execute(*a, **b)
File "/app/gluon/dal.py", line 1910, in log_execute
ret = self.cursor.execute(command, *a[1:], **b)
InternalError: current transaction is aborted, commands ignored until end of transaction block

I'm getting this ticket with my app and even with a blank copy of web2py and the default apps. The admin interface works just fine. What can be the cause of this issue?
*Note: In the traceback I pasted here I did replace the get_db connection name to the generated one, but the traceback is basically the same if I use the default (none).
Best regards,
Ismael Serratos.


Massimo Di Pierro

unread,
Dec 28, 2013, 12:10:06 AM12/28/13
to web...@googlegroups.com
Is there any database log to help you? What are the queries being executed or failing?

Ismael Serratos

unread,
Dec 28, 2013, 12:19:33 AM12/28/13
to web...@googlegroups.com
The only information that I get is this part of the traceback:

(the error is generated since the first time the app launches)
Function argument list

(self=<gluon.contrib.heroku.HerokuPostgresAdapter object>, *a=('CREATE TABLE IF NOT EXISTS web2py_filesystem (path VARCHAR(255), content TEXT, PRIMARY KEY(path));',), **b={})

Code listing
1905.
1906.
1907.
1908.
1909.
1910.

1911.
1912.
1913.
1914.
            command = self.filter_sql_command(command)
if self.db._debug:
LOGGER.debug('SQL: %s' % command)
self.db._lastsql = command
t0 = time.time()

ret = self.cursor.execute(command, *a[1:], **b)

        self.db._timings.append((command,time.time()-t0))
del self.db._timings[:-TIMINGSSIZE]
return ret
Variables
self<gluon.contrib.heroku.HerokuPostgresAdapter object>
retundefined
self.cursor.execute<built-in method execute of psycopg2._psycopg.cursor object>
a('CREATE TABLE IF NOT EXISTS web2py_filesystem (path VARCHAR(255), content TEXT, PRIMARY KEY(path));',)
b{}
self.cursor<cursor object at 0x21c3908; closed: 0>
command'CREATE TABLE IF NOT EXISTS web2py_filesystem (path VARCHAR(255), content TEXT, PRIMARY KEY(path));'
 

Ismael Serratos

unread,
Dec 28, 2013, 12:24:10 AM12/28/13
to web...@googlegroups.com
Sorry for the spam :s, digging the heroku logs I get this:

2013-12-28T05:17:30.576403+00:00 app[web.1]: ERROR:web2py.dal:Could not retrieve applications/init/databases/bad0fba8494e4bab4e99ad1290bcc0d2_web2py_session_init.table

2013-12-28T05:17:30.576403+00:00 app[web.1]:     if db.executesql(query):

2013-12-28T05:17:30.576403+00:00 app[web.1]: Traceback (most recent call last):

2013-12-28T05:17:30.576403+00:00 app[web.1]:   File "/app/gluon/dal.py", line 8349, in executesql

2013-12-28T05:17:30.576403+00:00 app[web.1]:   File "/app/gluon/dal.py", line 4470, in exists

2013-12-28T05:17:30.576403+00:00 app[web.1]:     return self.log_execute(*a, **b)

2013-12-28T05:17:30.576403+00:00 app[web.1]:     adapter.execute(query)

2013-12-28T05:17:30.576403+00:00 app[web.1]:   File "/app/gluon/dal.py", line 1916, in execute

2013-12-28T05:17:30.576403+00:00 app[web.1]:     ret = self.cursor.execute(command, *a[1:], **b)

2013-12-28T05:17:30.576667+00:00 app[web.1]: 

2013-12-28T05:17:30.576667+00:00 app[web.1]: 

2013-12-28T05:17:30.576403+00:00 app[web.1]:   File "/app/gluon/dal.py", line 1910, in log_execute

2013-12-28T05:17:30.576667+00:00 app[web.1]: ProgrammingError: relation "web2py_filesystem" does not exist

2013-12-28T05:17:30.576667+00:00 app[web.1]: LINE 1: SELECT path FROM web2py_filesystem WHERE path='applications/...

2013-12-28T05:17:30.576667+00:00 app[web.1]:       

Alan Etkin

unread,
Dec 28, 2013, 11:36:07 AM12/28/13
to web...@googlegroups.com

2013-12-28T05:17:30.576667+00:00 app[web.1]: ProgrammingError: relation "web2py_filesystem" does not exist

2013-12-28T05:17:30.576667+00:00 app[web.1]: LINE 1: SELECT path FROM web2py_filesystem WHERE path='applications/...

2013-12-28T05:17:30.576667+00:00 app[web.1]:       


Check this issues:

https://code.google.com/p/web2py/issues/detail?id=1602
https://code.google.com/p/web2py/issues/detail?id=1625

It seems that the driver is throwing something not expected by isProgramming... or isOperational, otherwise the error should be logged but would not stop execution.
 

Chris DeGroot

unread,
Mar 12, 2014, 8:31:57 PM3/12/14
to web...@googlegroups.com
Did you solve this problem?  I have the same issue and the links at then end don't help.

Ismael Serratos

unread,
Mar 13, 2014, 11:06:51 AM3/13/14
to web...@googlegroups.com
Nope, in fact I switched to ror :S because I needed to run on heroku ASAP.

But I still getting the error on every web2py application I try to deploy on heroku. If I use postgres locally everything works just fine.
--
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/w2RJBqKIwRE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris DeGroot

unread,
Mar 13, 2014, 11:11:54 AM3/13/14
to web...@googlegroups.com
That's unfortunate to hear that you haven't resolved it.  I am having the exact same problem.  Locally everything is fine, on Heroku, nothing.

Louis Amon

unread,
Aug 6, 2014, 4:22:03 AM8/6/14
to web...@googlegroups.com
Got the same issue as well.

Apparently the problem has to do with the "UseDatabaseStoredFile" class inherited by the "HerokuPostgresAdapter".

It is designed to store the filesystem ("databases" folder and files) in a table instead, and was created for GAE but doesn't seem to work on Heroku.

That's about as far as I can go, being a novice and all...

Should I issue a ticket ?

Massimo Di Pierro

unread,
Aug 7, 2014, 8:05:08 PM8/7/14
to web...@googlegroups.com
It was tested on heroku and it worked. please opena ticket. perhaps something has changed.
Reply all
Reply to author
Forward
0 new messages