Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prometheus endpoint cannot be validated by local json schema #438

Closed
claudio-benfatto opened this issue May 14, 2020 · 0 comments
Closed

Comments

@claudio-benfatto
Copy link
Contributor

Describe the bug

The current v0.38.0-beta.2 release has introduced prometheus metrics and the following configuration stanza:

serve:
  prometheus:
    port: 9000
    host: localhost
    metrics_path: /metrics

however the local config.schema.json does not contain it.
This is also the schema that is loaded on startup root.go which causes the command to fail with a validation error:

INFO[0000] Config file loaded successfully.              path=/etc/auth-oathkeeper/templates/oathkeeper.yaml
FATA[0000] The configuration is invalid and could not be loaded.  [config_key=serve]="additionalProperties \"prometheus\" not allowed" config_file=/etc/auth-oathkeeper/templates/oathkeeper.yaml

Reproducing the bug

Steps to reproduce the behavior:

  1. create a config.yaml file

serve:
  prometheus:
    port: 9090
    host: localhost
    metrics_path: /metrics
  proxy:
    port: 4455
  api:
    port: 4456
log:
  level: debug
access_rules:
  repositories: []
mutators:
  header:
    enabled: true
    config:
      headers:
  noop:
    enabled: true

authorizers:
  allow:
    enabled: true
  deny:
    enabled: true
  keto_engine_acp_ory:
    enabled: true
    config:
      base_url: http://auth-keto:4444/
      required_action: ""
      required_resource: ""

authenticators:
  anonymous:
    enabled: true
    config:
      subject: guest
  jwt:
    enabled: false
  1. Run docker run -v ${PWD}/config.yaml:/etc/config.yaml oryd/oathkeeper:v0.38.1-alpine serve --config /etc/config.yaml

  2. Process start fails with:

time="2020-05-14T09:33:05Z" level=info msg="Config file loaded successfully." path=/etc/oathkeeper.yaml
time="2020-05-14T09:33:05Z" level=fatal msg="The configuration is invalid and could not be loaded." [config_key=#]="validation failed" [config_key=mutators.header]="oneOf failed" [config_key=serve]="additionalProperties \"prometheus\" not allowed" config_file=/etc/config.yaml

Expected behavior
The prometheus server should bind to localhost:9090

INFO[0000] No tracer configured - skipping tracing setup
INFO[0000] TLS has not been configured for proxy, skipping
INFO[0000] Listening on http://:4455
INFO[0000] Listening on http://localhost:9090
INFO[0000] TLS has not been configured for api, skipping
INFO[0000] Listening on http://:4456
^CINFO[0007] HTTP server was shutdown gracefully
INFO[0007] HTTP(s) server was shutdown gracefully
INFO[0007] HTTP server was shutdown gracefully

Environment

Docker, image oryd/oathkeeper:v0.38.1-alpine

Additional context

I opened a PR with a proposed fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant