3040: Create tables failed with utf8 -- UTF-8 Unicode database

qhy4*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Aug. 13, 2013
What version are you running?
1.7.11

What's the URL of the page containing the problem?
sb-site install

What steps will reproduce the problem?
1.create database reviewboard_utf8 default charset utf8 collate utf8_general_ci;
2.rb-site install , use database type with mysql.

What is the expected output? What do you see instead?

Creating table hostingsvcs_hostingserviceaccount
Traceback (most recent call last):
  File "/usr/local/bin/rb-site", line 9, in <module>
    load_entry_point('ReviewBoard==1.7.11', 'console_scripts', 'rb-site')()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1937, in main
    command.run()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1405, in run
    self.show_install_status()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1684, in show_install_status
    site.sync_database)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 885, in step
    func()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 370, in sync_database
    self.run_manage_command("syncdb", params)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 560, in run_manage_command
    execute_manager(reviewboard.settings, [__file__, cmd] + params)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 459, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/commands/syncdb.py", line 102, in handle_noargs
    cursor.execute(statement)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/db/backends/mysql/base.py", line 114, in execute
    return self.cursor.execute(query, args)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
django.db.

And then modify the database field of hostingsvcs:

class HostingServiceAccount(models.Model):
    service_name = models.CharField(max_length=64)
    hosting_url = models.CharField(max_length=128, blank=True, null=True)
    username = models.CharField(max_length=64)

then output with:
Creating table django_evolution
Traceback (most recent call last):
  File "/usr/local/bin/rb-site", line 9, in <module>
    load_entry_point('ReviewBoard==1.7.11', 'console_scripts', 'rb-site')()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1937, in main
    command.run()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1405, in run
    self.show_install_status()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1684, in show_install_status
    site.sync_database)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 885, in step
    func()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 370, in sync_database
    self.run_manage_command("syncdb", params)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/cmdline/rbsite.py", line 560, in run_manage_command
    execute_manager(reviewboard.settings, [__file__, cmd] + params)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 459, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/commands/syncdb.py", line 110, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/sql.py", line 189, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.11-py2.7.egg/reviewboard/admin/management/evolutions.py", line 58, in init_evolutions
    verbosity=0)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/management/commands/loaddata.py", line 40, in handle
    connection = connections[using]
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/db/utils.py", line 87, in __getitem__
    if hasattr(self._connections, alias):
TypeError: hasattr(): attribute name must be string

What operating system are you using? What browser?
N/A

Please provide any additional information below.
david
#1 david
We think that the initial error here is the key length, which we just pushed a fix for to release-1.7.x (a37a1fb).
  • +Fixed
#2 JPI****@gmai***** (Google Code) (Is this you? Claim this profile.)
It happens to me too, and my rb version is 1.7.13

* Installing the site...
Building site directories ... OK
Building site configuration files ... OK
Creating database ... Traceback (most recent call last):
  File "/usr/local/bin/rb-site", line 9, in <module>
    load_entry_point('ReviewBoard==1.7.13', 'console_scripts', 'rb-site')()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.13-py2.7.egg/reviewboard/cmdline/rbsite.py", line 2027, in main
    command.run()
  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.13-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1468, in run
david
#3 david
Please add the entire traceback