No internet connection
  1. Home
  2. Technical Support

502 error on Voyager 2a, no physical access to device

By Greg Barwis @gbarwis
    2024-04-24 20:32:17.388Z2024-04-24 21:39:11.929Zassigned to
    • @david

    Hello,

    I have a Voyager 2a running Tinypilot version 2.6.3 that is giving me the "TinyPilot is not Running" browser page.

    My logfile upload can be found at https://logs.tinypilotkvm.com/Bh2nJXvX

    I set up this device at my home office last week, and it was working fine, including remote access to it via Tailscale from several different locations. I shipped it to a remote office and they plugged it in today, and I've been unable to connect to the graphical interface.

    Some additional details:

    • There is no computer connected to it currently, only ethernet and power.
    • I'm connecting via Tailscale VPN, which indicates that the device is online and available.
    • I can successfully SSH to the device.
    • The device is about a thousand miles away from me, and the on-site staff needed facetime assistance just plugging it into power, so I can't do anything to the box that requires physical access to it.
    • From the logfiles and from the output of sudo service tinypilot restart it appears that the tinypilot service is in a restart loop, bouncing about once per second.
    • I have rebooted the device both via sudo reboot and by having an on-site user physically disconnect and reconnect power to the box.

    I'm not sure if this is relevant, but I notice in the logs, just before each restart of the tinypilot service, I see the following few lines:

    Apr 24 20:39:38 tinypilot python[1410]:   File "/opt/tinypilot/venv/lib/python3.9/site-packages/dns/version.py", line 2
    Apr 24 20:39:38 tinypilot python[1410]:     else:
    Apr 24 20:39:38 tinypilot python[1410]: IndentationError: unexpected indent
    Apr 24 20:39:38 tinypilot systemd[1]: tinypilot.service: Main process exited, code=exited, status=1/FAILURE
    Apr 24 20:39:38 tinypilot systemd[1]: tinypilot.service: Failed with result 'exit-code'.
    Apr 24 20:39:39 tinypilot systemd[1]: tinypilot.service: Scheduled restart job, restart counter is at 234.
    Apr 24 20:39:39 tinypilot systemd[1]: Stopped TinyPilot - RPi-based virtual KVM.
    

    That IndentationError: unexpected indent is a little odd, so here are the entire contents of the file it mentions in the Traceback:

    ns.xfr.make_query(txn_manager)
        else:
            serial = dns.xfr.extract_serial_from_query(query)
        rdtype = query.question[0].rdtype
        is_ixfr = rdtype == dns.rdatatype.IXFR
        origin = txn_manager.from_wire_origin()
        wire = query.to.wire()
        af = dns.inet.af_for_address(where)
        stuple = source_tuple(af, source, source_port)
        dtuple = (where, port)
        (_, expiration) = _compute_times(lifetime)
        retry = True
    

    Line 2 has the indented else: command - I'm not too savvy about Python, but shouldn't we expect that to have a preceding if or elif somewhere?

    Here's more:

    $ source /opt/tinypilot/venv/bin/activate
    $ pip list | grep dns
    dnspython          2.4.1
    $ pip show dnspython
    Name: dnspython
    Version: 2.4.1
    ...
    Location: /opt/tinypilot/venv/lib/python3.9/site-packages
    

    Looking at the github repository for dnspython, that definitely doesn't look like their version.py file that I have here... would it be worth reinstalling this particular library with something like this?

    pip install --force-reinstall dnspython==2.4.1
    

    FWIW, the only changes I have so far made to the host were when I still had it with me, and those changes were (1) using the GUI to update to the latest version of TinyPilot, and (2) installing and configuring Tailscale.

    Please advise. As I'm unable to lay hands on the box, I need to avoid a factory reset - I shudder at the thought of trying to walk my non-technical users through the setup and usage of Etcher and the reconfiguration of Tailscale.

    Solved in post #2, click to view
    • 3 replies
    1. David @david2024-04-25 11:43:08.246Z2024-04-25 18:06:46.116Z

      Hi @gbarwis, I'm sorry you're running into this 502 error.

      Thanks for all of those details and for sharing a log!

      Your log looks ok with the exception of the indentation error you pointed out. You're right that we should expect an if statement to precede else here. That indentation error is causing the TinyPilot service to fail, explaining why you can't access the TinyPilot web interface.

      Looking at the file itself, it looks broken (and not at all like the original file). I think the best option here (short of a re-flash) is to uninstall and then reinstall TinyPilot Pro. There's a chance other files are also broken, so it's easier to reinstall instead of manually fixing individual files. Reinstalling TinyPilot Pro doesn't affect any of your TinyPilot's settings, users, or third-party software (like a regular TinyPilot update).

      First, visit the download page, verify your license details, and locate the instructions for a command line installation. Don't run the commands just yet - you'll need to uninstall the TinyPilot software first.

      SSH into your TinyPilot and run the following command to remove the TinyPilot software from your system:

      sudo apt remove --yes tinypilot
      

      Now follow the command line installation instructions from the download page.

      Once the installation completes, you should be able to start using your TinyPilot device as normal.

      If reinstalling gets you back up and running, I'd recommend enabling the read-only filesystem on your TinyPilot to help prolong the life of your microSD card and prevent these types of issue from recurring.

      I hope that helps! Please let me know if you have any questions.

      ReplySolution
      1. GGreg Barwis @gbarwis
          2024-04-25 16:09:51.491Z2024-04-25 16:22:10.881Z

          Thanks, David, this resolved it. Upon checking further, I discovered several other files in the python3.9 library that had become similarly corrupted, so I'm glad in hindsight that I didn't try to reinstall packages piecemeal. I've reinstalled (and switched the FS to read-only!) and everything's coming up roses.

          It might be worth including information (either in your FAQ or in the text you use to describe the reinstallation of TinyPilot Pro) about what sort of things survive the reinstallation of TinyPilot Pro. At the risk of listing things that may be obvious to more savvy users, I'm just going to drop these here in case somebody in the future stumbles across this thread while troubleshooting their own issues.

          After removing and reinstalling the TinyPilot software:

          • If you've previously enabled SSH, that will continue to function.
          • If you've previously set up TailScale for VPN-based access, that will continue to function.
          • If you've set up additional users (via System -> Security), those accounts will remain.
          • There may be other things that survive a removal and reinstallation (I didn't test more extensively).

          Best regards and thanks again for your help!

          1. David @david2024-04-25 18:08:48.833Z

            Thanks for the update! You're welcome - I'm glad you're back up and running again.

            It might be worth including information (either in your FAQ or in the text you use to describe the reinstallation of TinyPilot Pro) about what sort of things survive the reinstallation of TinyPilot Pro.

            Great point!

            Uninstalling and reinstalling works similarly to a TinyPilot software update. Your TinyPilot database, settings files, and other configuration don't get touched. Additionally, non-TinyPilot-specific items like your device's hostname, other software (like Tailscale), and SSH access aren't modified either.

            Anything that a TinyPilot update normally overwrites wouldn't survive a reinstall like this - but we point out these instances (like USB identifiers). Sorry for not being explicit. I've updated my previous comment to clarify for anyone else that looks to reinstall their TinyPilot software.

            Please feel free to reach out again!