How to resolve a migration issue

This article provides guidance on how to resolve migration issues.

Proposed migration series

The proposed migration article series explains the various migration failures and ways of investigating them.

Process overview:

Proposed migration

Issue types:
Practical guidance:

How to resolve a migration issue (this article)

Understand autopkgtest logs

When examining a log of a failed autopkgtest run, start from the end of the file. This usually shows a summary of the test runs or an error message in case of an error. For example:

done.
done.
(Reading database ... 50576 files and directories currently installed.)
Removing autopkgtest-satdep (0) ...
autopkgtest [21:40:55]: test command1: true
autopkgtest [21:40:55]: test command1: [-----------------------
autopkgtest [21:40:58]: test command1: -----------------------]
command1             PASS
autopkgtest [21:41:03]: test command1:  - - - - - - - - - - results - - - - - - - - - -
autopkgtest [21:41:09]: @@@@@@@@@@@@@@@@@@@@ summary
master-cron-systemd  FAIL non-zero exit status 1
master-cgi-systemd   PASS
node-systemd         PASS
command1             PASS

This shows that the test named master-cron-systemd has failed. To see why it failed, search the page for master-cron-systemd, and iterate until you get to the last line of the test run. Then scroll up to find the failed test cases:

autopkgtest [21:23:39]: test master-cron-systemd: preparing testbed
...
...
autopkgtest [21:25:10]: test master-cron-systemd: [-----------------------
...
...
not ok 3 - munin-html: no files in /var/cache/munin/www/ before first run
#
#   find /var/cache/munin/www/ -mindepth 1 >unwanted_existing_files
#   test_must_be_empty unwanted_existing_files
#
...
...
autopkgtest [21:25:41]: test master-cron-systemd: -----------------------]
master-cron-systemd  FAIL non-zero exit status 1
autopkgtest [21:25:46]: test master-cron-systemd:  - - - - - - - - - - results - - - - - - - - - -
autopkgtest [21:25:46]: test master-cron-systemd:  - - - - - - - - - - stderr - - - - - - - - - -
rm: cannot remove '/var/cache/munin/www/localdomain/localhost.localdomain': Directory not empty

All autopkgtests follow this general format, although the output from different tests varies.

Beyond “regular” test case failures like this one, autopkgtest failures also occur due to missing or incorrect dependencies, test framework timeouts, and other issues. See Autopkgtest regressions for details.

Anomalous autopkgtest logs

It is possible, in rare cases, that upon checking the logs, you find that autopkgtest died before the tests even ran, or otherwise show unexpected modes of error. Some of these cases point to real issues with the package, and others are due to problems unrelated to the package (and are therefore often ephemeral).

For example, you may see a very short log ending with:

eof from the virtualization server

or a result-less failure like:

autopkgtest [16:46:34]: ERROR: timed out on command <...>

The autopkgtest viewer reports such a case as a “Temp Fail” (tmpfail). These are, as the name implies, temporary failures that are not necessarily related to the package being tested. If you see this, try re-running the test.

If, however, you see this consistently (after several retries), this may indicate underlying issues with the infrastructure itself, and you should check with Ubuntu developers on Matrix if there is a known problem. For information on how to connect with the community on Matrix, see Using Matrix.

Alternatively, you may encounter an error in APT dependency resolution, reported as FAIL badpkg, such as:

1577s The following packages have unmet dependencies:
1578s  satisfy:command-line : Depends: netplan.io:i386 but it is not installable
1578s                         Depends: netplan-generator:i386 but it is not installable
1578s                         Depends: python3-netplan:i386 but it is not installable
1578s                         Depends: libnetplan1:i386 but it is not installable
1578s                         Depends: libnetplan-dev:i386 but it is not installable
1578s E: Unable to satisfy dependencies. Reached two conflicting assignments:
1578s    1. satisfy:command-line:amd64=1 is selected for install
1578s    2. satisfy:command-line:amd64 Depends netplan.io:i386
1578s       but none of the choices are installable:
1578s       [no choices]

