Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agents fail to start if you don't install all browsers if you use WPT_UPDATE_OS=n and WPT_UPDATE_BROWSERS=y #10

Open
rposbo opened this issue Dec 6, 2021 · 0 comments

Comments

@rposbo
Copy link

rposbo commented Dec 6, 2021

tl;dr - --only-upgrade fails for uninstalled packages that live in different apt-repositories, so if you've set up your installation using WPT_UPDATE_OS=n and WPT_UPDATE_BROWSERS=y the 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:

  1. 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.

  1. Add the Firefox repository
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
  1. Run the exact same --only-upgrade command again (i.e., referencing both Chrome and Firefox, neither of which are installed, but only Firefox has an apt repository referenced)
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

@rposbo rposbo changed the title Agents fail to start if you don't install all browsers Agents fail to start if you don't install all browsers if you use WPT_UPDATE_OS=n and WPT_UPDATE_BROWSERS=y Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant