Thursday, December 17, 2015

Error 98 Address already in use in Python

Sometimes bottlewebserver in Python on my Raspberry Pi hangs 'for no good reason'. Upon restarting from the LX Terminal window, the above error appears and Bottle Web Server will not start.

I've read Stack Overflow postings where, if you wait for one and a half minutes the port will free up and the server can then be started. This does not seem to happen in my case.

The only way to restart the server, other than a reboot, is to do the following:

$ ps -fA | grep python

The result will then give a line something like this:

root 2130 1 0 11:08 ? 00:00:00 sudo python bottlewebserver4.py

Then simply issue:

$ sudo kill 2130
After this the bottlewebserver will start.

No comments: