[Bug 821020] [NEW] Attempting to GET a nonexistent members object results in a 500 instead of a 404.

Stephen A. Goss steveth45 at gmail.com
Thu Aug 4 18:54:14 CEST 2011


Public bug reported:

Attempting to GET a nonexistent members object results in a 500 instead
of a 404.

$ curl -i -u restadmin:restpass http://localhost:8001/3.0/members/foo
HTTP/1.0 500 Dude, this is whack!
Date: Thu, 04 Aug 2011 16:25:01 GMT
Server: WSGIServer/0.1 Python/2.6.5
Content-Type: text/plain
Content-Length: 59

A server error occurred.  Please contact the administrator.

And here is the stack trace:


Traceback (most recent call last):
  File "/usr/lib64/python2.6/wsgiref/handlers.py", line 93, in run
    self.result = application(self.environ, self.start_response)
  File "/home/sgoss/mailman/src/mailman/rest/wsgiapp.py", line 58, in __call__
    environ, start_response)
  File "/home/sgoss/mailman_env/lib/python2.6/site-packages/restish-0.12.1-py2.6.egg/restish/app.py", line 18, in __call__
    response = self.get_response(request, resource_or_response)
  File "/home/sgoss/mailman_env/lib/python2.6/site-packages/restish-0.12.1-py2.6.egg/restish/app.py", line 65, in get_response
    resource_or_response = resource_or_response(request)
  File "/home/sgoss/mailman_env/lib/python2.6/site-packages/restish-0.12.1-py2.6.egg/restish/resource.py", line 212, in __call__
    return _dispatch(request, match, lambda r: callable(self, r))
  File "/home/sgoss/mailman_env/lib/python2.6/site-packages/restish-0.12.1-py2.6.egg/restish/resource.py", line 243, in _dispatch
    response = func(request)
  File "/home/sgoss/mailman_env/lib/python2.6/site-packages/restish-0.12.1-py2.6.egg/restish/resource.py", line 212, in <lambda>
    return _dispatch(request, match, lambda r: callable(self, r))
  File "/home/sgoss/mailman/src/mailman/rest/members.py", line 78, in member
    return http.ok([], self._resource_as_json(self._member))
  File "/home/sgoss/mailman/src/mailman/rest/helpers.py", line 125, in _resource_as_json
    return etag(self._resource_as_dict(resource))
  File "/home/sgoss/mailman/src/mailman/rest/members.py", line 53, in _resource_as_dict
    enum, dot, role = str(member.role).partition('.')
AttributeError: 'NoneType' object has no attribute 'role'

The platform is Centos 6 (64 bit), system python (2.6.5) running in a
--no-site-packages virtualenv with the following python libs:

$ pip freeze
WebOb==1.1beta1
argparse==1.2.1
decorator==3.3.1
distribute==0.6.8
flufl.bounce==0.91
flufl.enum==3.1
flufl.i18n==1.0.4
flufl.lock==2.1
httplib2==0.7.1
lazr.config==1.1.3
lazr.delegates==1.2.0
lazr.smtptest==1.3
mailman==3.0.0a7-
mimeparse==0.1.3
restish==0.12.1
storm==0.18
zc.buildout==1.5.2
zope.component==3.10.0
zope.configuration==3.7.4
zope.event==3.5.0-1
zope.exceptions==3.6.1
zope.i18nmessageid==3.6.1
zope.interface==3.6.4
zope.schema==3.8.0
zope.testing==3.10.2

** Affects: mailman
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Mailman
Coders, which is subscribed to GNU Mailman.
https://bugs.launchpad.net/bugs/821020

Title:
  Attempting to GET a nonexistent members object results in a 500
  instead of a 404.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mailman/+bug/821020/+subscriptions


More information about the Mailman-coders mailing list