#53819·fleet

GitOps CI job fails when the FLEET_URL secret ends in a slash

Author: cdcmeCreated Sep 23, 2026Updated Sep 23, 2026
Labelsbug~gitops~released bug~assisting g-orchestrationP1#g-auto-patching

Fleet versions

  • Discovered: Unknown
  • Reproduced: 4.92.0, built from the fleet-v4.92.0 tag

Web browser and operating system: N/A


Actual behavior

With a trailing slash on FLEET_URL, the GitOps version probe requests //api/v1/fleet/version. Fleet answers with a redirect whose body is HTML:

HTTP/1.1 307 Temporary Redirect
Location: /api/v1/fleet/version
Content-Type: text/html; charset=utf-8

<a href="/api/v1/fleet/version">Temporary Redirect</a>.

curl --fail does not fail on a 3xx, so that body reaches jq:

jq: parse error: Invalid numeric literal at line 1, column 3

The step exits 5. Nothing in the output names the URL.

GitLab fails on one trailing slash. GitHub survives one and fails on two, because action.yml's ${FLEET_URL%/} removes only one.

️ Expected behavior

A trailing slash in FLEET_URL applies cleanly and the GitOps run succeeds silently.

‍ Steps to reproduce

These steps:

  • Have been confirmed to consistently lead to reproduction in multiple Fleet instances.
  • Describe the workflow that led to the error, but have not yet been reproduced in multiple Fleet instances.
  1. Run Fleet 4.92.0.

  2. Scaffold a GitOps repo with fleetctl new.

  3. Set FLEET_URL to the server URL with one trailing slash, for example http://127.0.0.1:8092/.

  4. Run the version probe from the generated .gitlab-ci.yml:

    bash
    curl "$FLEET_URL/api/v1/fleet/version" --header "Authorization: Bearer $FLEET_API_TOKEN" --fail --silent | jq --raw-output '.version'

    It exits 5 with jq: parse error: Invalid numeric literal at line 1, column 3. Without the trailing slash it returns the version and exits 0.

  5. For .github/fleet-gitops/action.yml, use two trailing slashes to see the same failure.

️ More info (optional)

The error text from the original report was not captured.

#28872 was an earlier request for a clearer FLEET_URL error in GitOps, closed in favour of this issue.

Fleet also stores server_url with whatever trailing slashes it is given. That is a separate concern from this CI failure, which builds its URL from the secret rather than from the stored value, and is tracked separately.

The original report is at https://fleetdm.slack.com/archives/C02MP2CTQUE/p1790138270982699