Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

Last modified 5 years ago

#4528 closed defect (worksforme)

TypeError: unhashable type when installing trac-0.10.3 with mysql

Reported by: batfung@… Owned by: Christopher Lenz
Priority: normal Milestone:
Component: admin/console Version: 0.10.3
Severity: normal Keywords: mysql
Cc: Thijs Triemstra Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I got the following error when I am installing the trac 0.10.3 on MySQL 4.1.14 using MySQL-python-1.2.1_p2 (MySQLdb):

Creating and Initializing Project
 Installing default wiki pages
 /usr/share/trac/wiki-default/WikiPageNames => WikiPageNames
 /usr/share/trac/wiki-default/TracPermissions => TracPermissions
 /usr/share/trac/wiki-default/InterTrac => InterTrac
 /usr/share/trac/wiki-default/TracPlugins => TracPlugins
 /usr/share/trac/wiki-default/TracInterfaceCustomization => TracInterfaceCustomization
 /usr/share/trac/wiki-default/TracReports => TracReports
 /usr/share/trac/wiki-default/TracFastCgi => TracFastCgi
Failed to initialize environment. unhashable type
Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/trac/scripts/admin.py", line 623, in do_initenv
    self._do_wiki_load(default_dir('wiki'), cursor)
  File "/usr/lib/python2.3/site-packages/trac/scripts/admin.py", line 813, in _do_wiki_load
    self._do_wiki_import(filename, page, cursor, create_only)
  File "/usr/lib/python2.3/site-packages/trac/scripts/admin.py", line 783, in _do_wiki_import
    cursor, (title, int(time.time()), data, title))
  File "/usr/lib/python2.3/site-packages/trac/scripts/admin.py", line 162, in db_update
    cursor.execute(sql, params)
  File "/usr/lib/python2.3/site-packages/trac/db/util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib/python2.3/site-packages/trac/db/util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib/python2.3/site-packages/MySQLdb/cursors.py", line 165, in execute
    self._warning_check()
  File "/usr/lib/python2.3/site-packages/MySQLdb/cursors.py", line 80, in _warning_check
    warn(w[-1], self.Warning, 3)
  File "/usr/src/build/394694-i386/install/usr/lib/python2.3/warnings.py", line 57, in warn
    warn_explicit(message, category, filename, lineno, module, registry)
  File "/usr/src/build/394694-i386/install/usr/lib/python2.3/warnings.py", line 75, in warn_explicit
    if registry.get(key):
TypeError: unhashable type

Attachments (0)

Change History (7)

comment:1 by anonymous, 17 years ago

Python version - 2.3.3

comment:2 by Tim Hatch, 17 years ago

Keywords: mysql added
Milestone: 0.10.4

This is not a Trac bug, and has been discussed on the users mailing list. See Fails to initialize project: unhashable type

comment:3 by Christian Boos, 17 years ago

Resolution: worksforme
Status: newclosed
Summary: Fail to install trac-0.10.3TypeError: unhashable type when installing trac-0.10.3 with mysql

And one of the possible trigger for the above bug is apparently using a binary collation, like "utf8_bin". As we strongly recommend using "utf8_general_ci" for the collation (see MySqlDb), I think we can close this ticket.

comment:4 by anonymous, 13 years ago

Using mysql 5.0 and MySQL-python 1.2.1 on CentOS 5.5. Was able to create project but when running it, received the unhashable type error. Changing the collation on all the tables from the utf8_bin which is listed on the MySqlDb page to the utf8_general_ci which is recommended here solved the issue for me.

in reply to:  4 comment:5 by Christian Boos, 13 years ago

Replying to anonymous:

(snip bad advice)

Please re-read that page more carefully: it talks about Trac ≥ 0.11.1 and links to an older version of the page for older versions of Trac, which is most probably what you're using.

Also, that page advise you to use anything more recent than MySQL-python 1.2.1, i.e. at least 1.2.2 or the current 1.2.3.

comment:6 by Thijs Triemstra, 13 years ago

Cc: Thijs Triemstra added

comment:7 by jamesv@…, 13 years ago

I have the exact same setup as the user in in Comment 5. Indeed, changing the collation on all tables and the db to utf8_general_ci fixed the "unhashable type" error I was seeing. So far so good now.

Modify Ticket

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