0

i have web app that i have developed using bottle micro framework. However it crash a lot and all of them suddenly without any action ( without using the web app) . So i have reviewed the logs file and find the following errors (i have no idea what the causation of these errors):

Traceback (most recent call last):
  File "/home/hamoud/lib/python2.7/bottle.py", line 2699, in run
    server.run(app)
  File "/home/hamoud/lib/python2.7/bottle.py", line 2385, in run
    srv = make_server(self.host, self.port, handler, **self.options)
  File "/usr/local/lib/python2.7/wsgiref/simple_server.py", line 144, in make_server
    server = server_class((host, port), handler_class)
  File "/usr/local/lib/python2.7/SocketServer.py", line 419, in __init__
    self.server_bind()
  File "/usr/local/lib/python2.7/wsgiref/simple_server.py", line 48, in server_bind
    HTTPServer.server_bind(self)
  File "/usr/local/lib/python2.7/BaseHTTPServer.py", line 108, in server_bind
    SocketServer.TCPServer.server_bind(self)
  File "/usr/local/lib/python2.7/SocketServer.py", line 430, in server_bind
    self.socket.bind(self.server_address)
  File "/usr/local/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
TypeError: 'int' object is not callable

and

Traceback (most recent call last):
  File "interface.py", line 29, in <module>
    run(host="localhost", port=32471, reloader=True, debug=True)
  File "/home/hamoud/lib/python2.7/bottle.py", line 2657, in run
    os.utime(lockfile, None) # I am alive!
OSError: [Errno 2] No such file or directory: '/tmp/bottle.gQmJc8.lock'

However the second error doesn't crash the application ( application would continue working ) but for the first one it's require manual work ( run the app again ).

i could schedule task using cron job to run the application when it's crash. but i'd like to know what's the problem in my app.

ron rothman
  • 17,348
  • 7
  • 41
  • 43
Hamoudaq
  • 1,490
  • 4
  • 23
  • 42

1 Answers1

0

A few ideas come to mind:

  1. Could there be another program on your machine (e.g., a cron job) that is deleting files from /tmp?

  2. Are you using the latest version of Bottle? (From the line number in your stacktrace, it looks like you might not be.)

  3. If nothing else works, try running without reloader=True (or use reloader=False). I looked at the Bottle code, and that change should at least work around the problem, even though we don't know the cause (yet).

Hope that helps.

ron rothman
  • 17,348
  • 7
  • 41
  • 43