key error on people/edit attachments

Bug #715897 reported by Jim B. Glenn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KARL3
Fix Released
Medium
Chris Rossi

Bug Description

reported via error monitor:

ENTRY
Mon Feb 7 18:11:09 2011
Exception when processing https://karl.soros.org/people/edit.html
Traceback (most recent call last):
  File "/opt/karl/osi/3.32-0/src/karl/karl/errorlog.py", line 15, in middleware
    return app(environ, start_response)
  File "/opt/karl/osi/3.32-0/eggs/repoze.zodbconn-0.11-py2.5.egg/repoze/zodbconn/connector.py", line 21, in __call__
    result = self.next_app(environ, start_response)
  File "/opt/karl/osi/3.32-0/eggs/repoze.retry-0.9.4-py2.5.egg/repoze/retry/__init__.py", line 88, in __call__
    app_iter = self.application(environ, replace_start_response)
  File "/opt/karl/osi/3.32-0/eggs/repoze.tm2-1.0a5-py2.5.egg/repoze/tm/__init__.py", line 23, in __call__
    result = self.application(environ, save_status_and_headers)
  File "/opt/karl/osi/3.32-0/eggs/Paste-1.7.2-py2.5.egg/paste/registry.py", line 350, in __call__
    app_iter = self.application(environ, start_response)
  File "/opt/karl/osi/3.32-0/eggs/repoze.who-1.0.15-py2.5.egg/repoze/who/middleware.py", line 107, in __call__
    app_iter = app(environ, wrapper.wrap_start_response)
  File "/opt/karl/osi/3.32-0/eggs/repoze.browserid-0.3-py2.5.egg/repoze/browserid/middleware.py", line 127, in __call__
    return self.app(environ, start_response)
  File "/opt/karl/osi/3.32-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/router.py", line 130, in __call__
    response = view_callable(context, request)
  File "/opt/karl/osi/3.32-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configuration.py", line 1520, in __call__
    return view(context, request)
  File "/opt/karl/osi/3.32-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configuration.py", line 1753, in _secured_view
    return view(context, request)
  File "/opt/karl/osi/3.32-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configuration.py", line 1704, in _rendered_view
    response = view(context, request)
  File "/opt/karl/osi/3.32-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg/formish/zcml.py", line 166, in __call__
    self.method)
  File "/opt/karl/osi/3.32-0/eggs/repoze.bfg.formish-0.3-py2.5.egg/repoze/bfg/formish/zcml.py", line 197, in form_from_controller
    defaults = controller.form_defaults()
  File "/opt/karl/osi/3.32-0/src/karl/karl/content/views/blog.py", line 409, in form_defaults
    for x in context['attachments'].values()]
  File "/opt/karl/osi/3.32-0/eggs/repoze.folder-0.6.2-py2.5.egg/repoze/folder/__init__.py", line 96, in __getitem__
    return self.data[name]
KeyError: u'attachments'

Tags: r3.64
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Jim, could you take a shot at recreating this on staging or some other instance?

Changed in karl3:
assignee: nobody → JimPGlenn (jpglenn09)
importance: Undecided → Low
milestone: none → m53
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Also, take a look and see if there are any other recent bugs (fixed or open) that might cover this. I have a feeling some of these might be duplicates.

Revision history for this message
JimPGlenn (jpglenn09) wrote :

It does happen on staging. You wanted a screen capture but it is a general error when clicking on edit at the people edit
http://staging.osi.sixfeetup.com/people/admin.html. I will look for another bug entered that this might be a duplicate.

Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Balazs, I wonder if this overlaps at all with your attachments work?

Changed in karl3:
assignee: JimPGlenn (jpglenn09) → Balazs Ree (ree)
Revision history for this message
Balazs Ree (ree) wrote :

No, definitely not. I investigated this case and came into more problems here.

1. For all I see, there exists no edit.html on the people directory. So, this page should give a 404 according to the current setup.

Instead what happens, is that bfg takes the EditBlogEntryFormController, and starts to handle the people directory as a blog entry, and a request as a post request to a blog entry. This then fails, since the people directory does not have an attachment, like a blog entry supposed to have.

Since I find no faulty declaration that would connect IPeopleDirectory with the EditBlogEntryFormController, I would suppose that this is a bug in repoze itself. (I would also add that If this is true is also a worrysome bug, because who knows which view we end up in case of a random nonexistent url.)

I checked however that authentication is not skipped in this case.

2. Who traverses to /people/edit.html

Apparently, the Edit button from people/admin.html comes here. But again, I cannot find any view defined for edit.html of IPeopleDirectory. Are we missing a view, or is the link wrong? I am not familiar about what the Edit button is supposed to do according to the specs, so I cannot tell.

Changed in karl3:
status: New → Confirmed
Balazs Ree (ree)
Changed in karl3:
importance: Low → High
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

I'll hand this over to Chris.

Changed in karl3:
assignee: Balazs Ree (ree) → Chris Rossi (chris-archimedeanco)
importance: High → Medium
Changed in karl3:
milestone: m53 → m55
Changed in karl3:
milestone: m55 → m57
Changed in karl3:
milestone: m57 → m58
Changed in karl3:
milestone: m58 → m60
Changed in karl3:
milestone: m60 → m59
Changed in karl3:
status: Confirmed → In Progress
Changed in karl3:
status: In Progress → Fix Committed
JimPGlenn (jpglenn09)
tags: added: r3.64
Revision history for this message
JimPGlenn (jpglenn09) wrote :

fixed

Changed in karl3:
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.