-
This is driving me crazy. I’ve trying to migrate from Travis CI to GitHub Actions CI for months, but I cannot get our test suite to pass when building and testing inside of a container. If I don’t use a container and use use “os: ubuntu-”, the tests pass. If I use a container, however, I get the dreaded “Cannot assign requested address” error. My googling brought up this issue:
Reverse name lookup is broken for current hostname in ubuntu VMs
**Description** Reverse name lookup is broken for the current hostname. Thi…s leads to odd issues. Here are some reports from GitHub Community:
This is a problem report in apache/pulsar: apache/pulsar#10232 I have suggested this general workaround to the problem:
Question, Bug, or Feature?: Bug Virtual environments affected
Expected behavior
Actual behavior
Repro steps Add this command to some action and run it Example output
In the above case, the reverse lookup returns addresses 10.1.1.83 and 10.1.0.37 which aren't the ip addresses of the current host. The address of eth0 is 10.1.1.35 . But that was supposedly fixed and resolved last year. I thought maybe ubuntu:14.04 wasn’t fixed (since it’s ancient and wasn’t listed in the issue), so I tried the workaround that folks used before it was fixed, but I can’t seem to get it working. Can anyone help me, please? Here’s a failing run:
Build software better, togetherGitHub is where people build software. More than 83 million people use GitHub to discover, fork, and contribute to over 200 million projects. Here’s my workflow yml:
gearman/gearmand/blob/e42d60e587d60ac396461a75d6f66d4744e3a565/.github/workflows/c-cpp.yml
on: jobs:
This file has been truncated. show original Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 2 replies
-
Trying again… Can anyone help, please??? |
Beta Was this translation helpful? Give feedback.
-
Does the container image you’re using define an IPv6 address for |
Beta Was this translation helpful? Give feedback.
-
I think so? I “cat /etc/hosts” and run some other network commands in the workflow. Here’s the output:
Build software better, togetherGitHub is where people build software. More than 83 million people use GitHub to discover, fork, and contribute to over 200 million projects.
127.0.0.1 localhost
|
Beta Was this translation helpful? Give feedback.
-
My points is, if your software is trying to bind to the IPv6 address for |
Beta Was this translation helpful? Give feedback.
-
I’m not sure how to investigate it. It’s trying to bind to “localhost”, certainly. What do I need to change in /etc/hosts to get it to work? |
Beta Was this translation helpful? Give feedback.
-
Look at the code: Does it use IPv6 or IPv4/IPv6 dualstack? If yes, you could give it an IPv4 only mode. For a very quick test you could remove the
|
Beta Was this translation helpful? Give feedback.
-
I got a “Device or file busy” error using “sed -i”, so I changed it to this:
Here’s the new contents of
And here’s the output of
I really had high hopes this would work, but it didn’t. 😦 However, the error has now changed from “Cannot assign requested address” to “Connection refused”! So progress, I think! Any other suggestions?
Link: 92 I don’t get why the same code and the same commands work just fine in Travis CI and in the Docker engine running on my Linux box, but I appreciate the assistance!!! |
Beta Was this translation helpful? Give feedback.
-
Never mind! I just got it to work. Finally! For some reason our test suite code to find an available port isn’t working inside the container, but if I force it to use a specific port number that I know is available, then it works! All tests pass! Yippee! |
Beta Was this translation helpful? Give feedback.
Never mind! I just got it to work. Finally!
For some reason our test suite code to find an available port isn’t working inside the container, but if I force it to use a specific port number that I know is available, then it works! All tests pass! Yippee!