AttributeError when searching for "precise"

Bug #1214627 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charmworld
Fix Released
Critical
Curtis Hovey

Bug Description

While QAing changes to search indexing I saw a 500 when I searched for "precise":

Traceback (most recent call last):
...
  File "/home/webops_deploy/charmworld/local/lib/python2.7/site-packages/chameleon/py26.py", line 8, in lookup_attr
    raise exc
AttributeError: AttributeError
 - Expression: "hit['data'].short_url"
 - Filename: /home/webops_deploy/charmworld/charmworld/templates/search.pt
 - Location: (31:19)
 - Source: <a href="${hit['data'].short_url}">${name}</a></td>
                          ^^^^^^^^^^^^^^^^^^^^^
 - Expression: "${hit['data'].short_url}"
 - Filename: /home/webops_deploy/charmworld/charmworld/templates/search.pt
 - Location: (31:17)
 - Source: <a href="${hit['data'].short_url}">${name}</a></td>

Related branches

Revision history for this message
Curtis Hovey (sinzui) wrote :

This issue appears in r355. The problem is that the template presumes that the search dicts are sane. Only the models are sane,

Revision history for this message
Curtis Hovey (sinzui) wrote :

I am raising this to critical because charmworld cannot depoly r355 because of this issue.

Changed in charmworld:
importance: High → Critical
assignee: nobody → Curtis Hovey (sinzui)
status: Triaged → In Progress
Revision history for this message
Curtis Hovey (sinzui) wrote :

A quick hack to the staging template reveals that the insane bundle (the version is -1/ instead or /1/) is in the results. It doen't have a name, owner

<td tal:define="name hit['data'].permanent_url">
      <a href="${hit['data'].permanent_url}">${name}</a></td>
<td tal:content="hit['data']._raw_representation"></td>

jc:~/None/ {u'_id': u'~abentley/wiki-bundle-1/wiki', u'data': {u'services': {u'wiki': {u'charm': u'mediawiki', u'num_units': 2, u'branch': u'lp:charms/precise/mediawiki', u'constraints': u'mem=2'}, u'haproxy': {u'branch': u'lp:charms/precise/haproxy'}, u'db': {u'charm': u'mysql', u'options': {u'tuning-level': u'fast'}, u'branch': u'lp:charms/precise/mysql'}, u'memcached': {u'options': {u'request-limit': 32}, u'branch': u'lp:charms/precise/memcached'}}, u'series': u'precise', u'_id': u'~abentley/wiki-bundle-1/wiki', u'relations': [[u'wiki:db', u'db'], [u'wiki', [u'haproxy', u'memcached']]]}}

The short_url attr calls basket_name which splits the the basket key value from the _representation. The value is None since the raw didn't have a basket key.

There are a few issues here.
1. Bad bundle data in the db that we did not clean up.
2. Bundle.basket_name must not split None.

Curtis Hovey (sinzui)
Changed in charmworld:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in charmworld:
status: Fix Committed → Fix Released
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.