checkPhase fails when building Lix with dockerized Nix #611

Closed
opened 2025-01-02 19:05:38 +00:00 by acid-bong · 4 comments

Describe the bug

I'm building Lix 2.91.1 with a backported patch from main (specifically d0bcdfa6c4) and decided to delegate it to CI (Drone at https://tildegit.org), but it fails to run tests in checkPhase, specifically 4 or the 5 FileTransfer tests:

...
lix> [----------] 5 tests from FileTransfer
lix> [ RUN      ] FileTransfer.exceptionAbortsDownload
lix> [       OK ] FileTransfer.exceptionAbortsDownload (3 ms)
lix> [ RUN      ] FileTransfer.reportsSetupErrors
lix> unknown file: Failure
lix> C++ exception with description "error: bind() failed: Cannot assign requested address" thrown in the test body.
lix> [  FAILED  ] FileTransfer.reportsSetupErrors (0 ms)
lix> [ RUN      ] FileTransfer.defersFailures
lix> unknown file: Failure
lix> C++ exception with description "error: bind() failed: Cannot assign requested address" thrown in the test body.
lix> [  FAILED  ] FileTransfer.defersFailures (0 ms)
lix> [ RUN      ] FileTransfer.handlesContentEncoding
lix> unknown file: Failure
lix> C++ exception with description "error: bind() failed: Cannot assign requested address" thrown in the test body.
lix> [  FAILED  ] FileTransfer.handlesContentEncoding (0 ms)
lix> [ RUN      ] FileTransfer.usesIntermediateLinkHeaders
lix> unknown file: Failure
lix> C++ exception with description "error: bind() failed: Cannot assign requested address" thrown in the test body.
lix> [  FAILED  ] FileTransfer.usesIntermediateLinkHeaders (0 ms)
lix> [----------] 5 tests from FileTransfer (3 ms total)
...

Full logs are available at https://drone.tildegit.org/acidbong/nixos/7/1/2, somewhere after line 16500 (and further builds, where not cancelled), you can also inspect the repo state at the commit that triggered the pipeline.

Steps To Reproduce

No idea, sorry, the internals of the Drone instance are a mystery to me. The only Docker images i've tried are ones built by nix-community, nixpkgs/nix:latest and nixpkgs/cachix-flakes:latest (which is also set up in /.drone.yml in my repo).

Expected behavior

It didn't fail when I built it on my PC.

nix --version output

nix (Nix) 2.24.10

## Describe the bug I'm building Lix 2.91.1 with a backported patch from `main` (specifically d0bcdfa6c49d832b3a51448fdf0a433d8d30b030) and decided to delegate it to CI (Drone at https://tildegit.org), but it fails to run tests in `checkPhase`, specifically 4 or the 5 `FileTransfer` tests: ``` ... lix> [----------] 5 tests from FileTransfer lix> [ RUN ] FileTransfer.exceptionAbortsDownload lix> [ OK ] FileTransfer.exceptionAbortsDownload (3 ms) lix> [ RUN ] FileTransfer.reportsSetupErrors lix> unknown file: Failure lix> C++ exception with description "error: bind() failed: Cannot assign requested address" thrown in the test body. lix> [ FAILED ] FileTransfer.reportsSetupErrors (0 ms) lix> [ RUN ] FileTransfer.defersFailures lix> unknown file: Failure lix> C++ exception with description "error: bind() failed: Cannot assign requested address" thrown in the test body. lix> [ FAILED ] FileTransfer.defersFailures (0 ms) lix> [ RUN ] FileTransfer.handlesContentEncoding lix> unknown file: Failure lix> C++ exception with description "error: bind() failed: Cannot assign requested address" thrown in the test body. lix> [ FAILED ] FileTransfer.handlesContentEncoding (0 ms) lix> [ RUN ] FileTransfer.usesIntermediateLinkHeaders lix> unknown file: Failure lix> C++ exception with description "error: bind() failed: Cannot assign requested address" thrown in the test body. lix> [ FAILED ] FileTransfer.usesIntermediateLinkHeaders (0 ms) lix> [----------] 5 tests from FileTransfer (3 ms total) ... ``` Full logs are available at https://drone.tildegit.org/acidbong/nixos/7/1/2, somewhere after line 16500 (and further builds, where not cancelled), you can also inspect the repo state at the commit that triggered the pipeline. ## Steps To Reproduce No idea, sorry, the internals of the Drone instance are a mystery to me. The only Docker images i've tried are ones built by nix-community, `nixpkgs/nix:latest` and `nixpkgs/cachix-flakes:latest` (which is also set up in `/.drone.yml` in my repo). ## Expected behavior It didn't fail when I built it on my PC. ## `nix --version` output `nix (Nix) 2.24.10`
Owner

#452 possibly related

https://git.lix.systems/lix-project/lix/issues/452 possibly related
Author

Not sure, they seem to experience problems in installCheckPhase, while for me checkPhase fails and I don't reach installCheckPhase myself.

Not sure, they seem to experience problems in `installCheckPhase`, while for me `checkPhase` fails and I don't reach `installCheckPhase` myself.
Owner

So this is the code that's breaking:

trigger.create();
sockaddr_in6 addr = {
.sin6_family = AF_INET6,
.sin6_addr = IN6ADDR_LOOPBACK_INIT,
};
socklen_t len = sizeof(addr);
if (::bind(listener.get(), reinterpret_cast<const sockaddr *>(&addr), sizeof(addr)) < 0) {
throw SysError(errno, "bind() failed");
}
if (::getsockname(listener.get(), reinterpret_cast<sockaddr *>(&addr), &len) < 0) {
throw SysError(errno, "getsockname() failed");
}
if (::listen(listener.get(), 1) < 0) {
throw SysError(errno, "listen() failed");

I think that this could only possibly be busted if:

  • v6 is disabled completely (docker configuration is busted)
  • someone is blocking bind() via seccomp or something (docker config is busted)

Being unable to listen to a socket on localhost that's being used very reasonably (binding to port 0, selecting any free port) seems like the runtime is simply busted in some manner.

So this is the code that's breaking: https://git.lix.systems/lix-project/lix/src/commit/5c7ea4f446de58aa64f78087bb4ec26b9c4111aa/tests/unit/libstore/filetransfer.cc#L75-L89 I think that this could only possibly be busted if: * v6 is disabled completely (docker configuration is busted) * someone is blocking bind() via seccomp or something (docker config is busted) Being unable to listen to a socket on localhost that's being used very reasonably (binding to port 0, selecting any free port) seems like the runtime is simply busted in some manner.
Owner

I think we can't fix this as it seems like an environment issue inside seemingly reasonable code, so I'm going to close it. Feel free to update if you find some more details as to what broke it in the end; it would be nice to potentially detect the fault better.

I think we can't fix this as it seems like an environment issue inside seemingly reasonable code, so I'm going to close it. Feel free to update if you find some more details as to what broke it in the end; it would be nice to potentially detect the fault better.
jade closed this issue 2025-01-14 04:49:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#611
No description provided.