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

RTNETLINK answers: File exists / Linux route add command failed #9

Open
davetapley opened this issue Dec 28, 2021 · 1 comment
Open

Comments

@davetapley
Copy link

I was having an issue where the action appeared to complete successfully,
but nothing was reachable.

On close inspection I saw RTNETLINK answers: File exists / Linux route add command failed in the logs:

Tue Dec 28 01:36:27 2021 ROUTE_GATEWAY 10.1.0.1/255.255.0.0 IFACE=eth0 HWADDR=00:0d:3a:c3:be:d8
[...]
Tue Dec 28 01:36:27 2021 /sbin/ip route add 10.1.0.0/16 via 10.2.128.1
RTNETLINK answers: File exists
Tue Dec 28 01:36:27 2021 ERROR: Linux route add command failed: external program exited with error status: 2
[...]
VPN connected successfully. Daemon PID: 2665

I figured (via netstat -rn) that I was just unlucky that the hosted runners have a conflicting route:

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.1.0.1        0.0.0.0         UG        0 0          0 eth0
10.1.0.0        0.0.0.0         255.255.0.0     U         0 0          0 eth0
168.63.129.16   10.1.0.1        255.255.255.255 UGH       0 0          0 eth0
169.254.169.254 10.1.0.1        255.255.255.255 UGH       0 0          0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U         0 0          0 docker0

I'm not sure what that route is for, but with this workaround ⬇️ I was able to get it working 💫

      - name: Delete conflicting route
        run: sudo route del -net 10.1.0.0 gw 0.0.0.0 netmask 255.255.0.0 dev eth0

      - name: Connect to VPN
        uses: "kota65535/github-openvpn-connect-action@v1"

I think there are a few solutions here:

  • Easier: Detect the ERROR: Linux route add command failed and fail the action.
  • Harder: Detect conflict and automatically sudo route del.

It would also be nice to know why the runners have that route 🤔

@luisiturrios1
Copy link

I have the same issue thanks for share. 🥇

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