-
Notifications
You must be signed in to change notification settings - Fork 25
Description
tl;dr -
--only-upgradefails for uninstalled packages that live in different apt-repositories, so if you've set up your installation usingWPT_UPDATE_OS=nandWPT_UPDATE_BROWSERS=ythe agent will fail to start
Although theoretically you can call apt install --only-upgrade with all the browsers you might have installed and let it silently ignore those that are not installed, this line fails if you choose to install a subset of the browsers using, e.g., WPT_FIREFOX=false as apt doesn't know about the packages, so it is erroring instead of failing silently:
https://github.com/WPO-Foundation/wptagent-install/blob/d9d967271cf9b857bf59c1c9c1a64de424faff10/debian.sh#L603
To replicate on a clean ubuntu 20.04 EC2:
- Execute a failing install (this example just using Chrome and Firefox packages)
sudo DEBIAN_FRONTEND=noninteractive apt -yq --only-upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install google-chrome-stable google-chrome-beta google-chrome-unstable firefox firefox-trunk firefox-esr firefox-geckodriver
Results show failures for Chrome and Firefox, instead of silently ignoring them as they're not installed:
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package google-chrome-stable
E: Unable to locate package google-chrome-beta
E: Unable to locate package google-chrome-unstable
E: Unable to locate package firefox-trunk
E: Unable to locate package firefox-esr
E: Unable to locate package firefox-geckodriver
This causes the agent to fall into an infinite loop, as that line is part of a until loop.
sudo add-apt-repository -y ppa:ubuntu-mozilla-daily/ppa
sudo add-apt-repository -y ppa:mozillateam/ppa
# and update the package tree
sudo apt -y update
- Run the exact same
--only-upgradecommand again (i.e., referencing both Chrome and Firefox, neither of which are installed, but only Firefox has anapt repositoryreferenced)
sudo DEBIAN_FRONTEND=noninteractive apt -yq --only-upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install google-chrome-stable google-chrome-beta google-chrome-unstable firefox firefox-trunk firefox-esr firefox-geckodriver
This time only Chrome fails, not Firefox:
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package google-chrome-stable
E: Unable to locate package google-chrome-beta
E: Unable to locate package google-chrome-unstable
These lines mean the apt-repository are unknown to the WPT agent:
https://github.com/WPO-Foundation/wptagent-install/blob/d9d967271cf9b857bf59c1c9c1a64de424faff10/debian.sh#L557-L560
Proposed patch
a) Either add all browser's apt repositories regardless of the choice the user has made, or
b) Build the list of browsers to update according to the choice the user has made