Page MenuHomePhabricator

Vagrant: error handling in LsbCheck is fragile
Open, LowPublic

Description

The comm.execute call in LsbCheck was failing due to T228580: Vagrant ssh password should not expire (an SSH error), and the entire output was

$ vagrant provision
==> default: Running provisioner: lsb_check...

Whatever magic that custom error class in LsbCheck is supposed to do, it's not very good at it.

Event Timeline

Actually T228580 might be unrelated, I'm getting the same error even after it has been fixed. With VAGRANT_LOG=debug I get

 INFO ssh: Execute: cat <<'EOF' | /usr/bin/env bash
          set -e
          REQUIRED_VENDOR=Debian
          REQUIRED_VERSION=^9
          VENDOR=$(lsb_release -is)
          VERSION=$(lsb_release -rs)
          if ! [[ $VENDOR == $REQUIRED_VENDOR && $VERSION =~ $REQUIRED_VERSION ]]; then
            echo "MediaWiki-Vagrant requires a $REQUIRED_VENDOR $REQUIRED_VERSION guest OS"
            echo 'Your guest OS reports:'
            lsb_release -irc | sed 's/^/    /'
            echo 'Please rebuild using `vagrant destroy -f; vagrant up`'
            echo 'NOTE: this will cause you to lose any data saved in the VM.'
            exit 1
          fi

EOF (sudo=false)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: stderr: Fatal Python error: Py_Initialize: can't initialize time
OverflowError: timestamp too large to convert to C _PyTime_t

...

ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: MediaWikiVagrant::LsbCheck::Error
ERROR vagrant: 
<stack trace starting with comm.execute>

So apparently Fatal Python error: Py_Initialize: can't initialize time OverflowError: timestamp too large to convert to C _PyTime_t is thrown by lsb_release. Huh.
(A vagrant reload fixed it; it's a brand new box, no idea what happened.)

In any case LsbCheck should really report the error output by the script.

Aklapper triaged this task as Low priority.Dec 6 2022, 10:26 AM