Ticket #4528 (closed defect: worksforme)
Opened 5 years ago
Last modified 7 months ago
TypeError: unhashable type when installing trac-0.10.3 with mysql
| Reported by: | batfung@… | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | admin/console | Version: | 0.10.3 |
| Severity: | normal | Keywords: | mysql |
| Cc: | thijstriemstra | ||
| Release Notes: | |||
| API 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
Change History
comment:1 Changed 5 years ago by anonymous
comment:2 Changed 5 years ago by thatch
- Keywords mysql added
- Milestone 0.10.4 deleted
This is not a Trac bug, and has been discussed on the users mailing list. See Fails to initialize project: unhashable type
comment:3 Changed 5 years ago by cboos
- Resolution set to worksforme
- Status changed from new to closed
- Summary changed from Fail to install trac-0.10.3 to 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.
comment:4 follow-up: ↓ 5 Changed 12 months ago by anonymous
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 in reply to: ↑ 4 Changed 12 months ago by cboos
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 Changed 12 months ago by thijstriemstra
- Cc thijstriemstra added
comment:7 Changed 7 months ago by jamesv@…
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