OS Updates and PicoChess

130 views
Skip to first unread message

RandyR

unread,
May 16, 2026, 12:45:08 PMMay 16
to PicoChess
The last update I did for RPiOS Desktop updated Python 3.13. This caused PicoChess to fail to start. The picochess.log alludes to what happened:

2026-05-16 11:00:56.926 WARNING  picochess - main: invalid parameter given ['--allow-onboard-without-auth=true']
2026-05-16 11:00:57.437   ERROR  picochess - main: Could not start web server - port 80 not allowed by operating system
2026-05-16 11:00:57.437   ERROR  picochess - main: try: sudo setcap 'cap_net_bind_service=+ep' $(readlink -f $(which python3))


The fix is to either run the 'sudo install-picochess.sh pico' command or the command suggested in the ERROR 'sudo setcap 'cap_net_bind_service=+ep' $(readlink -f $(which python3))'.

Since this requires some Linux terminal interaction (and there is no way to get around this if PicoChess won't start allowing the user to use the PicoChess menu to run the update to fix it) perhaps we should add some code into picochess.py (or use a separate systemd unit) using the 'getcap' command and run the 'setcap' command  to get around this instead of just exiting.

Maybe add this to the to-do list for future improvements.

Randy

Johan Sjöblom

unread,
May 16, 2026, 1:14:59 PMMay 16
to PicoChess
Good testing again. I have to ask some basic assumption/questions just to make sure I get the problem:

After a system update that updates Python that new Python version no longer allows port 80. That's the root cause I guess.

Scenario 1: If you have run the system upgrade yourself on the command line you should of course run the install-picochess again (with pico parameter to make it faster).

I guess the problem is scenario 2: User can run system upgrade from the shutdown menu or from some other menu. Now we have the challenge that how to allow Python port 80 in that case without requiring any command to run install-picochess again...

One possible hardwire could be to add a setcap command to the picochess-updater service that always starts and looks for a flag file and if a flag file is found it runs install-picochess... but we could make it always run the setcap even in the situation where no flag was found, ....?

-- Johan

Randy Reade

unread,
May 16, 2026, 1:39:29 PMMay 16
to pico...@googlegroups.com
Yes. Port :80 is the issue. I guess a different approach could be to switch to port :8080 when the web server loses the permission to port :80. That could allow PicoChess to start and allow the user to access the web interface if the port is specified in the url. The kiosk script would need some logic to switch to port :8080 as well, though. And, the user would have to realize the port needs to be specified...

Yes. Running the install script should be carried out after apt full-upgrade if running from the terminal. But, I typically reboot once after doing an OS update. I actually ran the update from the icon in the system tray at the top right of the Desktop after updating PicoChess.

I think getcap/setcap is probably the easiest path to take.

Randy

--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/picochess/6f23238f-ce1b-4fdf-b64a-65e477bf7da3n%40googlegroups.com.

Johan Sjöblom

unread,
May 17, 2026, 2:53:44 PMMay 17
to PicoChess
Master data hotfixed so that it switches to port 8080 in this case. Also Kiosk script takes that into account and launches :8080. Now latest master should start as you suggested although port 80 rights are lost.
For the "long term" I created this issue: https://github.com/JohanSjoblom/picochess/issues/406, there I will make sure the picochess-updater service always gives port 80 rights... (or some other solution)

Randy Reade

unread,
May 17, 2026, 3:58:27 PMMay 17
to pico...@googlegroups.com
Thanks, Johan. 

Johan Sjöblom

unread,
May 18, 2026, 2:28:25 PMMay 18
to PicoChess
I now updated the run-picochess-if-flagged.sh script. This script is already being run on every boot by the picochess updater service. Now it always sets the setcap for Python, even though no update has been requested.
Anyone in trouble, like Henri, could in theory copy this script to any older version, and the next reboot should then fix the Python port 80 issue. Its commit 0670d39, the latest one in master.
- - Johan
Reply all
Reply to author
Forward
0 new messages