DatabaseError: invalid byte sequence for encoding "UTF8": 0x00

Bug #911714 reported by Muharem Hrnjadovic
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Won't Fix

Bug Description

Traceback (most recent call last):
  File "/usr/bin/openquake", line 125, in <module>
    job.run_job(FLAGS.config_file, FLAGS.output_type)
  File "/usr/lib/pymodules/python2.7/openquake/job/", line 69, in run_job
    a_job = Job.from_file(job_file, output_type)
  File "/usr/lib/pymodules/python2.7/openquake/job/", line 362, in from_file
    job_id = prepare_job(params).id
  File "/usr/lib/pymodules/python2.7/django/db/", line 217, in inner
    res = func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openquake/job/", line 299, in prepare_job
  File "/usr/lib/pymodules/python2.7/django/db/models/", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/usr/lib/pymodules/python2.7/django/db/models/", line 553, in save_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "/usr/lib/pymodules/python2.7/django/db/models/", line 195, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/usr/lib/pymodules/python2.7/django/db/models/", line 1436, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/usr/lib/pymodules/python2.7/django/db/models/sql/", line 791, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "/usr/lib/pymodules/python2.7/django/db/models/sql/", line 735, in execute_sql
    cursor.execute(sql, params)
  File "/usr/lib/pymodules/python2.7/django/db/backends/postgresql_psycopg2/", line 44, in execute
    return self.cursor.execute(query, args)
django.db.utils.DatabaseError: invalid byte sequence for encoding "UTF8": 0x00

Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

The following django patch: needs to be applied on a pristine ubuntu 11.10 system.

Changed in openquake:
status: New → Confirmed
importance: Undecided → High
milestone: none → 0.5.0
tags: added: database django enduser-visible packaging
John Tarter (toh2)
Changed in openquake:
milestone: 0.5.0 → 0.5.1
John Tarter (toh2)
Changed in openquake:
milestone: 0.5.1 → none
Revision history for this message
Lars Butler (lars-butler) wrote :

The best solution right now is to simply patch django 1.3. There is no code we can implement right which will fix this.

Changed in openquake:
status: Confirmed → Won't Fix
Revision history for this message
Paul Henshaw (paul-sl-henshaw) wrote :

Just for the record, the other workaround for this problem is to change the postgres configuration file postgresql.conf to set

standard_conforming_strings = off

as described here:

This is the approach we took with previous versions of the engine. I agree with Lars that applying the patch is probably the better solution.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.