Bug #377

Unexpected error: MySQL backend does not support timezone-aware datetimes

Added by Faidon Liambotis over 11 years ago. Updated over 11 years ago.

Status:Closed Start date:04/05/2011
Priority:High Due date:04/06/2011
Assignee:Giorgos Verigakis % Done:

0%

Category:Cyclades API Spent time: -
Target version:-

Description

With 1f6ba360859bd57790c89fc2f7995039fd23d1b9 on a MySQL setup, I'm getting:

Traceback (most recent call last):
  File "/srv/www/synnefo/../synnefo/api/util.py", line 198, in wrapper
    resp = func(request, *args, **kwargs)
  File "/srv/www/synnefo/../synnefo/api/servers.py", line 124, in list_servers
    if not user_vms:
  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 112, in __nonzero__
    iter(self).next()
  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 106, in _result_iter
    self._fill_cache()
  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 760, in _fill_cache
    self._result_cache.append(self._iter.next())
  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 269, in iterator
    for row in compiler.results_iter():
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py", line 672, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py", line 717, in execute_sql
    sql, params = self.as_sql()
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/compiler.py", line 65, in as_sql
    where, w_params = self.query.where.as_sql(qn=qn, connection=self.connection)
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/where.py", line 91, in as_sql
    sql, params = child.as_sql(qn=qn, connection=connection)
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/where.py", line 94, in as_sql
    sql, params = self.make_atom(child, qn, connection)
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/where.py", line 141, in make_atom
    lvalue, params = lvalue.process(lookup_type, params_or_value, connection)
  File "/usr/lib/pymodules/python2.6/django/db/models/sql/where.py", line 312, in process
    connection=connection, prepared=True)
  File "/usr/lib/pymodules/python2.6/django/db/models/fields/subclassing.py", line 53, in inner
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/django/db/models/fields/subclassing.py", line 53, in inner
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/django/db/models/fields/subclassing.py", line 53, in inner
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/django/db/models/fields/__init__.py", line 323, in get_db_prep_lookup
    return [self.get_db_prep_value(value, connection=connection, prepared=prepared)]
  File "/usr/lib/pymodules/python2.6/django/db/models/fields/subclassing.py", line 53, in inner
    return func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/django/db/models/fields/__init__.py", line 719, in get_db_prep_value
    return connection.ops.value_to_db_datetime(value)
  File "/usr/lib/pymodules/python2.6/django/db/backends/mysql/base.py", line 208, in value_to_db_datetime
    raise ValueError("MySQL backend does not support timezone-aware datetimes.")

Associated revisions

Revision e87d30f3
Added by Giorgos Verigakis over 11 years ago

Immediately convert dates to naive format

Please verify that it fixes #377

Refs: #377

Revision 0140e54b
Added by Vangelis Koukis over 11 years ago

Have isoparse return naive datetimes, fixes #377

Have api/util.py:isoparse() return naive datetime objects, in UTC.
Fixes #377.

History

#1 Updated by Vangelis Koukis over 11 years ago

  • Due date set to 04/06/2011
  • Category set to Cyclades API
  • Status changed from New to Assigned
  • Assignee set to Giorgos Verigakis
  • Priority changed from Medium to High

Θενξ για το report, παίζει να είναι και το πρώτο εξωτερικό bug report :)

#2 Updated by Vangelis Koukis over 11 years ago

  • Status changed from Assigned to Resolved

Έχει διορθωθεί στο 0140e54bacce44aa87484f767528ef0f8b9d50f7 του api-current branch.
Θα γίνει merge και στο master σύντομα.

#3 Updated by Vangelis Koukis over 11 years ago

  • Status changed from Resolved to Closed

Αυτό διορθώθηκε στη v0.1, το κλείνω.

Also available in: Atom PDF