picobrew_pico
picobrew_pico copied to clipboard
502 Bad Gateway - Change default update_boot to False to prevent service hang on reboot
On a Raspberry Pi 4 with a fresh installation, the picobrew_pico service starts correctly on the first boot. However, after a reboot, the service gets stuck in a 'starting' state and the web server never becomes accessible, displaying http 502 - Bad Gateway.
This appears to be caused by the default setting update_boot: True in config.yaml triggering pip3 install -r requirements.txt (which doesn't complete) on every reboot.
Steps to reproduce the behavior:
- Flash the latest project image onto an SD card.
- Boot a Raspberry Pi 4 with the card. The server starts successfully.
- Reboot the Raspberry Pi.
- Observe that the service now fails to reach the 'running' state.
Expected behavior
- The Picobrew service starts successfully after every reboot.
Workaround
The issue is resolved by editing /etc/rc.local and commenting out the 3 lines below Updating Picobrew Server... . After this change, the service starts successfully on subsequent reboots.