GithubHelp home page GithubHelp logo

Comments (6)

bdd avatar bdd commented on August 29, 2024

First of all, do you see the stderr and stdout on the terminal when using 0.7.0-beta4?

I tried to reproduce this under Debian Buster but I cannot. Terminal output and what's sent to HC API matches.

% podman run --rm -it -e CHECK_UUID=<uid> docker.io/debian:buster
root@80c5199c710e:/# (apt -qq update && apt install -y curl) >/dev/null 2>&1
root@80c5199c710e:/# curl -sLo /usr/bin/runitor https://github.com/bdd/runitor/releases/download/v0.7.0-beta.4/runitor-v0.7.0-beta.4-linux-amd64 && \
> chmod +x /usr/bin/runitor
root@80c5199c710e:/# cat /etc/debian_version
10.7
root@80c5199c710e:/# runitor -version
runitor v0.7.0-beta.4
root@80c5199c710e:/# runitor -- bash -c "(echo out; echo foo; echo err >&2) | grep -v foo"
err
out

from runitor.

lakemike avatar lakemike commented on August 29, 2024

Console output as per below (it's the same for stable v0.6):

# apiurl="https://serveraddress/ping"; uuid="uuidstring"; /root/bin/runitor-v0.7.0-beta.4-linux-amd64 -api-url=$apiurl -uuid=$uuid -- bash -c "(echo out; echo foo; echo err >&2) | grep -v foo"
err
out
# cat /etc/debian_version
10.7
# runitor -version
runitor v0.7.0-beta.4

from runitor.

lakemike avatar lakemike commented on August 29, 2024

I have tested some further and probably found a helpful clue. Essentially, v0.7.0-beta also works on my system when I use the default instance of healthchecks (leaving api-url away or specifying hc-ping.com):

# uuid="77b3e526-a284-498a-8ef9-014c17d2ddaa"; /root/bin/runitor-v0.7.0-beta.4-linux-amd64 -uuid=$uuid -- bash -c "(echo out; echo foo; echo err >&2) | grep -v foo"
err
out
# uuid="77b3e526-a284-498a-8ef9-014c17d2ddaa"; /root/bin/runitor-v0.6.0-linux-amd64 -uuid=$uuid -- bash -c "(echo out; echo foo; echo err >&2) | grep -v foo"
err
out
# apiurl="https://hc-ping.com"; uuid="77b3e526-a284-498a-8ef9-014c17d2ddaa"; /root/bin/runitor-v0.7.0-beta.4-linux-amd64 -api-url=$apiurl -uuid=$uuid -- bash -c "(echo out; echo foo; echo err >&2) | grep -v foo"
err
out

Screenshot 2021-02-01 at 09 31 39

v0.7.0-beta (any of the 4 beta versions) stops working when I use api-url to refer to my own healthchecks instance (see first post).

from runitor.

bdd avatar bdd commented on August 29, 2024

I'm guessing the screenshot above is from the hc-ping(.)com instance.

I was gonna ask if there was any chance you set PING_BODY_LIMIT environment variable to 0 in your instance, but you say it works fine with 0.6.0, so that's moot. In Runitor's implementation, practically -api-url is always passed. When omitted it just has a default value (https://hc-ping.com). So that single line code path is always exercised. Looking at the diff from v0.6.0 to v.0.7.0-beta.4, I can't see any changes touching that.

If you instance is available for access over HTTP (clear text), you can also run tcpdump on the client to see if the client is actually sending the body.

...or for a more isolated test, I quickly whipped up a web server which returns 200 to every request and dumps the request path and received request body to stdout. Copy paste the code below to a file, say ok.go and run it with go run ok.go. It will spawn an HTTP server listening on TCP/8080.

package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	mux := http.NewServeMux()
	mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(200)
		fmt.Printf("%s %s (ua: %s)\n", r.Method, r.URL.Path, r.Header.Get("user-agent"))
		b, _ := ioutil.ReadAll(r.Body)
		defer r.Body.Close()
		if len(b) > 0 {
			fmt.Printf("Body:\n%s\n", string(b))
		}
	})
	http.ListenAndServe(":8080", mux)
}

Now you can point runitor to this one, with -api-url=http://localhost:8080 parameter when running on the same host and see if it sends the request body at all. I tried, locally, it does.

from runitor.

lakemike avatar lakemike commented on August 29, 2024

Here is the result for the server listening on 8080:

# go run runitor.ok.go 
POST /77b3e526-a284-498a-8ef9-014c17d2ddaa/start (ua: runitor/v0.6.0 (+https://bdd.fi/x/runitor))
POST /77b3e526-a284-498a-8ef9-014c17d2ddaa (ua: runitor/v0.6.0 (+https://bdd.fi/x/runitor))
Body:
err
out

POST /77b3e526-a284-498a-8ef9-014c17d2ddaa/start (ua: runitor/v0.7.0-beta.4 (+https://bdd.fi/x/runitor))
POST /77b3e526-a284-498a-8ef9-014c17d2ddaa (ua: runitor/v0.7.0-beta.4 (+https://bdd.fi/x/runitor))
Body:
err
out

These were the runitor calls:

# apiurl="http://localhost:8080"; uuid="77b3e526-a284-498a-8ef9-014c17d2ddaa"; /root/bin/runitor-v0.6.0-linux-amd64 -api-url=$apiurl -uuid=$uuid -- bash -c "(echo out; echo foo; echo err >&2) | grep -v foo"
# apiurl="http://localhost:8080"; uuid="77b3e526-a284-498a-8ef9-014c17d2ddaa"; /root/bin/runitor-v0.7.0-beta.4-linux-amd64 -api-url=$apiurl -uuid=$uuid -- bash -c "(echo out; echo foo; echo err >&2) | grep -v foo"

from runitor.

bdd avatar bdd commented on August 29, 2024

So runitor is sending the body in the request.

At this point I don't really know what's up with your healthchecks instance, not showing the body.

I'm going to close this issue for now. Feel free to re-open it if you find a case where you can reproducibly alter the runitor's behavior.

from runitor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.