goss icon indicating copy to clipboard operation
goss copied to clipboard

Goss returns 200 response although reporting failure. Please help

Open fernandino143 opened this issue 5 months ago • 5 comments

Hi there. I've been using goss for several years and it has always served me perfectly. You guys are bona fide heroes! However, this only started happening today (at least o my knowledge). We run a very old version of goss:

goss --version
goss version 0.3.23

And one particular ldap server was presenting an error:

cat /etc/goss/readiness.yaml
gossfile:
  /etc/goss/conf.d/readiness-*.yaml: {}
goss -g /etc/goss/readiness.yaml --vars /etc/goss/vars.yaml v -f tap 
1..4
not ok 1 - Port: tcp:636: listening: doesn't match, expect: [true] found: [false]
ok 2 - # SKIP Port: tcp:636: ip: skipped
ok 3 - Service: slapd: enabled: matches expectation: [true]
not ok 4 - Service: slapd: running: doesn't match, expect: [true] found: [false]

However, when I used curl, it returned 200:

curl -s localhost:8042/healthz -I
HTTP/1.1 200 OK
Content-Type: application/json
Date: Mon, 09 Sep 2024 14:24:42 GMT
Content-Length: 885

The conf is pretty simple:

cat /etc/goss/conf.d/readiness-ldap.yaml  | jq
{
  "port": {
    "tcp:636": {
      "ip": [
        "0.0.0.0"
      ],
      "listening": true,
      "title": "Service is listening on TCP port 636"
    }
  },
  "service": {
    "slapd": {
      "enabled": true,
      "running": true,
      "title": "The slapd service is enabled and running"
    }
  }
}

Any chance this is being cached some how? I noticed the changelog to v4, but I can't find the code to what "Calculated from first test start, this allows accurate reporting when showing a cached result" is talking about.

fernandino143 avatar Sep 09 '24 15:09 fernandino143