Cherrypy Errors?

185 views
Skip to first unread message

mic...@yanovich.net

unread,
Apr 17, 2014, 2:39:44 PM4/17/14
to perspect...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

I just recently noticed this error:

ERROR:cherrypy.error:[17/Apr/2014:18:13:18] ENGINE TypeError("argument of type 'NoneType' is not iterable",)
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/cherrypy/wsgiserver/wsgiserver2.py", line 1292, in communicate
req.parse_request()
File "/usr/lib/python2.7/dist-packages/cherrypy/wsgiserver/wsgiserver2.py", line 580, in parse_request
success = self.read_request_line()
File "/usr/lib/python2.7/dist-packages/cherrypy/wsgiserver/wsgiserver2.py", line 644, in read_request_line
if NUMBER_SIGN in path:
TypeError: argument of type 'NoneType' is not iterable



Seems to happen once in a while. I'm not sure which queries are causing this to happen, nor of a way to reproduce it.

Just thought I'd put this out there.

- --
Michael Yanovich

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCgAGBQJTUB/rAAoJEKBpQL3CDq4d4SMP/AvE3dyGdFsqb51Ydq3Rj0NU
WS3yutrasxuLDgIgVayYw3XGul1gMakM2V+x2DwjhOMuD5BUvzXiFV2gkPp4gtCL
2SmrgtDwT+2bqpDpgiUIEccYb/od0o+Ws6H0ii99p79Fer7M5KFNZEzOghYC/OyA
z5FL/ikX1ZMIApbCqABpVoGsxeu3UNKR3uNYqabxR+HK/E3rhsVnzY8e1baWvqzE
AnLKazfobCpYVP/WHa8LRktLGpo1FP0NDkUGtjXlUUQqnQTCes8WCXU4VrOsNWEk
k2wfq5/AblFhl7ZjBBhK8TTEQ6Xo6xCu2lOxMJDl1mk/ubWc2m3SMF1ZfwkWy/zX
PUYkd2I80KPxpeS4L5farjsLIOLEi9HXPxJyys5p7/W9j+vvCW0nAcd8IdPYffTJ
NYih3Y2JGyhasDUV1+96hNxJSUln+1hXG5ayqznxAa3K84roORAiQf44mbZea11+
ZgDaCK7eQLwhd/ZqJg8isTh+QLKEwOgYsN083/gmNFnYCNL/B5tKPzbReHfw1ARr
BWv+6euezjryxd8CAJ7zgEl2qGzN0wWkj4PnDz+Nxr4ZZD0PjpeeRG6k85Ax+dEs
J0oKMlNuTdeHH3g7YyH9voPxwcK1T5o4NuaDxRMhX7ldrDdFWqhHccK9mOkT0WL7
o7oXg8Fg0d7r+kvdTgxw
=LZ/A
-----END PGP SIGNATURE-----

Dave Schaefer

unread,
Apr 17, 2014, 10:40:44 PM4/17/14
to perspect...@googlegroups.com
>TypeError: argument of type 'NoneType' is not iterable

Hey Michael, thanks for the report. I have not seen this in any of the
logs for heimdal. So nice find ;) I don't see any reports in the
cherrypy mailing list either. Any idea what site you might have been
querying around that time? What version of cherrypy are you running?

From the error message it looks like python is complaining about being
asked to work with the 'path' variable when path is None. e.g. we may
want something like this: instead of

if NUMBER_SIGN in path:

we could have

if path and NUMBER_SIGN in path:


Farther down in that function there is a line that says

if QUESTION_MARK in path:

That will probaby fail in the same way.

Looking at cherrypy's code, it appears 'path' can certainly become
None from some calls to parse_request_uri() - there is a case where
the function returns (None, uri, None), which would set the path to
None and presumably trigger this bug. However, I was unable to trigger
that case with a few minutes of trying. I think we'd need someone who
knows more about cherrypy, what cherrypy 'authority' URLs are, and how
they work.

Are you interested in pinging the cherrypy list?

If you know what kind of URL your notary might have been fed that
would be very useful. From looking at parse_request_uri() it looks
like:

- it cannot be '*'
- it cannot have both '://' and a question mark
- it cannot start with '/'

Most notary URLs I've seen start with / or have a ?, so I would be
interested to see what happened here.


Summary: looks like a cherrypy bug. I'm not sure what the correct fix is.

Thanks for the report!

Chris Hills

unread,
Jul 11, 2015, 10:01:33 AM7/11/15
to perspect...@googlegroups.com
Did this get resolved? I recently installed perspectives server and I am running into the same issue:-

$ tail logs/webserver.log
ERROR:cherrypy.error:[11/Jul/2015:13:01:42] ENGINE TypeError("argument of type 'NoneType' is not iterable",)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 1292, in communicate
    req.parse_request()
  File "/usr/lib/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 580, in parse_request
    success = self.read_request_line()
  File "/usr/lib/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 644, in read_request_line
    if NUMBER_SIGN in path:
TypeError: argument of type 'NoneType' is not iterable

$ rpm -q --whatprovides "/usr/lib/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py"
python-cherrypy-3.2.2-4.el7.noarch

My server is running at http://notary1.chaz6.com:8080/

Dave Schaefer

unread,
Jul 11, 2015, 2:55:07 PM7/11/15
to perspect...@googlegroups.com
Hey Chris, thanks for reporting this. Do you happen to know the site
or URL that causes this to happen? That would be very useful.

Chris Hills

unread,
Jul 13, 2015, 2:58:10 PM7/13/15
to perspect...@googlegroups.com
I'm sorry I don't know what site is causing it. Can you suggest how to find out? I just had a look in the log and it's showing a different error:-

ERROR:cherrypy.error.44152656:[13/Jul/2015:13:24:53] HTTP Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 656, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 34, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/cherrypy/_cptools.py", line 168, in handle_func
    handled = self.callable(*args, **self._merged_args(kwargs))
TypeError: staticfile() got multiple values for keyword argument 'filename'

Reply all
Reply to author
Forward
0 new messages