Skip to content

Authentication Error (10000) in versions 0.0.15 and 0.0.16 #170

Description

@jbtcol

Versions 0.0.15 and 0.0.16 fail with "Authentication error (10000)" when using a valid API token, while version 0.0.14 and earlier work correctly with the same token and configuration.
Environment

Exporter versions tested

  • v0.0.11 :: Works
  • v0.0.12 :: Works (not fully tested)
  • v0.0.14 :: Works
  • v0.0.15 :: FAILS with auth error
  • v0.0.16 :: FAILS with auth error

Deployment: Docker
Cloudflare Plan: Enterprise
API Token Permissions:
All accounts - Account Analytics: Read
All zones - Zone: Read, DNS: Read, Analytics: Read

Steps to Reproduce
Create a Cloudflare API token with the permissions listed above
Verify token works with Cloudflare API:

# REST API - Works
curl -X GET "https://api.cloudflare.com/client/v4/zones" \
  -H "Authorization: Bearer YOUR_TOKEN"

# GraphQL API - Works
curl -X POST https://api.cloudflare.com/client/v4/graphql \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"query":"{ viewer { zones { zoneTag name } } }"}'
  • Run exporter v0.0.14: Works - metrics are exported successfully
docker run --rm -it -p 9199:8080 \
  -e CF_API_TOKEN=YOUR_TOKEN \
  -e CF_ZONES=zone_id_1,zone_id_2 \
  cloudflare-exporter:0.0.14
  • Run exporter v0.0.16: Fails with authentication error
docker run --rm -it -p 9199:8080 \
  -e CF_API_TOKEN=YOUR_TOKEN \
  -e CF_ZONES=zone_id_1,zone_id_2 \
  cloudflare-exporter:0.0.16

Expected Behavior

The exporter should authenticate successfully with a valid API token and export metrics.
Actual Behavior

  • Version 0.0.14 (Working):
INFO[2025-10-28 07:11:18] Beginning to serve on port:8080, metrics path /metrics 
INFO[2025-10-28 07:11:19] Filtering zone: zone_id_1 mydomain1.com 
INFO[2025-10-28 07:11:19] Filtering zone: zone_id_2 mydomain2.com
[continues running normally]
  • Version 0.0.16 (Broken):
INFO[2025-10-24 07:26:20] Beginning to serve metrics on :8080/metrics  
INFO[2025-10-24 07:26:22] Filtering zone: Filtering zone: zone_id_1 mydomain1.com
INFO[2025-10-24 07:26:22] Filtering zone: zone_id_2 mydomain2.com
FATA[2025-10-24 07:26:24] Authentication error (10000)

Additional Context

The API token is confirmed working with both REST and GraphQL Cloudflare APIs
The token verification endpoint returns success:
{"result":{"id":"...","status":"active"},"success":true,"errors":[],"messages":[{"code":10000,"message":"This API Token is valid and active","type":null}]}
The same behavior occurs with or without the CF_ZONES environment variable
Zones are on Enterprise plan

May any fix_cf_zones_filter created/introduced a regression that breaks authentication for certain token configurations?

Could you please investigate further changes in the authentication flow between v0.0.14 and v0.0.15/v0.0.16? The issue appears to be related to how the exporter validates or uses the API token, particularly after the CF_ZONES filter changes.

Many Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions