Cannot connect to UPM local server in CI after upgrade

I have a build runner which makes builds automatically, and am trying to upgrade the project from 2021.1.15f1 to 2021.3.21f1. When running the project locally, or when launching it manually via Hub on the build machine, there are no problems - the package manager starts, dependencies are resolved, we’re all good. However, when the it’s running in the CI, the package manager process tries and fails to start, which means dependencies aren’t resolved and the build fails:

[Licensing::Client] Successfully resolved entitlements
[Package Manager] Server::CheckExitCode – Server stopped with exit code 101
[Package Manager] PackageManager Server::Start – Process restart attempt #2
[Package Manager] Server::Start – Port 63163 was selected
[Package Manager] Done resolving packages with errors in 12.86s seconds
Failed to resolve packages: Cannot connect to Unity Package Manager local server. No packages loaded.
A re-import of the project may be required to fix the issue or a manual modification of C:/Gitlab-Runner/builds/2xdyj_xv/0/dev/dtto/DTTO/Packages/manifest.json file.
Exiting without the bug reporter. Application will terminate with return code 1

I have tried re-importing the project as it suggests, without success (somewhat unsurprisingly, since the project is re-imported as part of the build anyway) and I don’t believe the manifest.json is wrong, since it works perfectly fine in the previous Unity version, as well as when opening the project outside the CI.

I haven’t changed my build scripts at all, besides updating the version - and since the version is correctly picked up, that seems unlikely to be the issue. What is error code 101 (is there somewhere that UPM’s error codes are documented?) ? What am I missing? What should I try?

Hi @catmxt ! Exit code 101 is “Unhandled error” in the Unity Package Manager. You might be able to find some hints in the upm.log file which is created next to the Editor.log file (see the Unity Manual for the exact location).