Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ue4-docker diagnostics network always fails in my end #311

Closed
dstkibrom opened this issue Apr 7, 2023 · 1 comment
Closed

ue4-docker diagnostics network always fails in my end #311

dstkibrom opened this issue Apr 7, 2023 · 1 comment

Comments

@dstkibrom
Copy link

dstkibrom commented Apr 7, 2023

When i run the ue4-docker diagnostics network it was always failing in my side and i though i had issues in my network while using ue4-docker. And then I tried to run the Docker src/ue4docker/dockerfiles/diagnostics/network/linux/Dockerfile independently. It still gave me an error.

FROM alpine:latest

# Add a sentinel label so we can easily identify intermediate images
LABEL com.adamrehn.ue4-docker.sentinel="1"

# Attempt to download the Chocolatey installation script (not actually useful under Linux of course, but useful as a network test)
RUN wget 'https://chocolatey.org/install.ps1'

The error i was getting in my terminal looks as follows:

[ue4-docker diagnostics] Running diagnostic: "Check that containers can access the internet correctly"
[ue4-docker diagnostics] [network] Attempting to build an image that accesses network resources...
[ue4-docker diagnostics] [network] Run: ['docker', 'build', '-t', 'adamrehn/ue4-docker/diagnostics:network', '/home/akibrom/miniconda3/lib/python3.10/site-packages/ue4docker/dockerfiles/diagnostics/network/linux']
[+] Building 1.0s (5/5) FINISHED                                                                         
 => [internal] load build definition from Dockerfile                                                0.0s
 => => transferring dockerfile: 349B                                                                0.0s
 => [internal] load .dockerignore                                                                   0.0s
 => => transferring context: 2B                                                                     0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                    0.7s
 => CACHED [1/2] FROM docker.io/library/alpine:latest@sha256:124c7d2707904eea7431fffe91522a01e5a86  0.0s
 => ERROR [2/2] RUN wget 'https://chocolatey.org/install.ps1'                                       0.3s
------                                                                                                   
 > [2/2] RUN wget 'https://chocolatey.org/install.ps1':                                                  
#0 0.302 Connecting to 172.16.98.151:8118 (172.16.98.151:8118)
#0 0.340 wget: error getting response
------
Dockerfile:7
--------------------
   5 |     
   6 |     # Attempt to download the Chocolatey installation script (not actually useful under Linux of course, but useful as a network test)
   7 | >>> RUN wget 'https://chocolatey.org/install.ps1'
   8 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c wget 'https://chocolatey.org/install.ps1'" did not complete successfully: exit code: 1
[ue4-docker diagnostics] [network] Build failed!
[ue4-docker diagnostics] [network] Cleaning up...
[ue4-docker diagnostics] [network] Run: ['docker', 'system', 'prune', '-f']
Deleted Images:
deleted: sha256:f6c2465f8bb2ca1fb428e96350055abcf179a7a21811140d5dc56b28910c5742

Deleted build cache objects:
j2uxwa82vyj43gxe7449f3s7r
rfz1z8fdhha53czlaqstgx3v5
h37f4r9uv1mmpunz8mecywony
nq05qmhqssgnewcb1cuvx1uyg
sn3xf69z6sm29abh0g5hkz60y
i5ids8m9f5hz78xjws9wj4qzw
ic1mgdhqvnbzr4g84lqnwvo16

Total reclaimed space: 5.743MB

[ue4-docker diagnostics] [network] Diagnostic failed! Running containers cannot access network resources. See the docs for troubleshooting tips:
[ue4-docker diagnostics] [network] https://docs.adamrehn.com/ue4-docker/building-images/troubleshooting-build-issues#building-the-ue4-build-prerequisites-image-fails-with-a-network-related-error

[ue4-docker diagnostics] Diagnostic result: failed

But after changing the docker file to the following, the diagnostics passed with out an issue.

FROM alpine:latest

# Add a sentinel label so we can easily identify intermediate images
LABEL com.adamrehn.ue4-docker.sentinel="1"

#line added by me
RUN apk update && apk add wget

# Attempt to download the Chocolatey installation script (not actually useful under Linux of course, but useful as a network test)
RUN wget 'https://chocolatey.org/install.ps1'

So i am wondering if the diagnostics has a problem and it should have added the line i added to my docker file. Or is it that my diagnostics really failed and I need other solution.

  • Are you accessing the network through a proxy server? Yes
@TBBle
Copy link
Collaborator

TBBle commented Apr 7, 2023

The error and the fix imply that the failed run was using busybox wget, not GNU wget, but apk add wget installed GNU wget.

Busybox wget apparently has issues with HTTP proxies and TLS. I couldn't find a relevant busybox bug report in basically zero time looking, so this also might be fixed in a newer busybox.

The only thing I'm suspicious about is that the error seen in that bug includes a : Connection reset by peer which ours does not have. Since the call being checked (fgets) can return NULL without setting errno if it hits EOF with nothing read, this is possibly correct, i.e if the EOF is also a reason to fail. It's also possible that this is the bug in busybox, and the caller was expecting to handle a zero-length read +EOF but instead the whole process terminated.

A much older occurrence of this same issue has been seen in Alpine with this precise error message; it was closed as fixed but later reported as still occurring in 2021 with Alpine 3.13.

A problem with the proposed fix is that if you can apk update, your network is clearly working, and we don't need the wget call at all. (There have been problems with chocolatey downloads specifically, but that only makes sense to test from the Windows diagnostic image.) So perhaps the fix is to apk update and not bother with the rest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants