Closed JonasScharpf closed 1 year ago
Hi, thanks for the bug report.
I think this might actually turn out to be a misconfiguration, but it's not great that bazel-remote doesn't give a good error message.
To help debug this, I added a few changes and uploaded a new docker image: log on startup whether or not endpoint metrics are enabled, and provide a 404 error when clients request /metrics and it is disabled. Could you try this out, and report back the Endpoint metrics:
log line when running your test case?
I've pulled your recently published latest
image, commented the BAZEL_REMOTE_ENABLE_ENDPOINT_METRICS: 1
out, restarted the bazel remote and got Endpoint metrics are not enabled on this server.
as I requested /metrics
, as expected :+1: , the /status
endpoint still worked (as expected). The log reports confirms this with bazel-remote-cache | 2023/08/10 09:34:29 Endpoint metrics: disabled
I've then uncommented the BAZEL_REMOTE_ENABLE_ENDPOINT_METRICS: 1
line again, to have it as mentioned above, restarted bazel remote again, requested the metrics and got bazel-remote-cache | 2023/08/10 09:35:39 Endpoint metrics: enabled
from the log, and the /metrics
endpoint provided the metrics.
I've reverted everything back to have the system as before and saw that we did not use a pinned version of the buchgr/bazel-remote-cache:latest
image, so I've pinned it to v2.4.1
, started everything again and it worked :joy: I believe we used somehow a version that had a glitch or most likely a so old version that /metrics
was just not there.
Sorry for the inconvenience, nevertheless the improved log output and report is really a benefit, thanks for that!
No problem :)
Summary
TLDR; Requesting the enabled
/metrics
endpoint via HTTPs seems not to work as expectedresource name must be a SHA256 hash in hex. got '/metrics'
Details
Local
I've created a very simple local Bazel Remote Cache server with
and can request the data of the
/status
and/metrics
endpoints withnice, as expected :partying_face:
Remote
After that I've used a real server with HTTPs (of course) and a Docker compose file.
With that up an running, I requested the data of the two endpoints again
resource name must be a SHA256 hash in hex. got '/metrics'
This feels like the cache server interpreted this endpoint like a request to it's content
From Bazel point of view everything is working as expected, the remote cache is used, filled with new data and so on.
Expectation
I would expect that either none of the two endpoins
/status
and/metrics
is working or both, but not a mix of it.