#4528 closed defect (worksforme)
TypeError: unhashable type when installing trac-0.10.3 with mysql
| Reported by: | 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 , 19 years ago
comment:2 by , 19 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 , 19 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
| Summary: | Fail to install trac-0.10.3 → TypeError: 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.
follow-up: 5 comment:4 by , 15 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.
comment:5 by , 15 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 , 15 years ago
| Cc: | added |
|---|
comment:7 by , 14 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.



Python version - 2.3.3