Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#9696 closed defect (worksforme)

OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)")

Reported by: anonymous Owned by:
Priority: highest Milestone:
Component: database backend Version: 0.12
Severity: trivial Keywords: mysql
Cc: nardoj@… Branch:
Release Notes:
API Changes:
Internal 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 (X11; U; Linux i686; en-US; rv:1.9.2.6) Gecko/20100626 SUSE/3.6.6-1.2 Firefox/3.6.6

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 513, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 200, in dispatch
    chosen_handler)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 346, in _pre_process_request
    chosen_handler = filter_.pre_process_request(req, chosen_handler)
  File "build/bdist.linux-i686/egg/trac/versioncontrol/api.py", line 330, in pre_process_request
    repo = self.get_repository(reponame)
  File "build/bdist.linux-i686/egg/trac/versioncontrol/api.py", line 503, in get_repository
    repoinfo = self.get_all_repositories().get(reponame, {})
  File "build/bdist.linux-i686/egg/trac/versioncontrol/api.py", line 571, in get_all_repositories
    for reponame, info in provider.get_repositories() or []:
  File "build/bdist.linux-i686/egg/trac/versioncontrol/api.py", line 112, in get_repositories
    db = self.env.get_db_cnx()
  File "build/bdist.linux-i686/egg/trac/env.py", line 335, in get_db_cnx
    return get_read_db(self)
  File "build/bdist.linux-i686/egg/trac/db/api.py", line 90, in get_read_db
    return _transaction_local.db or DatabaseManager(env).get_connection()
  File "build/bdist.linux-i686/egg/trac/db/api.py", line 152, in get_connection
    return self._cnx_pool.get_cnx(self.timeout or None)
  File "build/bdist.linux-i686/egg/trac/db/pool.py", line 172, in get_cnx
    return _backend.get_cnx(self._connector, self._kwargs, timeout)
  File "build/bdist.linux-i686/egg/trac/db/pool.py", line 105, in get_cnx
    cnx = connector.get_connection(**kwargs)
  File "build/bdist.linux-i686/egg/trac/db/mysql_backend.py", line 85, in get_connection
    cnx = MySQLConnection(path, log, user, password, host, port, params)
  File "build/bdist.linux-i686/egg/trac/db/mysql_backend.py", line 225, in __init__
    host=host, port=port, charset='utf8')
  File "build/bdist.linux-i686/egg/MySQLdb/__init__.py", line 74, in Connect
    return Connection(*args, **kwargs)
  File "build/bdist.linux-i686/egg/MySQLdb/connections.py", line 170, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)")

System Information:
Trac    0.12
Babel   0.9.5
Genshi  0.6
Python  2.6.5 (r265:79063, Jul 5 2010, 11:47:21) [GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]]
setuptools 0.6c11

Attachments (0)

Change History (7)

comment:1 by Remy Blank, 14 years ago

Resolution: cantfix
Status: newclosed

InstallationIssue (check your database connection).

comment:2 by anonymous, 14 years ago

Resolution: cantfix
Status: closedreopened

comment:3 by anonymous, 14 years ago

Scenario: When I run the trac standalone server, it connects and works normally. Any suggestions?

comment:4 by Remy Blank, 14 years ago

Resolution: cantfix
Status: reopenedclosed

Did you read the page linked above? Please ask support questions on the MailingList or IrcChannel. Thank you.

comment:5 by nardoj, 14 years ago

problem solved: Just to know the solution. Just changed the description "localhost" to the machine IP: 127.0.0.1, in the file trac.ini, as shown below:

    database = mysql://tracuser:password@localhost:3306/trac
To  database = mysql://tracuser:password@127.0.0.1:3306/trac

Worked properly.

comment:6 by Christian Boos, 14 years ago

Keywords: mysql added
Resolution: cantfixworksforme

in reply to:  5 comment:7 by Ryan J Ollos, 10 years ago

Replying to nardoj:

problem solved: Just to know the solution. Just changed the description "localhost" to the machine IP: 127.0.0.1, in the file trac.ini, as shown below:

In that case, I'd be interested to know the contents of your /etc/hosts file.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) 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.