Troubleshooting¶
Find tips and tricks for common issues.
General problems¶
If you get strange errors when running a session with re-used virtual environment,
it could be that your Python version changed or something else broke.
It is often a good idea to first try to re-create the virtual environment
by simply running the session without -R or -r:
# Run the lint session and re-create all virtual environments for it
nox -e lint
pipx run noxfile.py -e lint
uv run noxfile.py -e lint
This often resolves the problems.
The wrong container engine is used for certain sessions¶
For sessions that require a container engine, antsibull-nox tries to detect the appropriate one:
-
For execution environment sessions (
ee-check), one of Podman or Docker is determined when the session is started. The behavior can be configured by the environment variableANTSIBULL_NOX_CONTAINER_ENGINE.If set to
podmanordocker, that container engine will be used. If set toauto,auto-prefer-docker, orauto-prefer-podman, antsibull-nox will try to find thepodmanordockerCLI tools in the execution path and use that information to select the container engine to use.The default value is
auto. -
For ansible-test sessions, ansible-test itself detects whether to use Podman or Docker. By default it prefers
dockerif bothdockerandpodmanare available. If the environment variableANSIBLE_TEST_PREFER_PODMANis set to a non-empty value, it will preferpodmanoverdocker.If
ANSIBLE_TEST_PREFER_PODMANis not set, butANTSIBULL_NOX_CONTAINER_ENGINEis set to something other thanauto,ANSIBLE_TEST_PREFER_PODMANwill be set to""(that is, prefer Docker) or1(that is, prefer Podman) accordingly.
Differences between CI and local runs¶
If you notice that your local tests report different results than CI, re-creating the virtual environments can also help. Sometimes linters have newer versions with more checks that are running in CI, while your local virtual environments are still using an older version.
Avoid sudden CI breakages due to new versions¶
As a collection maintainer,
if you prefer that new tests do not suddenly appear,
you should use the *_package parameters to the various antsibull.add_*() function calls
to pin specific versions of the linters.
Note
If you pin specific versions, you yourself are responsible for bumping these versions from time to time.
Change detection does not work¶
- Did you configure the Version Control System in antsibull-nox.toml?
- Did you set the environment variable
ANTSIBULL_CHANGE_DETECTIONtotrue? - Did you set
ANTSIBULL_BASE_BRANCHto the base branch, if it is not the main development branch of your collection? - Try to run
antsibull-nox show-changesto see what change detection finds. - Does the test you run actually support change detection?