Skip to content

test flake: TestRemoteCacheRegistrySeparateImportExport - connection refused reaching registry #7681

Closed

Description

@vito

https://dagger.cloud/dagger/traces/321f2e777c47c9ca7651a28633a08420?span=79134fa449a2f409&logs#79134fa449a2f409:L3797`

Error: make request: input: container.from.withExec.stdout resolve: failed to copy: httpReadSeeker: failed open: failed to do request: Get "http://registry:5000/v2/test-cache-a/blobs/sha256:c74b3fa9b6e492458102dbd87edf33967a1863e12ac8a138fbc12c6f87483f18": dial tcp 10.88.0.107:5000: connect: connection refused

Test:       	TestRemoteCacheRegistrySeparateImportExport

cc @sipsma

Activity

  1. sipsma commented on Jun 17, 2024

    @sipsma
    Contributor

    The registry service being used by the engines just stopped running in the middle of the test: https://dagger.cloud/dagger/traces/321f2e777c47c9ca7651a28633a08420?span=79134fa449a2f409&logs#79134fa449a2f409:L1802

    So it makes sense the engine got a connection refused when trying to use it. But doesn't make sense that it just stopped running since it was a service bound to other running services.

    Would need the logs of the outer engine to debug more, but don't see the name of engine connected to printed in the cloud logs, is that correct @vito?

  2. vito commented on Jun 17, 2024

    @vito
    ContributorAuthor

    Would need the logs of the outer engine to debug more, but don't see the name of engine connected to printed in the cloud logs, is that correct @vito?

    Yeah this is a gap, the engine name only shows up in plain output at the moment. Hmm. It might make its way into telemetry already (via resource attributes), but we don't show it in the UI.

  3. vito commented on Jun 19, 2024

    @vito
    ContributorAuthor

    Noticed it was pretty easy to repro the registry exiting from a particular test so added some logs to the engine and found this:

    time="2024-06-19T17:38:42Z" level=warning msg="!!! SERVICE EXITED" cmd="/entrypoint.sh /etc/docker/registry/config.yml" err="map[error:exit code: 141 kind:*errors.withStack stack:<nil>]" service="xxh3:ed1f507231e06760" session=ukwbmwy7kdsoxd42vkhep6t2j
    

    (note: there's a non-!!! log that also shows this:)

    time="2024-06-19T17:38:42Z" level=debug msg="> container done liq5slvzlt1lngha31pck1iw8 [/.init /entrypoint.sh /etc/docker/registry/config.yml]" client_hostname=buildkitsandbox client_id=dpuvp5cfclfplg9ktpzqtq9ra error="exit code: 141" session_id=ukwbmwy7kdsoxd42vkhep6t2j
    

    141 = SIGPIPE 🤔

    repro (takes a few runs):

    dagger-dev call --source .:default test custom --pkg ./core/integration --run 'ForceCompression'
    

    Associated run:

  4. vito commented on Jun 19, 2024

    @vito
    ContributorAuthor
    [pid  1506] 13:52:28 write(2, "time=\"2024-06-19T17:52:28.414540923Z\" level=info msg=\"response completed\" go.version=go1.20.8 http.request.host=\"registry:5000\" http.request.id=133b3e63-7956-4a75-b579-50694c556be7 http.request.method=GET http.request.remoteaddr=\"10.87.0.15:57134\" http.request.uri=\"/v2/testcontainerpublishforcecompressionestargz/manifests/iebn5anrdi1gf9a1elxdudeju\" http.request.useragent=go-containerregistry http.response.contenttype=\"application/vnd.oci.image.manifest.v1+json\" http.response.duration=2.126706ms http.response.status=200 http.response.written=700 \n", 552) = -1 EPIPE (Broken pipe)
    

    but why?

    strace-happy-registry.log
    strace-sigpipe-registry.log

  5. vito commented on Jun 19, 2024

    @vito
    ContributorAuthor

    Managed to strace the runc process:

    strace-runc-happy.log
    strace-runc-sigpipe.log

    Strangely we can see that the other end of the pipe does read() the same data that the write() SIGPIPEs on:

    [pid 196099] 14:34:20 read(13,  <unfinished ...>
    [pid 196095] 14:34:20 <... futex resumed>) = 0
    [pid 196095] 14:34:20 write(1, "10.87.0.184 - - [19/Jun/2024:18:34:20 +0000] \"PUT /v2/testcontainerpublishforcecompressiongzip/blobs/uploads/580abfba-8502-4c28-a2b4-27cc6eee3be9?_state=tADWGXcmmevnL1bNklSe-PKnMYvwL7_cSMPrViccig97Ik5hbWUiOiJ0ZXN0Y29udGFpbmVycHVibGlzaGZvcmNlY29tcHJlc3Npb25nemlwIiwiVVVJRCI6IjU4MGFiZmJhLTg1MDItNGMyOC1hMmI0LTI3Y2M2ZWVlM2JlOSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyNC0wNi0xOVQxODozNDoyMC4xOTEzNTYyNTFaIn0%3D&digest=sha256%3Ad25f557d7f31bf7acfac935859b5153da41d13c41f2b468d16f729a5b883634f HTTP/1.1\" 201 0 \"\" \"buildkit/v0.0-dev\"\n", 524 <unfinished ...>
    [pid 196094] 14:34:20 <... epoll_pwait resumed>[], 128, 0, NULL, 0) = 0
    [pid 196095] 14:34:20 <... write resumed>) = 524
    [pid 196094] 14:34:20 futex(0xc000101148, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
    [pid 196095] 14:34:20 read(11,  <unfinished ...>
    [pid 196100] 14:34:20 <... futex resumed>) = 0
    [pid 196094] 14:34:20 <... futex resumed>) = 1
    [pid 196094] 14:34:20 nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>
    [pid 196100] 14:34:20 futex(0xc000101148, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
    [pid 196094] 14:34:20 <... nanosleep resumed>NULL) = 0
    [pid 196094] 14:34:20 futex(0xc000101148, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
    [pid 196100] 14:34:20 <... futex resumed>) = 0
    [pid 196094] 14:34:20 <... futex resumed>) = 1
    [pid 196100] 14:34:20 futex(0xc000101148, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
    [pid 196094] 14:34:20 nanosleep({tv_sec=0, tv_nsec=20000}, NULL) = 0
    [pid 196094] 14:34:20 futex(0x7f7cb54d6ea0, FUTEX_WAIT_PRIVATE, 0, {tv_sec=60, tv_nsec=0} <unfinished ...>
    [pid 196099] 14:34:20 <... read resumed>"time=\"2024-06-19T18:34:20.562277231Z\" level=error msg=\"response completed with error\" err.code=\"manifest unknown\" err.detail=\"unknown tag=wqenwkle9vmxntn0b1vhui4br\" err.message=\"manifest unknown\" go.version=go1.20.8 http.request.host=\"registry:5000\" http.request.id=4e946782-3de8-47b3-b87e-8037c66a9e8b http.request.method=HEAD http.request.remoteaddr=\"10.87.0.184:41270\" http.request.uri=\"/v2/testcontainerpublishforcecompressiongzip/manifests/wqenwkle9vmxntn0b1vhui4br\" http.request.useragent=\"buildkit/v0.0-dev\" http.response.contenttype=\"application/json; charset=utf-8\" http.response.duration=1.281029ms http.response.status=404 http.response.written=115 vars.name=testcontainerpublishforcecompressiongzip vars.reference=wqenwkle9vmxntn0b1vhui4br \n", 32768) = 753
    [pid 196095] 14:34:20 <... read resumed>"10.87.0.184 - - [19/Jun/2024:18:34:20 +0000] \"HEAD /v2/testcontainerpublishforcecompressiongzip/manifests/wqenwkle9vmxntn0b1vhui4br HTTP/1.1\" 404 115 \"\" \"buildkit/v0.0-dev\"\n", 32768) = 173
    [pid 196099] 14:34:20 futex(0x7f7cb54d6ea0, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
    [pid 196095] 14:34:20 sched_yield( <unfinished ...>
    [pid 196099] 14:34:20 <... futex resumed>) = 1
    [pid 196095] 14:34:20 <... sched_yield resumed>) = 0
    [pid 196094] 14:34:20 <... futex resumed>) = 0
    [pid 196099] 14:34:20 write(2, "time=\"2024-06-19T18:34:20.562277231Z\" level=error msg=\"response completed with error\" err.code=\"manifest unknown\" err.detail=\"unknown tag=wqenwkle9vmxntn0b1vhui4br\" err.message=\"manifest unknown\" go.version=go1.20.8 http.request.host=\"registry:5000\" http.request.id=4e946782-3de8-47b3-b87e-8037c66a9e8b http.request.method=HEAD http.request.remoteaddr=\"10.87.0.184:41270\" http.request.uri=\"/v2/testcontainerpublishforcecompressiongzip/manifests/wqenwkle9vmxntn0b1vhui4br\" http.request.useragent=\"buildkit/v0.0-dev\" http.response.contenttype=\"application/json; charset=utf-8\" http.response.duration=1.281029ms http.response.status=404 http.response.written=115 vars.name=testcontainerpublishforcecompressiongzip vars.reference=wqenwkle9vmxntn0b1vhui4br \n", 753 <unfinished ...>
    [pid 196095] 14:34:20 futex(0x7f7cb54d6db8, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
    [pid 196099] 14:34:20 <... write resumed>) = -1 EPIPE (Broken pipe)
    
  6. vito commented on Jun 19, 2024

    @vito
    ContributorAuthor

    Interestingly that trace shows runc is getting a SIGPIPE from... itself? I thought that was showing the registry getting a SIGPIPE while writing to runc, but it's actually 100% runc in that trace. Attaching another that shows the process tree and command name proving it:

    strace-runc-self.log

    Trace:

  7. vito commented on Jun 19, 2024

    @vito
    ContributorAuthor

    Stepping away from this for now, here's my horrific scripting for posterity:

    while true; do pid=$(ps auxf | grep -A1 '[/]usr/local/bin/runc' | tee /tmp/strace4.log | grep -B1 /registry | grep /runc | grep -v grep | awk '{print $2}'); if [[ -n "$pid" ]]; then strace --decode-pids=comm -s 2000 -vvtf -p "$pid" 2>&1 | tee -a /tmp/strace4.log; break; fi; done
    while dagger-dev call --source .:default test custom --pkg ./core/integration --run '/ForceCompression' --count=100 --failfast; do date; done
  8. sipsma commented on Jul 1, 2024

    @sipsma
    Contributor

    This should be fixed by #7696

  9. vito commented on Jul 1, 2024

    @vito
    ContributorAuthor

    @sipsma might be wrong (typing from airport) but I thought that was for a separate test? This one had the registry abruptly exiting, never got to the bottom of it

  10. sipsma commented on Jul 1, 2024

    @sipsma
    Contributor

    @vito shit sorry you are right, I was going through my 1000 open tabs too quickly and misread this, re-opening!

  11. reopened this on Jul 1, 2024
  12. added
    kind/flake
    on Oct 10, 2024
  13. sipsma commented on Oct 10, 2024

    @sipsma
    Contributor

    I have not seen this one since July I think, so closing for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cikind/flake

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions