stack.updated_time is None

Bug #1286959 reported by Mike Spreitzer
50
This bug affects 14 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Julie Pichon
OpenStack Heat
Invalid
Undecided
Unassigned

Bug Description

I did a DevStack install, around 22:42 on 2 March 2013 UTC. I used horizon to create a stack. The creation eventually finished successfully, but the stack's "updated_time" field always held None. I suppose this is pretty bad for lots of reasons. The one I noticed is that it crashes horizon's page for listing stacks. I captured the crash output at http://paste.openstack.org/show/71561/. Here is an excerpt:

/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/base.py in get_data

                                 self.display_choices

                                 if value.lower() == (data or '').lower()]

            if display_value:

                data = display_value[0]

            else:

                for filter_func in self.filters:

                    data = filter_func(data)

    ...

            if data and self.truncate:

                data = truncatechars(data, self.truncate)

            self.table._data_cache[self][datum_id] = data

▼ Local vars
Variable Value
datum_id

u'210b2c04-395d-41ce-bb17-0ca3bc0e0361'

filter_func

<function timesince at 0x7f16807c81b8>

self

<Column: updated>

datum

<Stack {u'description': u'A HOT template that holds an ASRG of a stack\n', u'links': [{u'href': u'http://10.10.0.24:8004/v1/1175b4cf027f494faa3cd99102ccb59a/stacks/mjs-s1/210b2c04-395d-41ce-bb17-0ca3bc0e0361', u'rel': u'self'}], u'stack_status_reason': u'Stack CREATE started', u'stack_name': u'mjs-s1', u'creation_time': u'2014-03-02T23:05:59Z', u'updated_time': None, u'stack_status': u'CREATE_IN_PROGRESS', u'id': u'210b2c04-395d-41ce-bb17-0ca3bc0e0361'}>

data

''

display_value

None

Revision history for this message
Mike Spreitzer (mike-spreitzer) wrote :

It's not just during creation. Later I get the same Horizon crash with

datum

<Stack {u'description': u'A HOT template that holds an ASRG of a stack\n', u'links': [{u'href': u'http://10.10.0.24:8004/v1/1175b4cf027f494faa3cd99102ccb59a/stacks/mjs-s1/210b2c04-395d-41ce-bb17-0ca3bc0e0361', u'rel': u'self'}], u'stack_status_reason': u'Stack create completed successfully', u'stack_name': u'mjs-s1', u'creation_time': u'2014-03-02T23:05:59Z', u'updated_time': None, u'stack_status': u'CREATE_COMPLETE', u'id': u'210b2c04-395d-41ce-bb17-0ca3bc0e0361'}>

summary: - stack.updated is None
+ stack.updated_time is None
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

We have just changed what is stored in the updated_at field; it now represents the time that the stack had an update operation performed on it. This means that updated_time will often be None.

Horizon needs to expect a None updated_time, and its probably not appropriate to even have an Updated column on displayed tables.

David Lyle (david-lyle)
Changed in horizon:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → David Lyle (david-lyle)
importance: Critical → High
Revision history for this message
Mike Spreitzer (mike-spreitzer) wrote :

Marking the heat side of this as invalid, as I think this is what Steve is saying.

Changed in heat:
status: New → Invalid
Julie Pichon (jpichon)
Changed in horizon:
milestone: none → icehouse-rc1
Revision history for this message
Julie Pichon (jpichon) wrote :

Picking it up after chatting with David.

Changed in horizon:
assignee: David Lyle (david-lyle) → Julie Pichon (jpichon)
Revision history for this message
Julie Pichon (jpichon) wrote :

The "timesince" Django filter expects to receive a date or datetime object. However when we get something that can't be parsed into a date, our parse_isotime() filter returns an empty string, which then gets passed onto timesince.

On a template, Django handles such data mismatches by gracefully returning None / empty string, but in this case we're handling the filtering in the backend via the Horizon framework pieces for tables, so that doesn't happen here. Not sure that we really want a similar mechanism either since it would mean no data at all gets returned.

I think there are 2 bug fixes here:
 * Create our own timesince filter that reacts better to receiving a non-date object, perhaps by returning the string "Never"
 * Handle failures on filters more gracefully on the Horizon side

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/80028

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to horizon (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/80331

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to horizon (master)

Reviewed: https://review.openstack.org/80331
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=cd40196ec236385a23897d90f15bf6e1f0076812
Submitter: Jenkins
Branch: master

commit cd40196ec236385a23897d90f15bf6e1f0076812
Author: Julie Pichon <email address hidden>
Date: Wed Mar 13 15:59:45 2013 +0000

    Handle failures on column filters more gracefully

    With certain inputs it's possible for filters to fail, however we
    should still display the table as well as return the data we have even
    if it didn't go through one filter successfully.

    We're still expecting "filters" to be made of functions, therefore the
    func_name attribute should exist.

    Note that this warning message being displayed still indicates that
    there is a programming error somewhere that should be fixed.

    Related-Bug: #1286959
    Change-Id: I408dc9fbdaa7dfe49a39ad3a96a0e1256f6a99eb

David Lyle (david-lyle)
Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
Julie Pichon (jpichon) wrote :

The generic fix was committed to prevent the error 500, but the fix to handle the Heat case more gracefully and still display the data hasn't. See https://review.openstack.org/#/c/80028/ .

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/80028
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=ff7049432b7ea50e7e4e10a3de697661a3b91c67
Submitter: Jenkins
Branch: master

commit ff7049432b7ea50e7e4e10a3de697661a3b91c67
Author: Julie Pichon <email address hidden>
Date: Wed Mar 12 16:31:06 2014 +0000

    Handle "null" time values for Stacks

    The timesince filter expects a date or datetime object, and would fail
    when receiving an empty string. Create a new filter that returns the
    string value "Never" under these circumstances.

    Change-Id: I73f4dbb608fc143c3ac60d753e9e222762579e51
    Closes-Bug: #1286959

Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-rc1 → 2014.1
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.