Mailing List Archive

trac under apache mod_wsgi with mysql
I can get trac to load with tracd. if I try to load it using mod_wsgi, I
get a blank page with the following error:

Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/trac/web/api.py", line 440, in send_error
data, 'text/html')
File "/Library/Python/2.7/site-packages/trac/web/chrome.py", line 827, in render_template
message = req.session.pop('chrome.%s.%d' % (type_, i))
File "/Library/Python/2.7/site-packages/trac/web/api.py", line 216, in __getattr__
value = self.callbacks[name](self)
File "/Library/Python/2.7/site-packages/trac/web/main.py", line 300, in _get_session
return Session(self.env, req)
File "/Library/Python/2.7/site-packages/trac/web/session.py", line 198, in __init__
self.get_session(sid)
File "/Library/Python/2.7/site-packages/trac/web/session.py", line 219, in get_session
super(Session, self).get_session(sid, authenticated)
File "/Library/Python/2.7/site-packages/trac/web/session.py", line 61, in get_session
db = self.env.get_db_cnx()
File "/Library/Python/2.7/site-packages/trac/env.py", line 328, in get_db_cnx
return get_read_db(self)
File "/Library/Python/2.7/site-packages/trac/db/api.py", line 90, in get_read_db
return _transaction_local.db or DatabaseManager(env).get_connection()
File "/Library/Python/2.7/site-packages/trac/db/api.py", line 152, in get_connection
return self._cnx_pool.get_cnx(self.timeout or None)
File "/Library/Python/2.7/site-packages/trac/db/pool.py", line 226, in get_cnx
return _backend.get_cnx(self._connector, self._kwargs, timeout)
File "/Library/Python/2.7/site-packages/trac/db/pool.py", line 146, in get_cnx
raise TimeoutError(errmsg)
TimeoutError: Unable to get database connection within 0 seconds. (TracError(u'Database "/Path/To/Project//git_repos/infoshopkeeper-trac/db/trac.db" not found.',))

My trac.ini file has a mysql connect string, which works with tracd, as I
said, but not over apache. I'm assuming that sqlite is the hardwired
default, and that's why it's looking for the db/trac.db file in my project
and not finding it, since it's not there. Could it be a permission
problem? What else should I be looking to troubleshoot what's really going
on.

My trac.ini looks as follows:


[trac]
auth_cookie_lifetime = 0
auth_cookie_path =
authz_file =
authz_module_name =
auto_preview_timeout = 2.0
auto_reload = False
backup_dir = db
base_url =
check_auth_ip = false
database = mysql://woodenshoe@localhost:3306/infoshopkeeper-trac
debug_sql = False
default_charset = utf-8
genshi_cache_size = 128
htdocs_location =
ignore_auth_case = false
mainnav = wiki,timeline,roadmap,browser,tickets,newticket,search
metanav = login,logout,prefs,help,about
mysqldump_path = mysqldump
never_obfuscate_mailto = false
permission_policies = DefaultPermissionPolicy, LegacyAttachmentPolicy
permission_store = DefaultPermissionStore
pg_dump_path = pg_dump
repository_dir = /Path/To/Project/git_repos/.git
repository_sync_per_request = (default)
repository_type = git
resizable_textareas = true
secure_cookies = False
show_email_addresses = false
show_ip_addresses = false
timeout = 20
use_base_url_for_redirect = False

Thanks for any help/suggestions...
--Marko

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/8oatQb_pWnQJ.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to trac-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.
Re: trac under apache mod_wsgi with mysql [ In reply to ]
Marko Mekapses wrote:
> My trac.ini file has a mysql connect string, which works with tracd, as
> I said, but not over apache. I'm assuming that sqlite is the hardwired
> default, and that's why it's looking for the db/trac.db file in my
> project and not finding it, since it's not there. Could it be a
> permission problem?

Yes, it is. Make sure the web server has enough permissions to access
your trac.ini.

-- Remy