VictoriaMetrics: 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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 22 (1 by maintainers)

Commits related to this issue

Most upvoted comments

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.

Evaluating VictoriaMetrics - and seeing same problem. A bit worrying that this has not been ack’ed…

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.

vmauth should properly handle urls ending with / such as /vmui/ starting from v1.82.0. Closing the issue as fixed.

FYI, the bugfix for this issue has been included in VictoriaMetrics v1.79.4 LTS release.