default_ttl and default_hide read in as strings, not ints from conf file

Bug #809524 reported by Tony Wooster
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Burrow
Fix Committed
Undecided
Eric Day

Bug Description

Using the default burrowd.conf file, as provided with burrow, meaning that the server is loaded with a wsgi frontend and a sqlite :memory: backend, attempting to create a message causes the server to error.

Output follows (conf modified for port 8081 due to conflict):

woostert@capstoneDD:~$ 2011-07-12 12:35:18,330 - burrow.backend.sqlite - DEBUG - Module created
2011-07-12 12:35:18,356 - burrow.frontend.wsgi - DEBUG - Module created
2011-07-12 12:35:18,359 - burrow.frontend.wsgi - INFO - Listening on 0.0.0.0:8081
2011-07-12 12:35:18,359 - burrow.server - INFO - Waiting for all threads to exit
2011-07-12 12:35:18,359 - burrow.frontend.wsgi - DEBUG - (6948) wsgi starting up on http://0.0.0.0:8081/

woostert@capstoneDD:~$ curl -X PUT -H 'Content-Type: text/plain' -d 'message body' 'http://localhost:8081/v1.0/acct/queue/messageid'
2011-07-12 12:35:29,684 - burrow.frontend.wsgi - DEBUG - Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/burrow-2011.2-py2.7.egg/burrow/frontend/wsgi.py", line 111, in __call__
    return self._routes(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/pymodules/python2.7/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.7/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/burrow-2011.2-py2.7.egg/burrow/frontend/wsgi.py", line 122, in _route
    return method(req, **args)
  File "/usr/lib/pymodules/python2.7/webob/dec.py", line 161, in __call__
    return self.func(req, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/burrow-2011.2-py2.7.egg/burrow/frontend/wsgi.py", line 209, in _put_message
    attributes):
  File "/usr/local/lib/python2.7/dist-packages/burrow-2011.2-py2.7.egg/burrow/backend/sqlite.py", line 161, in create_message
    ttl += int(time.time())
TypeError: cannot concatenate 'str' and 'int' objects
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/burrow-2011.2-py2.7.egg/burrow/frontend/wsgi.py", line 111, in __call__
    return self._routes(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/lib/pymodules/python2.7/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.7/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/burrow-2011.2-py2.7.egg/burrow/frontend/wsgi.py", line 122, in _route
    return method(req, **args)
  File "/usr/lib/pymodules/python2.7/webob/dec.py", line 161, in __call__
    return self.func(req, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/burrow-2011.2-py2.7.egg/burrow/frontend/wsgi.py", line 209, in _put_message
    attributes):
  File "/usr/local/lib/python2.7/dist-packages/burrow-2011.2-py2.7.egg/burrow/backend/sqlite.py", line 161, in create_message
    ttl += int(time.time())
TypeError: cannot concatenate 'str' and 'int' objects
2011-07-12 12:35:29,684 - burrow.frontend.wsgi - DEBUG - 127.0.0.1 "PUT /v1.0/acct/queue/messageid HTTP/1.1" 500 1471 0.002903
woostert@capstoneDD:~$

As far as I can tell, this results from wsgi lines 71/72:

        self.default_ttl = self.config.get('default_ttl', DEFAULT_TTL)
        self.default_hide = self.config.get('default_hide', DEFAULT_HIDE)

Where these should be:

        self.default_ttl = self.config.getint('default_ttl', DEFAULT_TTL)
        self.default_hide = self.config.getint('default_hide', DEFAULT_HIDE)

Eric Day (eday)
Changed in burrow:
status: New → Fix Committed
assignee: nobody → Eric Day (eday)
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.