#7404 closed defect (worksforme)
Unsupported Database
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Trying to use trac with MySQL and i was able to create the environment and the database has been populated. When i browse to the environment i get the following error.
Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/web/api.py", line 339, in send_error 'text/html') File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/web/chrome.py", line 673, in render_template data = self.populate_data(req, data) File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/web/chrome.py", line 581, in populate_data d['chrome'].update(req.chrome) File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/web/api.py", line 168, in __getattr__ value = self.callbacks[name](self) File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/web/chrome.py", line 452, in prepare_request for category, name, text in contributor.get_navigation_items(req): File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/ticket/web_ui.py", line 133, in get_navigation_items if 'TICKET_CREATE' in req.perm: File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/perm.py", line 521, in has_permission return self._has_permission(action, resource) File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/perm.py", line 534, in _has_permission decision = PermissionSystem(self.env). \ File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/perm.py", line 424, in check_permission perm) File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/perm.py", line 281, in check_permission permissions = PermissionSystem(self.env). \ File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/perm.py", line 357, in get_user_permissions for perm in self.store.get_user_permissions(username): File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/perm.py", line 173, in get_user_permissions db = self.env.get_db_cnx() File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/env.py", line 250, in get_db_cnx return DatabaseManager(self).get_connection() File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/db/api.py", line 74, in get_connection connector, args = self._get_connector() File "/usr/lib/python2.4/site-packages/Trac-0.11b2-py2.4.egg/trac/db/api.py", line 97, in _get_connector raise TracError('Unsupported database type "%s"' % scheme) TracError: Unsupported database type "mysql"
Attachments (0)
Change History (19)
comment:1 by , 16 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 by , 16 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
I have the mysql python module installed and working. I still have this error though like the original author. Using debian etch 4.0.
comment:3 by , 16 years ago
import MySQLdb
# sh trac.fcgi | grep mysql TracError: Unsupported database type "mysql"
comment:4 by , 16 years ago
Sorry that should be
>>> import MySQLdb >>> # sh trac.fcgi | grep mysql TracError: Unsupported database type "mysql"
comment:5 by , 16 years ago
I've also double checked my versions of mysql, and python mysqldb. Both with the specific versions mentioned in the wiki for mysql support, aswell as latest versions of both. Still no go.
comment:8 by , 16 years ago
Description: | modified (diff) |
---|---|
Resolution: | → wontfix |
Status: | reopened → closed |
This sounds like an InstallationIssue, not a defect in Trac (especially considering comment:7).
follow-up: 11 comment:9 by , 16 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
This sounds like an InstallationIssue, not a defect in Trac (especially considering comment:7).
I wonder about that. When testing a Trac install/environment via tracd, everything works perfectly, including the connection to MySQL. I've pored over the documentation for a few days now, and can't seem to find the reason why this fails when accessed via mod_python. I'm having the exact same error as the other users on this ticket.
Solved by copying missing mysql client libs into the chroot
Can someone expound on this, perhaps point us in the direction of exactly how to do this?
comment:10 by , 16 years ago
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
Still sounds like an InstallationIssue. If you're having this problem with mod_python but not with tracd I would suspect that it's something PYTHONPATH related. Otherwise it shouldn't make a difference which frontend is being used.
comment:11 by , 16 years ago
Replying to anonymous:
I wonder about that. When testing a Trac install/environment via tracd, everything works perfectly, including the connection to MySQL. I've pored over the documentation for a few days now, and can't seem to find the reason why this fails when accessed via mod_python. I'm having the exact same error as the other users on this ticket.
Would it be possible that tracd
and mod_python
don't launch the same Python interpreter (e.g. /usr/bin/python
vs. /usr/local/bin/python
)?
You will have to provide more information if you want somebody to help you, preferably on the MailingList.
Solved by copying missing mysql client libs into the chroot
Can someone expound on this, perhaps point us in the direction of exactly how to do this?
That's actually a special case of having separate Python installations. If you run Apache in a chroot jail, you need to copy every file that is uses into the chroot, in particular also the Python interpreter and all required libraries. In comment:7, the MySQL client libraries seemed to have been missing.
comment:12 by , 16 years ago
Would it be possible that tracd and mod_python don't launch the same Python interpreter (e.g. /usr/bin/python vs. /usr/local/bin/python)?
I doubt it, since there is no interpreter installed at /usr/local/bin/python.
Here's the output when I got to localhost/trac —- Traceback (most recent call last):
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/api.py", line 339, in send_error
'text/html')
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/chrome.py", line 684, in render_template
data = self.populate_data(req, data)
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/chrome.py", line 592, in populate_data
dchrome.update(req.chrome)
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/api.py", line 169, in getattr
value = self.callbacks[name](self)
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/chrome.py", line 460, in prepare_request
for category, name, text in contributor.get_navigation_items(req):
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/web_ui.py", line 151, in get_navigation_items
if 'TICKET_CREATE' in req.perm:
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 523, in has_permission
return self._has_permission(action, resource)
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 537, in _has_permission
check_permission(action, perm.username, resource, perm)
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 424, in check_permission
perm)
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 282, in check_permission
get_user_permissions(username)
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 357, in get_user_permissions
for perm in self.store.get_user_permissions(username):
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 173, in get_user_permissions
db = self.env.get_db_cnx()
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/env.py", line 257, in get_db_cnx
return DatabaseManager(self).get_connection()
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/db/api.py", line 74, in get_connection
connector, args = self._get_connector()
File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/db/api.py", line 97, in _get_connector
raise TracError('Unsupported database type "%s"' % scheme)
TracError: Unsupported database type "mysql" —-
I've posted this to the mailing list as well, but I guess it doesn't hurt to post in more than one place?
comment:13 by , 16 years ago
Crud, sorry, forgot to put that in a codeblock…
Traceback (most recent call last): File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/api.py", line 339, in send_error 'text/html') File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/chrome.py", line 684, in render_template data = self.populate_data(req, data) File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/chrome.py", line 592, in populate_data d['chrome'].update(req.chrome) File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/api.py", line 169, in __getattr__ value = self.callbacks[name](self) File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/web/chrome.py", line 460, in prepare_request for category, name, text in contributor.get_navigation_items(req): File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/ticket/web_ui.py", line 151, in get_navigation_items if 'TICKET_CREATE' in req.perm: File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 523, in has_permission return self._has_permission(action, resource) File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 537, in _has_permission check_permission(action, perm.username, resource, perm) File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 424, in check_permission perm) File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 282, in check_permission get_user_permissions(username) File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 357, in get_user_permissions for perm in self.store.get_user_permissions(username): File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/perm.py", line 173, in get_user_permissions db = self.env.get_db_cnx() File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/env.py", line 257, in get_db_cnx return DatabaseManager(self).get_connection() File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/db/api.py", line 74, in get_connection connector, args = self._get_connector() File "/Library/Python/2.5/site-packages/Trac-0.11.1-py2.5.egg/trac/db/api.py", line 97, in _get_connector raise TracError('Unsupported database type "%s"' % scheme) TracError: Unsupported database type "mysql"
follow-up: 15 comment:14 by , 15 years ago
you have to use the full url to your database including the port number to mysql (default 3389).
Eg. mysql://user:password#localhost:3389/trac_database
Otherwise the error shown above will appear.
comment:15 by , 15 years ago
Replying to trac@…:
you have to use the full url to your database including the port number to mysql (default 3389).
Eg. mysql://user:password#localhost:3389/trac_database
Otherwise the error shown above will appear.
# should be $
mysql://user:password@localhost:3389/trac_database
comment:16 by , 15 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Hello,
I have the same issue, adding the port number does not help. I'm running on debian etch and installed the python_mysqldb w/apt-get.
Did anyone solve this problem yet?
comment:17 by , 15 years ago
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
Are you using that python-mysqldb package: http://packages.debian.org/etch-backports/python-mysqldb?
If not, you probably should. If yes, any issue with such a specific InstallationIssue should rather be reported to your package managers.
For me, it works fine when using something like:
mysql://user:password@localhost/trac_database mysql://user:password@localhost:3306/trac_database
(3306 is the default port, AFAICT, see MySQL's doc)
comment:18 by , 15 years ago
On Debian GNU/Linux 5.0, trac served using Apache 2.2 and mod_python, creating the project went well, but I still have this issue:
TracError: Unsupported database type "mysql"
My connection string: mysql://user:password@localhost:3306/trac_database (filled with my data). MySQL server working on 3306.
comment:19 by , 15 years ago
OK, my mistake. I didn't reloaded Apache after installing python-mysqldb.
Sounds like you don't have the python mysql driver installed: http://sourceforge.net/projects/mysql-python