This means that autopkgtest couldn’t find the required dependencies for the test, be that for the package under test or something external required for that specific test case.

One common place where you see such an error is when you attempt to run an autopkgtest suite on the i386 architecture for a package not built for that architecture, as in the example above. In this case, it is not a failure within the package, and it can be remedied by either not running that architecture, or adding this package to the i386 allowlist by contacting an Archive admin. However, there are cases where APT resolution fails that are related to the package.

In some ecosystems, such as Haskell and OCaml, packages have very rigid dependency constraints, as binaries are built against and pinned to specific versions of libraries or compilers. More generally, if an ABI/API change occurs in a dependency, library SONAMEs might change, and your package’s dependencies might have changed out from under it. This can cause your package to no longer be buildable or installable, causing your autopkgtests to fail. Cases like this are solved by no-change rebuilding the package (which might require you to recursively no-change rebuild dependencies), and the perennial suspects can be monitored on the Transition Tracker page. See Transitions for more information on these transitions in general.

External test dependencies

Autopkgtest runs tests in a controlled network environment, so if a test case expects to download material from the internet, it likely fails. This usually means the test case is attempting to download of one the following:

Dependency (e.g. via PIP or Maven)

Try to work around this by adding the missing dependency to debian/tests/control.

Example file

Try to make the test case use a local file, or load the file from the proxy network.

Learn to run autopkgtest

The autopkgtest infrastructure runs tests automatically. This section describes various ways to (re-)trigger test runs or request tests with non-standard dependencies.

Autopkgtest with non-standard dependencies

When investigating an autopkgtest failure, try running the test against various versions of trigger packages. See Test request format in autopkgtest-cloud documentation for detailed reference.

Every autopkgtest request URL uses this format:

https://autopkgtest.ubuntu.com/request.cgi?<PARAM1>=<VALUE>&<PARAM2>=<VALUE>

Special characters, such as + in <VERSION>, must be URL-encoded. Use, for example, the urlencode(1) tool from the gridsite-clients package:

$ urlencode 2.15+dfsg-2
2.15%2Bdfsg-2
Useful triggers for autopkgtest

Test setup

Placement

New URL parameter

Include other packages from -proposed

Append as many as needed to end of URL

&trigger=<SRCPKG>/<VERSION>

Install everything from -proposed

Append to end of URL

&all-proposed=1

Test against packages in -release

Substitute for existing &trigger value

migration-reference/0

Against other packages in -proposed

By default, autopkgtest only uses only one trigger source package from the -proposed pocket. To specify more packages (i.e. to test a package with dependencies on other packages in the -proposed pocket), suffix &trigger=<SRCPKG>/<VERSION> to the test re-trigger URL for each additional source package to use from proposed (right-click the retry URL, copy & paste it into your browser, and append an appropriate string). To construct the URL, append the following after https://autopkgtest.ubuntu.com/request.cgi?:

release=<RELEASE>&arch=<ARCH>&package=<SRCPKG>&trigger=<SRCPKG>/<VERSION>

To install all of the packages involved in your test from the -proposed pocket, append &all-proposed=1 to the request URL (every package installed in the testbed is then installed from -proposed). To construct the URL, append the following after https://autopkgtest.ubuntu.com/request.cgi?:

release=<RELEASE>&arch=<ARCH>&package=<SRCPKG>&trigger=<SRCPKG>/<VERSION>&all-proposed=1

Against packages in -release

To test whether an autopkgtest regression is present in the package version that’s already in the -release and -updates pocket, run autopkgtest against the -release and -updates pocket only (without considering any versions that are in -proposed).

To do this, use the URL &trigger parameter with a value of migration-reference/0 instead of specifying a trigger package and version. To construct the URL, append the following after https://autopkgtest.ubuntu.com/request.cgi?:

release=<RELEASE>&arch=<ARCH>&package=<SRCPKG>&trigger=migration-reference/0

Note

When finished, this test run is visible on the autopkgtest result page for the package but not on the update excuses page.

