Ticket #3245 (reopened defect)

Opened 5 months ago

Last modified 4 months ago

Plugin crashes Trac

Reported by: lars@skjaerlund.dk Assigned to: k0s
Priority: normal Component: IcalExporterPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I've just tried installing you nice plugin on a fresh Trac 0.11. Installation runs smoothly, but when I try activating the iCal link, Trac creates an Oops... with the following message:

Trac detected an internal error:
AttributeError: object has no attribute 'title'

Regards,
Lars

Attachments

Change History

(follow-up: ↓ 2 ) 07/01/08 15:16:16 changed by k0s

  • release changed from 0.10 to 0.11.

i can't reproduce this; can you provide more details as to what exactly you were doing? what link did you click on? was it a report? a ticket? ...etc. the more info, the better

(in reply to: ↑ 1 ) 07/01/08 15:39:16 changed by k0s

Replying to k0s:

i can't reproduce this; can you provide more details as to what exactly you were doing? what link did you click on? was it a report? a ticket? ...etc. the more info, the better

also, the full traceback would be nice, if available

(follow-up: ↓ 4 ) 07/15/08 15:56:21 changed by ryan.kilkenny@cadmusgroup.com

Experiencing the same issue: AttributeError?: object has no attribute 'title'

Using: report/1/ics - active tickets timeline/ics

I have multiple instances (projects) using the same base TRAC setup and so far this is only happening on one of them. The others are working properly.

Suspiciously. This particular instance is using a lot of custom ticket fields... So maybe there's a link.

(in reply to: ↑ 3 ) 07/15/08 15:59:04 changed by ryan.kilkenny@cadmusgroup.com

Replying to ryan.kilkenny@cadmusgroup.com: Most recent call last:

  • File "e:\python23\lib\site-packages\Trac-0.11-py2.3.egg\trac\web\main.py", line 423, in _dispatch_request Code fragment:
    1. try:
    2. if not env and env_error:
    3. raise HTTPInternalError(env_error)
    4. try:
    5. dispatcher = RequestDispatcher?(env)
    6. dispatcher.dispatch(req)
    7. except RequestDone?:
    8. pass
    9. resp = req._response or []
    10. except HTTPException, e:
  • Local variables: Name Value after [u' except RequestDone:', u' pass', u' resp = ... before [u' try:', u' if not env and env_error:', u' raise ... dispatcher <trac.web.main.RequestDispatcher? object at 0x052C2850> e <exceptions.AttributeError? instance at 0x05608170> env <trac.env.Environment object at 0x050A4550> env_error None exc_info (<class exceptions.AttributeError? at 0x005DE990>, ... filename 'e:\\python23\\lib\\site-packages\\Trac-0.11-py2.3.egg\\trac\\web\\main.py' ... frames [{'function': '_dispatch_request', 'lines_before': [u' try:', u' ... has_admin True line u' dispatcher.dispatch(req)' lineno 422 message u"AttributeError?: object has no attribute 'title'" req <Request "GET u'/timeline/ics'"> resp [] tb <traceback object at 0x05CA0080> tb_hide None traceback 'Traceback (most recent call last):\n File ...
  • File "e:\python23\lib\site-packages\Trac-0.11-py2.3.egg\trac\web\main.py", line 197, in dispatch Code fragment:
    1. req.args.get('FORM_TOKEN') != req.form_token:
    2. raise HTTPBadRequest('Missing or invalid form token. '
    3. 'Do you have cookies enabled?')
    4. # Process the request and render the template
    5. resp = chosen_handler.process_request(req)
    6. if resp:
    7. if len(resp) == 2: # Clearsilver
    8. chrome.populate_hdf(req)
    9. template, content_type = \
    10. self._post_process_request(req, *resp)
  • Local variables: Name Value chosen_handler <icalexporter.icalexporter.iCalExporterPlugin object at 0x05227810> chrome <trac.web.chrome.Chrome object at 0x05501670> err (<class exceptions.AttributeError? at 0x005DE990>, ... handler <trac.timeline.web_ui.TimelineModule? object at 0x054CD190> req <Request "GET u'/timeline/ics'"> self <trac.web.main.RequestDispatcher? object at 0x052C2850>
  • File "e:\python23\lib\site-packages\icalexporter-0.1-py2.3.egg\icalexporter\icalexporter.py", line 64, in process_request Code fragment:
    1. req.send_response(200)
    2. req.send_header('Content-Type', 'text/calendar;charset=utf-8')
    3. req.send_header('Content-Disposition', 'attachment; filename=%s' % filename)
    4. req.end_headers()
    5. calendar = iCal(req.write)
    6. calendar.from_rss(rss)
    7. ### methods for IRequestFilter
    8. def pre_process_request(self, req, handler):
  • Local variables: Name Value calendar <icalexporter.ical.iCal object at 0x05BE9ED0> filename u'timeline.ics' path u'/timeline/ics' req <Request "GET u'/timeline/ics'"> rss u'http://extrac.quantecllc.com/powermanagement/timeline?ticket=on&changeset ... self <icalexporter.icalexporter.iCalExporterPlugin object at 0x05227810> sub u'/timeline?ticket=on&changeset=on&milestone=on&wiki=on&max=50&daysback=90& ...
  • File "e:\python23\lib\site-packages\icalexporter-0.1-py2.3.egg\icalexporter\ical.py", line 114, in from_rss Code fragment:
    1. for key in attrmap:
    2. if key in entry:
    3. event.append(Property(attrmap[key], entry[key]))
    4. events.append(event) 113.
    5. return self.write(feed.feed.title, events)
    6. except ImportError?:
    7. pass
    8. if name == 'main':
  • Local variables: Name Value attrmap {'summary': 'DESCRIPTION', 'link': 'URL', 'title': 'SUMMARY'} events [] feed {'feed': {'subtitle': u'<div id="banner">\n <div id="header">\n ... self <icalexporter.ical.iCal object at 0x05BE9ED0> url u'http://extrac.quantecllc.com/powermanagement/timeline?ticket=on&changeset ...
  • File "build\bdist.win32\egg\feedparser.py", line 236, in getattr Local variables: Name Value key 'title' self {'subtitle': u'<div id="banner">\n <div id="header">\n <a ...

File "e:\python23\lib\site-packages\Trac-0.11-py2.3.egg\trac\web\main.py", line 423, in _dispatch_request

dispatcher.dispatch(req)

File "e:\python23\lib\site-packages\Trac-0.11-py2.3.egg\trac\web\main.py", line 197, in dispatch

resp = chosen_handler.process_request(req)

File "e:\python23\lib\site-packages\icalexporter-0.1-py2.3.egg\icalexporter\icalexporter.py", line 64, in process_request

calendar.from_rss(rss)

File "e:\python23\lib\site-packages\icalexporter-0.1-py2.3.egg\icalexporter\ical.py", line 114, in from_rss

return self.write(feed.feed.title, events)

File "build\bdist.win32\egg\feedparser.py", line 236, in getattr

07/15/08 16:45:29 changed by k0s

  • status changed from new to closed.
  • resolution set to fixed.

(In [4017]) dont fail if you cant find the title; hopefully fixes #3245

07/15/08 16:49:55 changed by k0s

ive closed the ticket, because i think i have found the fix for the missing feed.feed.title attribute; however, this probably means the feed is not actually being parsed correctly (see http://www.feedparser.org/docs/basic-existence.html) so there might be other bugs that this is masking. I still can't reproduce the actual cause. Please open a new ticket if another such bug is found -- and note, more information means quicker fixes (espec since it doesn't seem to be a bug for me locally).

07/15/08 17:14:13 changed by ryan.kilkenny@cadmusgroup.com

  • status changed from closed to reopened.
  • resolution deleted.

In my case, this means that it now exports a blank ics file, which means all of the attribute fields are invalid I would guess... Can you think if it has to do with custo tickets at all? Thats the only difference between my working trac projects and this one. its the only one using custom ticket fields.

(follow-up: ↓ 9 ) 07/15/08 18:19:46 changed by ryan.kilkenny@cadmusgroup.com

on further investigation, it doesn't appear to even parse the url correctly I think. I tried to do some debugging with ical.py and couldn't get any results from the feed parser.

I also checked another instance of TRAC that I had recently upgraded from .10 to .11 and it suffered the same issue, but this time no custom ticket fields. Hoping to narrow down the issue, but I'm still lost.

(in reply to: ↑ 8 ) 07/21/08 08:32:34 changed by k0s

Replying to ryan.kilkenny@cadmusgroup.com:

on further investigation, it doesn't appear to even parse the url correctly I think. I tried to do some debugging with ical.py and couldn't get any results from the feed parser. I also checked another instance of TRAC that I had recently upgraded from .10 to .11 and it suffered the same issue, but this time no custom ticket fields. Hoping to narrow down the issue, but I'm still lost.

I would check these, in order:

  1. is the url that feedparser is trying to parse correct? That is, I would put a pdb or a print statement around http://trac-hacks.org/browser/icalexporterplugin/0.11/icalexporter/ical.py#L85 and see what the url is
  1. if the url is good, does it return the proper RSS? Since you have the rss url, try viewing it with a browser or other user agent. Is the RSS sane?
  1. if the RSS looks sane, does feedparser parse it correctly? Open the url with feedparser. Does it have a feed.title attribute? If not, it probably did not parse correctly. If not, save the RSS as a file, then read this with feedparser. Any better luck?

My guess is the problem is 1. I don't know of why custom fields would interfere with rss creation or parsing.


Add/Change #3245 (Plugin crashes Trac)




Change Properties
Action