Edgewall Software
Modify

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#10024 closed defect (fixed)

TimeoutError: Unable to get database connection within 0 seconds. (<trac.core.TracError instance at 0x92de2ec>)

Reported by: woohj70@… Owned by: cboos
Priority: high Milestone: 0.12.3
Component: database backend Version: 0.12.2
Severity: major Keywords:
Cc:
Release Notes:
API Changes:

Description

How to Reproduce

While doing a GET operation on /, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{}

User agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; ko-kr) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4

System Information

System information not available

Enabled Plugins

Plugin information not available

Python Traceback

Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 511, in _dispatch_request
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 202, in dispatch
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 344, in _pre_process_request
  File "build/bdist.linux-i686/egg/trac/versioncontrol/api.py", line 330, in pre_process_request
  File "build/bdist.linux-i686/egg/trac/versioncontrol/api.py", line 503, in get_repository
  File "build/bdist.linux-i686/egg/trac/versioncontrol/api.py", line 571, in get_all_repositories
  File "build/bdist.linux-i686/egg/trac/versioncontrol/api.py", line 112, in get_repositories
  File "build/bdist.linux-i686/egg/trac/env.py", line 328, in get_db_cnx
  File "build/bdist.linux-i686/egg/trac/db/api.py", line 90, in get_read_db
  File "build/bdist.linux-i686/egg/trac/db/api.py", line 152, in get_connection
  File "build/bdist.linux-i686/egg/trac/db/pool.py", line 226, in get_cnx
  File "build/bdist.linux-i686/egg/trac/db/pool.py", line 146, in get_cnx
TimeoutError: Unable to get database connection within 0 seconds. (<trac.core.TracError instance at 0x92de2ec>)

Attachments (0)

Change History (8)

comment:1 Changed 4 years ago by cboos

  • Component changed from general to database backend
  • Milestone set to 0.12.3
  • Version set to 0.12.1

Perfect, the report I was waiting for ;-)

Could you please upgrade to 0.12.2 and see the more detailed error message you'd get with that version? (Let's hope the error is reproducible…)

comment:2 Changed 4 years ago by cboos

  • Owner set to cboos
  • Version changed from 0.12.1 to 0.12.2

Ouch, actually this kind of unhelpful message is also delivered in 0.12.2…

comment:3 Changed 4 years ago by cboos

… 0.12.2 if Python 2.4 is used. For 2.5 and up, the original exception is reported in clear text.

comment:4 Changed 4 years ago by cboos

  • Resolution set to fixed
  • Status changed from new to closed

Error reporting for Python 2.4 fixed in r10552.

Please upgrade to latest 0.12-stable and you should see inside the parenthesis the reason for the connection failure.

comment:5 Changed 4 years ago by jjneff

  • Resolution fixed deleted
  • Status changed from closed to reopened

I am running trac 12.2 and changed the line as noted in r10552.

[Trac 0.12.2]

Python 2.4.3 mysql-server-5.0.77-3.el5

However I am still getting the same error as noted with out a reason:

Mar  3 22:07:55 ceitrac email2trac cloud: Traceback (most recent call last):
Mar  3 22:07:55 ceitrac email2trac cloud:   File "/etc/smrsh/email2trac", line 2466, in ?     tktparser.parse(sys.stdin)
Mar  3 22:07:55 ceitrac email2trac cloud:   File "/etc/smrsh/email2trac", line 1538, in parse     self.db = self.env.get_db_cnx()
Mar  3 22:07:55 ceitrac email2trac cloud:   File "build/bdist.linux-x86_64/egg/trac/env.py", line 328, in get_db_cnx
Mar  3 22:07:55 ceitrac email2trac cloud:   File "build/bdist.linux-x86_64/egg/trac/db/api.py", line 90, in get_read_db
Mar  3 22:07:55 ceitrac email2trac cloud:   File "build/bdist.linux-x86_64/egg/trac/db/api.py", line 152, in get_connection
Mar  3 22:07:55 ceitrac email2trac cloud:   File "build/bdist.linux-x86_64/egg/trac/db/pool.py", line 226, in get_cnx
Mar  3 22:07:55 ceitrac email2trac cloud:   File "build/bdist.linux-x86_64/egg/trac/db/pool.py", line 146, in get_cnx
Mar  3 22:07:55 ceitrac email2trac cloud: TimeoutError: Unable to get database connection within 0 seconds. (<trac.core.TracError instance at 0x69731b8>)

I can run trac-admin commands and get results fine, and I can run email2trac from command line and a new message is created - however when I set the log level to debug and then try a mail message via sendmail the syslog shows the error above. I can't tell what is causing the DB timeout since there doesn't appear to be a text error message..

please let me know what else is required to troubleshoot.

Last edited 3 years ago by cboos (previous) (diff)

comment:6 follow-up: Changed 4 years ago by anonymous

  • Resolution set to worksforme
  • Status changed from reopened to closed

Wow - It's too late! I realized right after i typed above that the file I edited was the unzipped file - NOT the file in the .egg! So I moved the 12.2 egg and reran easy_install -Z against trac12.2-stable and now I'm running Trac 0.12.3dev-r10609 I DO SEE an error now :-) It doesn't make any more sense than it did a few minutes ago - but at least I see an error!

Mar  3 22:51:59 ceitrac email2trac cloud:   File "/usr/lib/python2.4/site-packages/Trac-0.12.3dev_r10609-py2.4.egg/trac/db/pool.py", line 147, in get_cnx     raise TimeoutError(errmsg)
Mar  3 22:51:59 ceitrac email2trac cloud: TimeoutError: Unable to get database connection within 0 seconds. (TracError: Database "/trac/projects/cloud/db/trac.db" not found.)

So something in the script is assuming sqlite DB I suppose? Anyway the original reason I reopened the ticket is invalid - I'll have to troubleshoot the error above via trac or email2trac I suppose…

Thanks (If anyone DOES know why the above is happening feel free to post it - or email me grendelson AT gmail

Last edited 3 years ago by cboos (previous) (diff)

comment:7 in reply to: ↑ 6 Changed 4 years ago by rblank

Replying to anonymous:

So something in the script is assuming sqlite DB I suppose? Anyway the original reason I reopened the ticket is invalid - I'll have to troubleshoot the error above via trac or email2trac I suppose…

Make sure the user running the web server has read access to trac.ini.

comment:8 Changed 4 years ago by rblank

  • Resolution changed from worksforme to fixed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain cboos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from cboos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.