1

I'm getting some weird error when i run ./manage.py runserver or migrate command. I checked the files from where the exception is thrown, but no idea

Unhandled exception in thread started by <function wrapper at 0x7fd4c73df488>
Traceback (most recent call last):
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 112, in inner_run
    self.check_migrations()
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 164, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in __init__
    self.build_graph()
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 182, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
    self.ensure_schema()
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 52, in ensure_schema
    with self.connection.schema_editor() as editor:
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 85, in __enter__
    self.atomic.__enter__()
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/transaction.py", line 190, in __enter__
    connection._start_transaction_under_autocommit()
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 299, in _start_transaction_under_autocommit
    self.cursor().execute("BEGIN")
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
  File "/home/dummy/RobocopEnv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 316, in execute
    return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: near "񐁂򐁇N": syntax error
6
  • This is an error in generated SQL. Can you add SQL logs? Commented Oct 21, 2015 at 22:31
  • Also, try running ./manage.py sqlmigrate and looking at the output. Commented Oct 21, 2015 at 22:39
  • DEFAULT_DB_ALIAS is most likely your problem. Check here for a syntax error / typo. Commented Oct 21, 2015 at 23:03
  • I use sqlite, how do i get the logs? Commented Oct 21, 2015 at 23:03
  • I can run the same code in a different host and it works perfectly Commented Oct 21, 2015 at 23:04

1 Answer 1

1

The problem is python build with ucs-2, so rebuild with ucs-4 should be work.

Python 2.7.6

wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xf Python-2.7.6.tar.xz
cd Python-2.7.6
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.