Edgewall Software
Modify

Ticket #7404 (closed defect: worksforme)

Opened 4 years ago

Last modified 2 years ago

Unsupported Database

Reported by: anonymous Owned by:
Priority: normal Milestone:
Component: general Version:
Severity: normal Keywords:
Cc:
Release Notes:
API Changes:

Description (last modified by rblank) (diff)

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

Change History

comment:1 Changed 4 years ago by jonas

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

Sounds like you don't have the python mysql driver installed:
http://sourceforge.net/projects/mysql-python

comment:2 Changed 4 years ago by anonymous

  • Resolution worksforme deleted
  • Status changed from closed to 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 Changed 4 years ago by anonymous

import MySQLdb

# sh trac.fcgi | grep mysql
TracError: Unsupported database type "mysql"

comment:4 Changed 4 years ago by anonymous

Sorry that should be

>>> import MySQLdb
>>>

# sh trac.fcgi | grep mysql
TracError: Unsupported database type "mysql"

comment:5 Changed 4 years ago by anonymous

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:6 Changed 3 years ago by anonymous

Same problem, on gentoo, with mod_chroot

comment:7 Changed 3 years ago by anonymous

Solved by copying missing mysql client libs into the chroot

comment:8 Changed 3 years ago by rblank

  • Description modified (diff)
  • Resolution set to wontfix
  • Status changed from reopened to closed

This sounds like an InstallationIssue, not a defect in Trac (especially considering comment:7).

comment:9 follow-up: Changed 3 years ago by anonymous

  • Resolution wontfix deleted
  • Status changed from closed to 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 Changed 3 years ago by ebray

  • Resolution set to worksforme
  • Status changed from reopened to 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 in reply to: ↑ 9 Changed 3 years ago by rblank

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 Changed 3 years ago by anonymous

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 Changed 3 years ago by anonymous

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"

comment:14 follow-up: Changed 2 years ago by 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.

comment:15 in reply to: ↑ 14 Changed 2 years ago by anonymous

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 Changed 2 years ago by trac@…

  • Resolution worksforme deleted
  • Status changed from closed to 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 Changed 2 years ago by cboos

  • Resolution set to worksforme
  • Status changed from reopened to 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 Changed 2 years ago by maciej@…

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 Changed 2 years ago by anonymous

OK, my mistake. I didn't reloaded Apache after installing python-mysqldb.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from (none). Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.