public-ip icon indicating copy to clipboard operation
public-ip copied to clipboard

ETIMEDOUT and ECONNRESET when running this action

Open patryk-b-jrdltd opened this issue 2 years ago • 32 comments

It appears that there is some issue with this actions. The errors described below appears around 50% of the time.

Run haythem/[email protected]
  with:
    maxRetries: 5
Error: read ECONNRESET

and

Run haythem/[email protected]
  with:
    maxRetries: 5
Error: connect ETIMEDOUT 104.237.62.212:443

From the source code I can see that you fetch the IP from an external site. Maybe adding some backup sites to get the IP would be a better approach, since the error appears to be caused by that site?

patryk-b-jrdltd avatar Dec 13 '22 14:12 patryk-b-jrdltd

I'm hitting the exact same issue using haythem/[email protected] Started earlier today

john-mcnamee avatar Dec 13 '22 21:12 john-mcnamee

Same issue happening to me about half of the time. I have not been able to recreate any failures manually by hitting https://api.ipify.org?format=json directly.

tedparagon avatar Dec 13 '22 22:12 tedparagon

Hello,

I'm looking into it. I'll keep you posted.

haythem avatar Dec 15 '22 11:12 haythem

I have the same experience using haythem/[email protected].

kp-tim-rutte avatar Jan 18 '23 20:01 kp-tim-rutte

Same issue today with v1.2 and v1.3

carl-perry avatar Jan 18 '23 21:01 carl-perry

We are facing the same issue today

Matze0900 avatar Jan 19 '23 09:01 Matze0900

Saw the same issue couple of times today 😬

amalsgit avatar Jan 19 '23 10:01 amalsgit

This issue is also affecting us

adamkowalczyk-vocovo avatar Jan 19 '23 13:01 adamkowalczyk-vocovo

Hello everybody,

I'm sorry for the inconvenience. After investigating for some time, it appears that the ipify APIs is complaining about the request randomly. I'm trying to reach out to the owner of service. In the mean time, I'll be building and hosting my own server for IP resolution.

I'll keep you posted. Hang tight.

haythem avatar Jan 19 '23 13:01 haythem

For what it's worth, the @actions/http-client doesn't handle retries for connection issues (rejects here) such as what we are experiencing here.

jromero-pg avatar Mar 10 '23 11:03 jromero-pg

Any update here? Seeing the same issue on my end 😭

sidpremkumar avatar Mar 14 '23 15:03 sidpremkumar

Same here, just re-tried and worked though :)

sinwoobang avatar Mar 28 '23 12:03 sinwoobang

Any news on this chaps? Is becoming quite the issue for us?

pd2xsl avatar Apr 11 '23 18:04 pd2xsl

@haythem have you put this project aside? If so please let us know so we can fork into a new project and create a fixable instance. There is a PR awaiting approval to resolve the issue.

Any kind of feedback much would be appreciated.

pd2xsl avatar May 08 '23 11:05 pd2xsl

@pd2xsl did you end up forking this? Issue has been cropping up more and more lately

sr523 avatar May 15 '23 11:05 sr523

@sr523 Nope not yet. Might be good to move forward with it though which is shame.

pd2xsl avatar May 15 '23 11:05 pd2xsl

I ended up deploying an azure function app to get around these issues. I retrieve the IP with curl in the YML files:

ip=$(curl -s https://example.azurewebsites.net/api/ip?code=xxx)
echo "IP: ${ip}"

You can get the github runner's IP address from the X-Forwarded-For HTTP header.

tamas-kr avatar May 15 '23 12:05 tamas-kr

Hello everyone,

Sorry for the late response, I've been very busy lately with my daily job. I've already created the server and I'm trying to make some time to deploy it (probably this week-end).

haythem avatar May 16 '23 09:05 haythem

I have the same problem. Tal

talr avatar Jun 08 '23 15:06 talr

I'm running into the same issue. Is there any update regards deploying the back-up server? Thanks for all your work into this Action!

frank-navara avatar Jun 12 '23 14:06 frank-navara

Had the same problem as well using the following P.R. and switching to the forked action resolved it for me ftm:

https://github.com/haythem/public-ip/pull/24

sylus avatar Jun 12 '23 17:06 sylus

I too have had issues with this recently. I've created a workaround for Linux based runners using Cloudflare and a built in command using bash. Both are used here as a comparison.

    - name: Get Public IP (cloudflare-ip)
      id: cloudflare-ip
      run: | 
        ipv4=$(dig +short -4 txt ch whoami.cloudflare @1.0.0.1)
        echo "ipv4=$ipv4" >> $GITHUB_OUTPUT
      
    - name: Get Public IP (public-ip)
      id: public-ip
      uses: haythem/[email protected]

    - name: Log IP
      run: |
        echo IP Using haythem/public-ip: ${{ steps.public-ip.outputs.ipv4 }}
        echo IP Using cloudflare: ${{ steps.cloudflare-ip.outputs.ipv4 }}

In general both respond in a second or two, but today I saw this action take 1m20s to respond where Cloudflare responded in one second.

DamienDennehy avatar Jun 14 '23 19:06 DamienDennehy

Seems like this worked for me. This url seems busted https://api.ipify.org?format=json with it answering requests every now and again. Also see notes about data format for second url response. Hope this helps someone. Can use my forked action if need be here 10ure-devs/[email protected] Screen Shot 2023-06-15 at 11 10 21 AM

malimohub avatar Jun 15 '23 16:06 malimohub

It has started to become a big blocker in some actions for me.

LIke @DamienDennehy I solved it by stopping using this and writing a simple curl command to get my IP from the URL of my choice. Based upon the GitHub documentation for Defining outputs for jobs

I can get an IP from any service, in this case canhazip.com and pass it as an output with the key ip to another step.

The ID of the step generating the IP address has a name of publicip and by echoing the result of the curl:

echo "ip='$response'" >> "$GITHUB_OUTPUT"

the IP address can be referenced in another step as steps.publicip.outputs.ip.

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    env:
      AWS_INSTANCE_SG_ID: sg-06d03c9f12345678
    steps:
      - name: Checkout
        uses: actions/[email protected]

      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v2
        with:
          role-to-assume: arn:aws:iam::123456789012:role/github-actions-role
          aws-region: ca-central-1

      - name: Get Public IP
        id: publicip
        run: |
          response=$(curl -s canhazip.com)
          echo "ip='$response'" >> "$GITHUB_OUTPUT"

      - name: Allowlist GH Actions runner IP address
        run: |
          aws ec2 authorize-security-group-ingress \
            --group-id $AWS_INSTANCE_SG_ID \
            --protocol tcp \
            --port 22 \
            --cidr ${{ steps.publicip.outputs.ip }}/32

Works very well.

Screenshot 2023-06-19 at 14 29 14

lantrix avatar Jun 19 '23 04:06 lantrix

@lantrix This worked great for me. In my case I had to modify the job output to not wrap with single quotes.

- echo "ip='$response'" >> "$GITHUB_OUTPUT"
+ echo "ip=$response" >> "$GITHUB_OUTPUT"

brandonmbanks avatar Dec 08 '23 14:12 brandonmbanks

@lantrix Thank you so much! This solved our issue as well.

danielhorvath-cleo avatar Jan 30 '24 16:01 danielhorvath-cleo

reappeared in the past couple days.. any way to set a small timeout and proceed, if not actions is waiting on it for 2+ minutes

rfai8me avatar Jun 27 '24 16:06 rfai8me

I'm also facing this issue. The Timeout idea makes sense to me. What is canhazip.com exactly? It seems to provide the request ip but is this a trusted domain/tool? And if it goes down presumably this step would fail completely. @lantrix

ishields avatar Jun 29 '24 14:06 ishields

I'm also facing this issue. The Timeout idea makes sense to me. What is canhazip.com exactly? It seems to provide the request ip but is this a trusted domain/tool? And if it goes down presumably this step would fail completely. @lantrix

Pretty sure it was bought by cloudflare at some point. https://chatgpt.com/share/d45dff03-ec58-4007-a5ed-68328d133264

lantrix avatar Jun 29 '24 14:06 lantrix

Also encountered this issue, Any solve for this?

samofwise avatar Jul 02 '24 07:07 samofwise