0.9.10 - events do not work with a mysql backend

Bug #1068861 reported by DiegoV
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Graphite
Won't Fix
Undecided
Unassigned

Bug Description

There are 2 issues.

1) If I use the django admin console to create an event, it won't appear listed in the /events endpoint list. If I create it using the curl POST REST API, then it does appear.

2) When I create an event (using any of the 2 methods listed above) and then go to the flot interface and attempt to search for the event using the Events input text by entering the tag name, I get a 500 with the following stacktrace:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/opt/graphite/webapp/graphite/events/views.py", line 63, in get_data
    return HttpResponse(json.dumps(fetch(request), cls=EventEncoder),
  File "/opt/graphite/webapp/graphite/events/views.py", line 82, in fetch
    models.Event.find_events(time_from, time_until, tags=tags)]
  File "/opt/graphite/webapp/graphite/events/models.py", line 42, in find_events
    result = list(query.order_by("when"))
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 84, in __len__
    self._result_cache.extend(self._iter)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 273, in iterator
    for row in compiler.results_iter():
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 680, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 725, in execute_sql
    sql, params = self.as_sql()
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 68, in as_sql
    where, w_params = self.query.where.as_sql(qn=qn, connection=self.connection)
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/where.py", line 92, in as_sql
    sql, params = child.as_sql(qn=qn, connection=connection)
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/where.py", line 95, in as_sql
    sql, params = self.make_atom(child, qn, connection)
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/where.py", line 142, in make_atom
    lvalue, params = lvalue.process(lookup_type, params_or_value, connection)
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/where.py", line 329, in process
    connection=connection, prepared=True)
  File "/usr/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 53, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 53, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 53, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/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/python2.7/dist-packages/django/db/models/fields/subclassing.py", line 53, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/db/models/fields/__init__.py", line 727, in get_db_prep_value
    return connection.ops.value_to_db_datetime(value)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 233, in value_to_db_datetime
    raise ValueError("MySQL backend does not support timezone-aware datetimes.")
ValueError: MySQL backend does not support timezone-aware datetimes.

Tags: 0.9.10 events
Revision history for this message
DiegoV (diego-varese) wrote :

I don't think this is the same as bug #993625. Yes, both mean that events don't work with a mysql backend, but for different reasons.

Revision history for this message
Michael Leinartas (mleinartas) wrote :

Ack, upon closer inspection I think you're right. Sorry for that, I'll leave this one open

Revision history for this message
Mike S (seif1001) wrote :

While I can add events with no issue through the django admin console (Issue 1) I do get the same error and callstack when trying to use flot (Issue 2) using a mySql backend.
MySql Version: 5.1.40sp1-enterprise-gpl-advanced-log

Revision history for this message
Michael Leinartas (mleinartas) wrote :
Changed in graphite:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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