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

Basic auth: unknown error (status 401) #689

Closed
r0bj opened this issue May 8, 2019 · 6 comments
Closed

Basic auth: unknown error (status 401) #689

r0bj opened this issue May 8, 2019 · 6 comments
Assignees

Comments

@r0bj
Copy link

r0bj commented May 8, 2019

Let's test basic auth credentials:

curl -v -u admin:secretPassword https://alertmanager.example.com
[...]
< HTTP/2 200

Works fine.

karma.yaml:

    alertmanager:
      interval: 1m
      servers:
      - name: example
        uri: https://admin:secretPassword@alertmanager.example.com

karma generates error message:

time="2019-05-08T15:01:23Z" level=info msg="GET https://admin:xxx@alertmanager.example.com/api/v1/status timeout=10s"
time="2019-05-08T15:01:23Z" level=info msg="[example] Remote Alertmanager version: 0.17.0"
time="2019-05-08T15:01:23Z" level=error msg="[example] unknown error (status 401): {resp:0xc0006c4750} "

karma:v0.35

@prymitive prymitive self-assigned this May 8, 2019
@dopafon
Copy link

dopafon commented May 9, 2019

We are having the same issue (karma:v0.35, alertmanager v0.17.0). I'd like to share some additional information that may help to debug.
We have an Apache in front of alertmanager. Apache access log:

10.0.0.2 - prometheus-serviceuser [09/May/2019:11:37:11 +0200] "GET /metrics HTTP/1.1" 200 5744 "-" "Go-http-client/1.1"
10.0.0.2 - prometheus-serviceuser [09/May/2019:11:37:11 +0200] "GET /api/v1/status HTTP/1.1" 200 1681 "-" "Go-http-client/1.1"
10.0.0.2 - - [09/May/2019:11:37:11 +0200] "GET /api/v2/silences HTTP/1.1" 401 381 "-" "Go-http-client/1.1"

You see that the first two requests are authenticated with user "prometheus-serviceuser", the third request seems to have no credentials and therefore generates a 401

@prymitive
Copy link
Owner

I'll look into it today, looks like auth headers are not passed correctly to v2 api

@prymitive
Copy link
Owner

#699 should fix it

@prymitive
Copy link
Owner

@r0bj can you verify that it works with the latest docker image (lmierzwa/karma:latest)?

@r0bj
Copy link
Author

r0bj commented May 9, 2019

@prymitive works fine, thanks!

@prymitive
Copy link
Owner

Created v0.36 with that fix, binaries and docker image should get pushed in an hour or so. Thanks
https://github.com/prymitive/karma/releases/tag/v0.36

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants