VictoriaMetrics
VictoriaMetrics copied to clipboard
vmauth fail to open vmui
Describe the bug
vmauth generate wrong url to single-node VM. vmauth-host:8427/vmui/vmui/ and got 404 page not found
To Reproduce click on vmui url. http code:
See docs at <a href='https://docs.victoriametrics.com/'>https://docs.victoriametrics.com/</a></br>Useful endpoints:</br><a href="/vmui">/vmui</a> - Web UI<br/><a href="/targets">/targets</a> - discovered targets list<br/><a href="/api/v1/targets">/api/v1/targets</a> - advanced information about discovered targets in JSON format<br/><a href="/config">/config</a> - -promscrape.config contents<br/><a href="/metrics">/metrics</a> - available service metrics<br/><a href="/flags">/flags</a> - command-line flags<br/><a href="/api/v1/status/tsdb">/api/v1/status/tsdb</a> - tsdb status page<br/><a href="/api/v1/status/top_queries">/api/v1/status/top_queries</a> - top queries<br/><a href="/api/v1/status/active_queries">/api/v1/status/active_queries</a> - active queries<br/>
Expected behavior vmui works with vmauth
Version
vmauth-20211022-171212-tags-v1.68.0-0-gf64f62692
victoria-metrics-20211022-171155-tags-v1.68.0-0-gf64f62692
@v98765 , could you share the contents of the file pointed by -auth.config
? Substitute sensitive information with star chars before sharing the file.
label id
= username
---
users:
- username: "1some"
password: "demo"
url_prefix: "http://localhost:8428?extra_label=id=1some"
this can help
---
users:
- username: "1some"
password: "demo"
url_map:
- src_paths:
- "/api/v1/query.*"
- "/api/v1/label.+"
url_prefix: "http://localhost:8428?extra_label=id=1some"
http://vmauth-host:8427/vmui/ error
remoteAddr: "**"; requestURI: /vmui/; cannot determine targetURL: missing route for "/vmui"
http://vmauth-host:8427/vmui redirect to http://vmauth-host:8427/vmui/vmui/?extra_label=id%3D1some and error is
remoteAddr: "**"; requestURI: /vmui/vmui/?extra_label=id%3D1some; cannot determine targetURL: missing route for "/vmui/vmui?extra_label=id%3D1some"
The config has no route for /vmui
. Try extending the config to:
users:
- username: "1some"
password: "demo"
url_map:
- src_paths:
- "/api/v1/query.*"
- "/api/v1/label.+"
- "/vmui.*"
url_prefix: "http://localhost:8428?extra_label=id=1some"
redirect to /vmui/vmui/ and error 404 page not found
I'm seeing this with a trivial vmauth config.
users:
- {bearer_token: foobar, url_prefix: 'http://victoriametrics:8428'}
All requests to /vmui/ via vmauth return HTTP 301 with Location: vmui/ .
Sniffing the requests, it looks like vmauth strips the trailing slash from the path unconditionally but vmui insists on seeing it.
I tried backing up to v1.64.0 to see if this broke with 48f33d098b91a65fe406dc74f7b332afdf39a204 but that did not change the situation for me. But I suppose the path.Clean() call earlier (https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/app/vmauth/target_url.go#L41 ) already trims the slash.
Not sure if it's more easily fixed on the vmui side.
I'm seeing this with a trivial vmauth config.
All requests to /vmui/ via vmauth return HTTP 301 with Location: vmui/ .
Sniffing the requests, it looks like vmauth strips the trailing slash from the path unconditionally but vmui insists on seeing it.
Hi, I think at least the 'need more info' tag could be removed from this issue. It should be trivial to reproduce.
Hope somebody finds the time to look at this :)
any workaround ? deployed by operator the generated config like
- url_map:
- url_prefix: http://vmselect-demo.monitoring-system.svc:8481/select/50
src_paths:
- /vmui
- /vmui/vmui
- /graph
- /prometheus/graph
- /prometheus/api/v1/label.*
- /graphite.*
- /prometheus/api/v1/query.*
- /prometheus/api/v1/rules
- /prometheus/api/v1/alerts
- /prometheus/api/v1/metadata
- /prometheus/api/v1/rules
- /prometheus/api/v1/series.*
- /prometheus/api/v1/status.*
- /prometheus/api/v1/export.*
- /prometheus/federate
- /prometheus/api/v1/admin/tsdb/delete_series
but visit /vmui/ will redirect to vmui/ cause the final path is /vmui/vmui/
Excuse me, has this problem been solved?
Hi,
Also affected by this issue: I'm using the VictoriaMetrics Kubernetes Operator and cannot access to the VMUI through VMAuth.
same problem, anyone can help?
Same problem here with v1.72.
Evaluating VictoriaMetrics - and seeing same problem. A bit worrying that this has not been ack'ed...
Hi @f41gh7, could you help advise us on this?
Same problem here with v1.79.0
Same problem with v1.80.0
curl -sLI https://victoriametrics.fqdn:8247/vmui
HTTP/1.1 301 Moved Permanently
Date: Mon, 08 Aug 2022 23:50:01 GMT
Location: vmui/?
HTTP/1.1 301 Moved Permanently
Date: Mon, 08 Aug 2022 23:50:01 GMT
Location: vmui/?
HTTP/1.1 404 Not Found
Content-Length: 19
Content-Type: text/plain; charset=utf-8
Date: Mon, 08 Aug 2022 23:50:01 GMT
Can someone please provide an update on this? This is still an issue in v1.81.2.
@dmitryk-dk , could you look into this issue?
Yes, I will take a look!
vmauth should properly open vmui after the commit a296994fed5f392d178a6a38edc1854041653135 . This commit will be included in the next release. In the mean time the bugfix can be tested by building vmauth
from this commit according to these build instructions.
FYI, the bugfix for this issue has been included in VictoriaMetrics v1.79.4 LTS release.