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

PingStart: nonretriable error response: 404 Not Found #11

Closed
lakemike opened this issue Jan 31, 2021 · 3 comments
Closed

PingStart: nonretriable error response: 404 Not Found #11

lakemike opened this issue Jan 31, 2021 · 3 comments

Comments

@lakemike
Copy link

lakemike commented Jan 31, 2021

I have tried to use runitor with a self-hosted healthchecks instance, but failed so far.

Curl approach works fine:

m="test"; myserver="serveraddress"; code="apicode"
curl -fsS --retry 3 --data-raw "$m" https://$myserver/ping/$code > /dev/null

runitor command throws an error:

myserver="serveraddress"; code="apicode"
runitor -api-url="https://$myserver" -uuid=$code -- echo "test"
2021/01/31 11:44:11 PingStart: nonretriable error response: 404 Not Found
test
2021/01/31 11:44:11 PingSuccess: nonretriable error response: 404 Not Found

Is this a known issue? Anything I can do?

Thanks!

@bdd
Copy link
Owner

bdd commented Jan 31, 2021

Looks like your instance runs on /ping request path, unlike the service instance on hc-ping.com which is available at the root.

So you should pass -api-url="https://$myserver/ping" as the argument.

@lakemike
Copy link
Author

Excellent! That worked. But now I encountered the next problem: When i try to put a command after "--" I had assumed it would take everything following the "--". But this does not seem to be the case because a pipe "|" character is not taken into the execution by runitor.

@bdd
Copy link
Owner

bdd commented Jan 31, 2021

Short Answer

Piping via | is the feature of shell. Runitor will get executed only with the parameters up to the |.

If you want runitor to execute a shell for you, then you can replace the command with your shell of your choice and pass the shell command to be evaluated:

e.g.:

% runitor -api-url=https://example.com/api -- bash -c "my_cmd --flag=y foo | grep -v error:"

Long Answer

When you invoke runitor -api-url=https://example.com/api -- my_cmd --flag=y foo | grep -v error:, shell will execute runitor with args:

It will first create an anonymous pipe with two ends.

Then execute runitor, and set its argument array to:

  1. runitor
  2. -api-url=https://example.com/api
  3. --
  4. my_cmd
  5. --flag=y
  6. foo

...and then replace the stdout file descriptor of this process with one end of the pipe. Execute grep with arg array ["grep", "-v", "error:"] and connect its stdin descriptor to the other end of the pipe created above, connecting standard output (mind you, not standard error) of the left hand side invocation to the standard input of right hand side invocation.

You can see a nice illustration of how shell parses its command on explainshell.com
https://explainshell.com/explain?cmd=runitor+-api-url%3Dhttps%3A%2F%2Fexample.com%2Fapi+--+my_cmd+--flag%3Dy+foo+%7C+grep+-v+error%3A#

@bdd bdd closed this as completed Jan 31, 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