#2742 Errors from sidebar should be handled [21552]

v1.0.0
closed
General
nobody
2015-08-20
2011-09-07
Chris Tsai
No

When the sidebar throws an error, handle that better (for all tools, ideally). The menu item in the top nav should still be there, and the rest of the page body should still render. See also @exceptionless and [#1599]


https://sourceforge.net/apps/trac/sourceforge/ticket/21552

I have yesterday opened a new project, committed some code and opened some tickets. But after some time I got an error 500 on the ticket page: https://sourceforge.net/p/xprofile/tickets

Related

Tickets: #1599

Discussion

  • Tim Van Steenburgh

    Looks like some custom search bins were created with labels that solr doesn't recognize. We'll need to account for this in the code, but in the meantime, the admin can fix his Tracker by going to:

    https://sourceforge.net/p/xprofile/admin/tickets/bins/

    and removing the 'label:' terms from the Open Bugs and Open Features search bins.

     
  • Dave Brondsema

    Dave Brondsema - 2011-09-07

    I get this with all searches, not just the label ones. I think there's something weird in the data.

    The traceback is:

    Module /var/local/allura/Allura/allura/templates/jinja_master/sidebar_menu.html:36 in top-level template code
    <<      {% endif %}
               {% if c.app %}
                 {% for s in c.app.sidebar_menu() %}
                   {{sidebar_item(s)}}
                 {% endfor %}
    >>  {% for s in c.app.sidebar_menu() %}
    Module forgetracker.tracker_main:148 in sidebar_menu
    <<              search_bins.append(SitemapEntry(
                               h.text.truncate(label, 72), bin.url(), className='nav_child',
                               small=c.app.globals.bin_count(label)['hits']))
                   for fld in c.app.globals.milestone_fields:
                       milestones.append(SitemapEntry(h.text.truncate(fld.label, 72)))
    >>  small=c.app.globals.bin_count(label)['hits']))
    Module forgetracker.model.ticket:119 in bin_count
    <<      def bin_count(self, name):
                   if self._bin_counts_expire < datetime.utcnow():
                       self._refresh_counts()
                   for d in self._bin_counts_data:
                       if d['summary'] == name: return d
    >>  self._refresh_counts()
    Module forgetracker.model.ticket:99 in _refresh_counts
    <<          for b in Bin.query.find(dict(
                           app_config_id=self.app_config_id)):
                       r = search_artifact(Ticket, b.terms, rows=0)
                       hits = r is not None and r.hits or 0
                       self._bin_counts_data.append(dict(summary=b.summary,hits=hits))
    >>  r = search_artifact(Ticket, b.terms, rows=0)
    Module allura.lib.search:61 in search_artifact
    <<          return g.solr.search(q, fq=fq, rows=rows, **kw)
               except pysolr.SolrError, e:
                   raise ValueError('Error running search query: %s' % e.message)
    
           def find_shortlinks(text):
    >>  raise ValueError('Error running search query: %s' % e.message)
    ValueError: Error running search query: [Reason: undefined field label]
    
     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-09-07

    Originally by: sworddragon

    I have removed all labels and all is working fine now. If I add "label:Bug" in Open Bugs again the error happens again. Are labels in searches not allowed or is this a bug?

     
  • Dave Brondsema

    Dave Brondsema - 2011-09-07

    Ah, I figured it out. Use labels plural, like "labels:Bug", and it'll work.

    I'll keep this ticket open. We should make it not error out so drastically if something like this happens

     
  • Dave Brondsema

    Dave Brondsema - 2011-09-07
    • summary: Error 500 on ticket page [21552] --> Error 500 on ticket page (can't handle invalid saved searches) [21552]
     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-09-07

    Originally by: sworddragon

    Yes, this is working. I had made a better look that it is "labels" and not "label". But it is good if this will not end in such an error in the future.

     
  • Dave Brondsema

    Dave Brondsema - 2011-09-12
    • milestone: limbo --> forge-sept-30
     
  • Dave Brondsema

    Dave Brondsema - 2011-09-12

    Ticket sidebar needs to be more resilient in general. When solr was down momentarily recently, the sidebar errored so no ticket page could by viewed.

     
  • Dave Brondsema

    Dave Brondsema - 2011-09-30
    • summary: Error 500 on ticket page (can't handle invalid saved searches) [21552] --> Errors from sidebar should be handled [21552]
    • Description has changed:

    Diff:

    --- old 
    +++ new 
    @@ -1,3 +1,7 @@
    +When the sidebar throws an error, handle that better (for all tools, ideally).  The menu item in the top nav should still be there, and the rest of the page body should still render.  See also @exceptionless and [#1599]
    +
    +------
    +
     https://sourceforge.net/apps/trac/sourceforge/ticket/21552
    
     >I have yesterday opened a new project, committed some code and opened some tickets. But after some time I got an error 500 on the ticket page: https://sourceforge.net/p/xprofile/tickets
    
    • size: --> 2
     
  • Jenny Steele

    Jenny Steele - 2011-10-11
    • status: open --> in-progress
    • assigned_to: Jenny Steele
     
  • Jenny Steele

    Jenny Steele - 2011-10-11
    • status: in-progress --> code-review
    • assigned_to: Jenny Steele --> John Hoffmann ☠
     
  • Jenny Steele

    Jenny Steele - 2011-10-11

    Fix is on allura js/2742. To test, create a ticket bin with a query like "label:Bug". Confirm that the tracker app still works, but ticket bins are hidden in the sidebar.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-10-12

    Originally by: sworddragon

    Is this version already online? I still get an error 500.

     
  • Dave Brondsema

    Dave Brondsema - 2011-10-12

    Not yet, we've just made the fix in the code. It'll go out in our next code push, which will probably be later this week.

    Where are you getting the 500? This won't fix any root bugs, just handle it better.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-10-12

    Originally by: sworddragon

    Where are you getting the 500?

    For example on https://sourceforge.net/p/xprofile/tickets if such an invalid search is saved.

     
  • John Hoffman - 2011-10-14
    • status: code-review --> closed
     
  • John Hoffman - 2011-10-14

    Looks good, tested fine. Needed to create at least 1 ticket for the problem to surface, tested fine, merged to dev.

     
  • Dave Brondsema

    Dave Brondsema - 2011-10-14
    • milestone: forge-oct-28 --> forge-oct-14