postgres "there is already a transaction in progress"

1,896 views
Skip to first unread message

Ted Baker

unread,
Feb 9, 2010, 6:31:48 AM2/9/10
to web2py-users
I'm getting this message in the postgres log, and then another message
that web2py is trying to re-create the auth_user table. Web2py only
reports the second one, which comes from welcome/models/db.py.

Interestingly enough, I can then go ahead an view the error ticket,
using the admin interface, which allows me to log in with password,
edit, view files, etc.

I've checked the various .table files and they seem to be OK, so I'm
not sure why web2py is trying to re-create the tables, unless it is
mis-interpreting the failure of a previous transaction (the first
postgres error, about there already being an uncompleted transaction)
as meaning the table does not exist.

So, I'm thinking that this really may be a case where somehow web2py
is trying to nest postgres transactions, failing to complete a
transaction (";") before starting another, or just misinterpreting an
underlying postgres feature.

I suppose this should all be clear, if I were to spend more time
reading the web2py code. Sorry I have not yet managed that.

mdipierro

unread,
Feb 9, 2010, 9:59:27 AM2/9/10
to web2py-users
Not sure. Can you try run with the -N option?

Wes James

unread,
Feb 9, 2010, 10:12:39 AM2/9/10
to web...@googlegroups.com
postgres gives that error, from other discussion here, because of the
way web2py does a transaction on each db call, or something like that.
If you look at that message on google, you'll see general info about
that message also. There is not problem with it, I get it all the time
too.

-wes

max

unread,
Jan 4, 2012, 5:57:11 PM1/4/12
to web...@googlegroups.com
Hello Massimo,

i do have the same problem, postgres server error log:
Jan  4 23:39:01 server postgres[5285]: [3-1] 2012-01-04 23:39:01 CET dbname dbuser WARNING:  there is already a transaction in progress
Jan  4 23:39:01 server postgres[5286]: [3-1] 2012-01-04 23:39:01 CET dbname dbuser WARNING:  there is already a transaction in progress

I have tried the -N option you suggested, but it the warnings appear with no difference!

System details:
postgres version: psql (PostgreSQL) 8.3.12
web2py version: 1.99.2 (up to date)

The way James suggested ist not acceptable for me... ^^ It makes me very nervous if hundred of warnings appear every day ;)
But maybe the web2py-"problem" of transaction handling James suggested is  the reason, but i don't have enough detail knowledge of the DAL.

Does anybody have the same problem or recently solved it? Any suggestions?

Max

Ps.: Thanks Massimo for such a piece of great work. I am german student and learned programming over the past study-year with your framework!
Thank you! It is a great experience and makes a lot of fun.
Reply all
Reply to author
Forward
0 new messages