Giter Site home page Giter Site logo

Comments (4)

bdd avatar bdd commented on August 29, 2024 1

Looks like this is similar to #16. Django's development server did not support chunked encoding (header transfer-encoding: chunked and no content-length header). ...But you mention Apache, which should be implementing the standards rather properly. So that's a bit surprising.

When we thought we fixed chunked encoding in #16, we missed the fact that setting content-type: 0 is not necessarily enough for empty request bodies. Turns out since Go 1.8, the ambiguity of default zero value or explicitly set zero of content-length on HTTP request needs to be handled with http.NoBody or nil if the remote does not support chunked encoding.

Luckily this is essentially a single line addition. 047cb5f

I released v0.9.2 after verifying content-length: 0 header for empty bodies in status pings.

Can you try and report back?

from runitor.

lfkdev avatar lfkdev commented on August 29, 2024 1

It works now!

1.2.3.4 - - [21/Nov/2021:12:08:01 +0000] "POST /ping//xxxx-xxx-xxxx-xxxx/start HTTP/1.1" 200 5767 "-" "runitor/v0.9.2 (+https://bdd.fi/x/runitor)"
1.2.3.4 - - [21/Nov/2021:12:08:01 +0000] "POST /ping//xxxx-xxx-xxxx-xxxx/0 HTTP/1.1" 200 1125 "-" "runitor/v0.9.2 (+https://bdd.fi/x/runitor)"

I can see both requests in my hc instance with a script that has no output.
My setup is Apache/2.4.29 + mod_wsgi 4.9

Awesome, thank you!

from runitor.

bdd avatar bdd commented on August 29, 2024

I can't reproduce this with the healthchecks.io instance.

(Although not relevant to this, that PingStatus logging should not be in the output. It's just noise but I clearly made a git add -p mistake 🤦. Will publish 0.9.1 later today Fixed in 0.9.1.)

~% cat noout.sh
#!/usr/bin/env bash
  
foo() {
  bar=$(ls /)
}
foo

~% runitor -- ./noout.sh
2021/11/20 07:45:45 PingStatus(handle=<redacted> exitCode=0, body)

image

Can you verify from the HTTP server logs of your own instance, that in fact runitor does not make an HTTP request?

As explained in the release notes of v0.9.0, exit status is now always delivered. This commit slightly changed the URI paths hit by runitor.

v0.8.0:
start: <instance-url>/<uuid>/start
exit code == 0: <instance url>/<uuid>
exit code != 0: <instance_url>/<uuid>/fail

v0.9.0:
start: <instance-url>/<uuid>/start
exit: <instance_url>/<uuid>/<exit-code>

If the exit code == 0, Healthchecks interprets it as a successful run.

This feature was added to Healthchecks in v.1.18.0 (rel Oct 2020), with this commit.

Is your local instance version older or newer than 1.18.0?

from runitor.

lfkdev avatar lfkdev commented on August 29, 2024

My HC Version: v1.24.1

In both cases I can see requests in my apache log, here is the log entry with a script that has no output:

1.2.3.4 - - [20/Nov/2021:23:00:01 +0000] "POST /ping//xxxx-xxx-xxxx-xxxx/start HTTP/1.1" 200 5767 "-" "runitor/v0.9.0 (+https://bdd.fi/x/runitor)"
1.2.3.4 - - [20/Nov/2021:23:00:01 +0000] "POST /ping//xxxx-xxx-xxxx-xxxx/0 HTTP/1.1" 411 1090 "-" "runitor/v0.9.0 (+https://bdd.fi/x/runitor)"

and when it has output:

1.2.3.4 - - [20/Nov/2021:23:12:01 +0000] "POST /ping//xxxx-xxx-xxxx-xxxx/start HTTP/1.1" 200 5767 "-" "runitor/v0.9.0 (+https://bdd.fi/x/runitor)"
1.2.3.4 - - [20/Nov/2021:23:12:01 +0000] "POST /ping//xxxx-xxx-xxxx-xxxx/0 HTTP/1.1" 200 1125 "-" "runitor/v0.9.0 (+https://bdd.fi/x/runitor)"

The status code differs. 411 means "server refuses to accept the request without a defined Content-Length header", do you have an idea what could cause this?

image

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.