Github Action and OSError: [Errno 99] Cannot assign requested address

I am trying to run my tests for 4 versions of python, and tests are mostly spinning new webservers and running my application against it. Tests are working, but its randomly failing one or two py version with an error.

OSError: [Errno 99] Cannot assign requested address

I am using simple server creation on the random address provided by the system, so when I am getting this error, the testing system doesn’t give me any address at all.

Here is a question:
is there anything specific to github action I need to fix to make it work?

Currently running with ubuntu-latest.

I am seeing the same. One example is this failed build, which failed because of a test not being able to bind to a port. This seems to be a temporary error, rebuilding mostly fixes the issue. We have started to see this error for only a couple of weeks now, before it was fine.

It looks random, to be honest. In my flow, it makes ci system pretty useless, guess need to switch to azure pipelines for some time.=(

The reverse hostname lookup for the current host name seems to be broken in GitHub Actions Runner VMs. It has been an issue for apache/pulsar recently.
Here’s one way to resolve it (tested with ubuntu-latest):

- name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
  run: |
     echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
2 Likes

I reported the issue as Reverse name lookup is broken for current hostname in ubuntu-latest VMs · Issue #3185 · actions/virtual-environments · GitHub .

2 Likes

Thank you Lari for pointing the issue.

Comments are disabled on the issue reported in actions/virtual-environments, so I’ll add an observation here.
It seems like a problem caused by Azure configuration for GitHub Runner VMs. Azure added support for reverse DNS lookups in April 2020. It is possible to disable reverse DNS lookups in Azure. This could be a way to address the issue for all GitHub Runner VMs. Before this is fixed, the /etc/hosts workaround is needed.

It’s not only ubuntu-latest / ubuntu-20.04 that is impacted. The problem appear on other VM types too. I have checked that ubuntu-18.04 is also impacted, perhaps others too.

We have the same issue in apache zeppelin

According to the latest comment in the issue about this problem a solution should have been rolled out, so you should be able to remove any workarounds you put in place :tada:

1 Like