Possible results with the migration-reference/0 trigger:

Test fails

The test failure for the -proposed version is ignored – the result instructs the autopkgtest infrastructure that it shouldn’t expect this test to pass. Other packages trying to migrate are also not required to pass.

Test succeeds

The assumption that the regression is already present in the package version in -proposed is likely incorrect. The test failure has likely been caused by the new change (upload).

Against a PPA

To get autopkgtest results against PPA uploads (e.g. when attempting to test a regression fix), use the &ppa=<LPUSER>/<PPA> parameter to the test-trigger URL. To construct the URL, append the following after https://autopkgtest.ubuntu.com/request.cgi?:

release=<RELEASE>&arch=<ARCH>&package=<SRCPKG>&trigger=<SRCPKG>/<VERSION>&ppa=<LPUSER>/<PPA>

Important

You must have upload rights for the package (<SRCPKG> above) for the test request to be successful.

The test is then displayed at autopkgtest.ubuntu.com/running. Upon completion, the test result is available at https://autopkgtest.ubuntu.com/user/<LPUSER>/ppa. The index contains the results for each autopkgtest run against this particular <PPA>. To see a particular test, navigate to

https://autopkgtest.ubuntu.com/user/<LPUSER>/ppa

Discover test re-trigger URLs

Tests are discoverable in multiple ways. Choose the approach that best fits your use case.

To check particular packages or tests and find regular patterns:

Navigate the web overview of autopkgtest at autopkgtest,ubuntu.com.

To check the status of a package in proposed migration and analyze what holds the transition back:

Use the Update-excuses page.

Both of these views allow to (re-)trigger failed tests through the web UI.

To obtain re-trigger links based on specified criteria (for more intense work with proposed migration):

Use the retry-autopkgtest-regressions tool from the ubuntu-archive-tools collection.

A common use case is “give me all tests that block a particular package”. This delivers all the URLs listed for the same package at the Update-excuses page with a failure and retry icon. For example:

./retry-autopkgtest-regressions --blocks apache2 --series resolute
https://autopkgtest.ubuntu.com/request.cgi?release=resolute&arch=s390x&package=mediawiki-extension-youtube&trigger=apache2%2F2.4.66-2ubuntu1
https://autopkgtest.ubuntu.com/request.cgi?release=resolute&arch=amd64&package=sitesummary&trigger=apache2%2F2.4.66-2ubuntu1
https://autopkgtest.ubuntu.com/request.cgi?release=resolute&arch=arm64&package=sitesummary&trigger=apache2%2F2.4.66-2ubuntu1
https://autopkgtest.ubuntu.com/request.cgi?release=resolute&arch=i386&package=sitesummary&trigger=apache2%2F2.4.66-2ubuntu1
https://autopkgtest.ubuntu.com/request.cgi?release=resolute&arch=s390x&package=sitesummary&trigger=apache2%2F2.4.66-2ubuntu1
https://autopkgtest.ubuntu.com/request.cgi?release=resolute&arch=ppc64el&package=sitesummary&trigger=apache2%2F2.4.66-2ubuntu1

If an issue has been found, analyzed, and resolved, there often is the need to run the test on a bigger scale. In the example above, sitesummary was generally broken and also blocked the migration of other packages.

While these tests could be executed one by one, that would consume more test resources. Instead, using the --blocked-by-tests option lists URLs that will run the respective test against all packages that are currently blocked due to it at once:

