No web interface on first boot
Just got the TinyPilot Voyager, and on first boot, there's no web interface. I can SSH in, but nothing is listening on any external IP, except the SSH daemon.
I can see that cycle-tls-keys.service failed:
● cycle-tls-keys.service - Cycle TLS keys
Loaded: loaded (/lib/systemd/system/cycle-tls-keys.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-03-18 17:04:06 EDT; 1 months 18 days ago
Process: 365 ExecStart=/opt/cycle-tls-keys (code=exited, status=2)
Main PID: 365 (code=exited, status=2)
Mar 18 17:03:44 tinypilot ansible-apt[637]: Invoked with name=python3-pip state=present package=['python3-pip'] cache_valid_time=0 purge=False for
Mar 18 17:03:46 tinypilot cycle-tls-keys[365]: ok: [localhost]
Mar 18 17:03:46 tinypilot cycle-tls-keys[365]: TASK [tinypilot.tinypilot-pro : install PyOpenSSL] *****************************
Mar 18 17:03:47 tinypilot ansible-pip[668]: Invoked with name=['cryptography==3.3.2', 'pyopenssl==20.0.1'] state=present virtualenv_site_packages=
Mar 18 17:04:06 tinypilot cycle-tls-keys[365]: fatal: [localhost]: FAILED! => {"changed": false, "cmd": ["/opt/tinypilot-updater/venv/bin/pip3", "
Mar 18 17:04:06 tinypilot cycle-tls-keys[365]: PLAY RECAP *********************************************************************
Mar 18 17:04:06 tinypilot cycle-tls-keys[365]: localhost : ok=2 changed=0 unreachable=0 failed=1 skipped=0 rescued
Mar 18 17:04:06 tinypilot systemd[1]: cycle-tls-keys.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Mar 18 17:04:06 tinypilot systemd[1]: cycle-tls-keys.service: Failed with result 'exit-code'.
Mar 18 17:04:06 tinypilot systemd[1]: Failed to start Cycle TLS keys.
Could this be because I didn't have the ethernet connected initially? Any way this service could be made to retry on network in a future revision of the software?
- Michael Lynch @michael2021-05-06 21:18:36.278Z
Sorry about that! I didn't realize there was a dependency on Ethernet connectivity. I'll make it keep retrying and fix it so that it doesn't need Internet for that initial install.
If you run this command, it should finish the provisioning:
/opt/tinypilot-privileged/update
- JIn reply tojoeyparrish⬆:Joey Parrish @joeyparrish
No worries about emailing a fix, Michael. I've already fixed this device by restarting that service. But I already love this thing, and I anticipate talking my boss into buying more of them for our lab. :-) I just wanted to report the issue to make sure you had a chance to fix it in some future update.
Thanks!
- Michael Lynch @michael2021-05-28 14:06:34.915Z
Just to close the loop on this, this turned out to be two compounding bugs.
The first bug was that the cycle-tls-keys script depended on a different version of the cryptography pip package than the core TinyPilot install used. So cycling the TLS keys required internet connectivity to install the matching version. I fixed that by matching the two up and adding a comment to keep them in sync.
The second bug was that cycle-tls-keys didn't retry on failure. I thought I could fix it at the systemd level, since systemd now supports auto-restarts for one-shot services. Unfortunately, Raspbian's version of systemd is still v241, and support for restarts wasn't added until v244. Instead, I'm retrying within the bash script itself, but it does work.
So in the next release, TinyPilot's first startup should happen faster and shouldn't depend on Internet connectivity. And if it fails, it will keep retrying until it succeeds.
Thanks again for reporting this, @joeyparrish!