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

Curl command fails without retrying #5

Closed
wbobeirne opened this issue Mar 2, 2021 · 1 comment
Closed

Curl command fails without retrying #5

wbobeirne opened this issue Mar 2, 2021 · 1 comment

Comments

@wbobeirne
Copy link

Here's my step:

      - name: Wait for backend
        id: wait_backend
        uses: jtalk/url-health-check-action@v1.4
        with:
          url: # my url here
          max-attempts: 10
          retry-delay: 30s

But I get this immediately when the step runs

Error running action Error: Command failed: curl --fail -sv  [my-url] --retry 10 --retry-delay 30 --retry-connrefused
    at checkExecSyncError (child_process.js:621:11)
    at Object.execSync (child_process.js:657:15)
    at curl (/home/runner/work/_actions/jtalk/url-health-check-action/v1.4/dist/index.js:73:20)
    at /home/runner/work/_actions/jtalk/url-health-check-action/v1.4/dist/index.js:90:9
    at Array.forEach (<anonymous>)
Error: Command failed: curl --fail -sv  [my-url] --retry 10 --retry-delay 30 --retry-connrefused
    at Object.34 (/home/runner/work/_actions/jtalk/url-health-check-action/v1.4/dist/index.js:89:10)
    at __webpack_require__ (/home/runner/work/_actions/jtalk/url-health-check-action/v1.4/dist/index.js:22:30)
    at startup (/home/runner/work/_actions/jtalk/url-health-check-action/v1.4/dist/index.js:37:19)
    at /home/runner/work/_actions/jtalk/url-health-check-action/v1.4/dist/index.js:41:18
    at Object.<anonymous> (/home/runner/work/_actions/jtalk/url-health-check-action/v1.4/dist/index.js:44:10) {
  status: 22,
  signal: null,
  output: [ null, null, null ],
  pid: 3005,
  stdout: null,
  stderr: null
}

I expected retry to work even on 4XX and 5XX, not just connection refused. Was this an incorrect assumption?

@Jtalk
Copy link
Owner

Jtalk commented Mar 6, 2021

Hey @wbobeirne, thanks for your report.

Curl's --retry was designed to retry transient errors, i.e. ones that can get resolved on their own. You should see 5XX errors being retried as expected, whilst 4XX would fail immediately, skipping the retry. Can you confirm if you're seeing this behaviour on 5XX as well and let me know if so?

Most of the time, transient 4XX errors should be avoided (e.g. one could use 503 instead of 404 etc), but I appreciate your case might be an exception. I've added support for --retry-all-errors in v1.5 in case you still need it, however it will not work with the current ubuntu-latest due to its Curl being a tad out of date.

I'm closing this, but feel free to reopen if you're still facing problems in v1.5.

@Jtalk Jtalk closed this as completed Mar 6, 2021
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