./retry-autopkgtest-regressions --blocked-by-tests sitesummary
https://autopkgtest.ubuntu.com/request.cgi?release=resolute&arch=amd64&package=sitesummary&trigger=debconf%2F1.5.91build1&trigger=gnupg2%2F2.4.8-4ubuntu3&trigger=apache2%2F2.4.66-2ubuntu1
https://autopkgtest.ubuntu.com/request.cgi?release=resolute&arch=arm64&package=sitesummary&trigger=debconf%2F1.5.91build1&trigger=gnupg2%2F2.4.8-4ubuntu3&trigger=apache2%2F2.4.66-2ubuntu1
https://autopkgtest.ubuntu.com/request.cgi?release=resolute&arch=ppc64el&package=sitesummary&trigger=debconf%2F1.5.91build1&trigger=gnupg2%2F2.4.8-4ubuntu3&trigger=apache2%2F2.4.66-2ubuntu1
https://autopkgtest.ubuntu.com/request.cgi?release=resolute&arch=i386&package=sitesummary&trigger=gnupg2%2F2.4.8-4ubuntu3&trigger=apache2%2F2.4.66-2ubuntu1

The examples above cover common workflows, but the retry-autopkgtest-regressions tool offers many more filtering and selection options. For example:

  • --all-proposed to run tests against all packages from -proposed

  • --max-age and --min-age to focus on tests within specific time frames

  • --log-regex to select tests based on log content patterns

Run the tool with --help to see the complete list of available options and discover workflows that match your specific needs.

Trigger tests from the command line

To (re-)trigger several tests at once, use your autopkgtest.ubuntu.com credentials from a browser cookie to perform the HTTP requests from the command line.

Warning

These instructions involve extracting your credentials for the autopkgtest infrastructure from the browser. Secure the credentials, and not to share them.

The credentials are available in a cookie for autopkgtest.ubuntu.com. There are two values to extract:

  • session

  • SRVNAME

  1. Extract the session and SRVNAME values. See instructions on how to do it Firefox or Chromium-based browsers:

    Using Firefox Developer Tools

    1. Browse to autopkgtest.ubuntu.com, and log in.

    2. Open the Developer Tools (by pressing F12 or Ctrl+Shift+C).

    3. Open the Storage tab.

    4. Expand the Cookies menu in the left panel.

    5. Look for an autopkgtest.ubuntu.com entry, and find the values for session and SRVNAME.

    Using Chrome Developer Tools

    1. Browse to autopkgtest.ubuntu.com, and log in.

    2. Open the Developer Tools (by pressing F12 or Ctrl+Shift+I).

    3. Open the Application tab.

    4. Under Storage in the left panel, expand the Cookies item.

    5. Look for an autopkgtest.ubuntu.com entry, and find the values for session and SRVNAME.

  2. Save the values in a local file (e.g., ~/.cache/autopkgtest.cookie) with the following contents:

    autopkgtest.ubuntu.com	TRUE	/	TRUE	0	session	<YOUR_COOKIE_SESSION_VALUE_HERE>
    autopkgtest.ubuntu.com	TRUE	/	TRUE	0	SRVNAME	<YOUR_COOKIE_SRVNAME_VALUE_HERE>
    

    Note that the delimiters used above are tabs (\t) and not spaces. If unsure, use the following commands to create the file with the right format:

    $ printf "autopkgtest.ubuntu.com\\tTRUE\\t/\\tTRUE\\t0\\tsession\\t<YOUR_COOKIE_SESSION_VALUE_HERE>\\n" \
      > ~/.cache/autopkgtest.cookie
    $ printf "autopkgtest.ubuntu.com\\tTRUE\\t/\\tTRUE\\t0\\tSRVNAME\\t<YOUR_COOKIE_SRVNAME_VALUE_HERE>\\n" \
      >> ~/.cache/autopkgtest.cookie
    
  3. Set proper permissions on the .cookie file, so other users cannot read it, e.g. 0600:

    $ chmod 0600 ~/.cache/autopkgtest.cookie
    
  4. Use curl to trigger the autopkgtest URLs. For example:

    $ curl --cookie ~/.cache/autopkgtest.cookie <TEST_TRIGGER_URL>
    

    To use a list of test-trigger URLs:

    $ cat <FILE_WITH_TEST_URL_LIST> | vipe | xargs -rn1 -P10 \
      curl --cookie ~/.cache/autopkgtest.cookie -o /dev/null \
           --silent --head --write-out '%{url_effective} : %{http_code}\\n'