Maslow Home Maslow Community Garden Newsletter

Update after Webcontrol Update

After update the server fails to start.

-$$$$$-
/home/pi/webcontrol/main.py
/home/pi/webcontrol
-$$$$$-
opening browser
Checking latest pyrelease.
Traceback (most recent call last):
File “main.py”, line 782, in
File “site-packages/flask_socketio/init.py”, line 556, in run
File “site-packages/gevent/baseserver.py”, line 362, in serve_forever
File “site-packages/gevent/baseserver.py”, line 306, in start
File “site-packages/gevent/pywsgi.py”, line 1487, in init_socket
File “site-packages/gevent/server.py”, line 146, in init_socket
File “site-packages/gevent/server.py”, line 157, in get_listener
File “site-packages/gevent/server.py”, line 256, in _tcp_listener
OSError: [Errno 98] Address already in use: (‘0.0.0.0’, 5000)
[14285] Failed to execute script main
Exception ignored in: <function _removeHandlerRef at 0xb58b35d0>
Traceback (most recent call last):
File “logging/init.py”, line 736, in _removeHandlerRef
File “logging/init.py”, line 219, in _acquireLock
File “threading.py”, line 141, in acquire
TypeError: ‘NoneType’ object is not callable

Looks like this is the important part:

You already have something running on port 5000, perhaps the old version is still running?

1 Like

I should have read closer. A restart fixed it. Thank you!

1 Like

I’d also recommend not using port 5000, it is a little bit ‘common’.

Well, it’s the default port for WebControl, and has been for a while, so… (I agree with you, though, I just think the cat’s already out of the bag)

It’s the default port for lots of things Python …

Which is why it may clash with other projects on peoples systems - still that always makes for a fun time debugging that stuff.

Webcontrol has a mechanism for changing the port that’s used. Upon startup, it looks for a file called webcontrol-xxxx.port in the .WebControl directory. It parses the xxxx value and uses that as the port number going forward (and then deletes the file). See the checkForTouchedPort() command in config.py

1 Like