public-ip
public-ip copied to clipboard
ETIMEDOUT and ECONNRESET when running this action
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?
I'm hitting the exact same issue using haythem/[email protected]
Started earlier today
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.
Hello,
I'm looking into it. I'll keep you posted.
I have the same experience using haythem/[email protected].
Same issue today with v1.2 and v1.3
We are facing the same issue today
Saw the same issue couple of times today 😬
This issue is also affecting us
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.
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.
Any update here? Seeing the same issue on my end 😭
Same here, just re-tried and worked though :)
Any news on this chaps? Is becoming quite the issue for us?
@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 did you end up forking this? Issue has been cropping up more and more lately
@sr523 Nope not yet. Might be good to move forward with it though which is shame.
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.
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).
I have the same problem. Tal
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!
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
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.
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]
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.
@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"
@lantrix Thank you so much! This solved our issue as well.
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
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
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
Also encountered this issue, Any solve for this?