chartmuseum icon indicating copy to clipboard operation
chartmuseum copied to clipboard

Unable to refresh tenant index and get new chart versions

Open titus-chu-kmon opened this issue 1 year ago • 2 comments

Hello, I'm using multitenancy and alibaba OSS bucket as backend. My CM is not able to refresh the index of a tenant if a chart name's prefix at the root level is the same as the name of the tenant.

For example, in the bucket i have

/abc-def-1.1.1.tgz
...
/abc-def-1.1.24.tgz
/abc/xyz-1.1.1.tgz

If I uploaded a new chart

/abc/xyz-1.1.2.tgz

then my helm client can't see this new version because CM keeps failing to refresh abc index.

{"L":"INFO","T":"2024-12-02T07:51:12.661Z","M":"Rebuilding index for tenant","repo":"abc"}
...
{"L":"DEBUG","T":"2024-12-02T07:51:12.661Z","M":"Entry found in cache store","repo":"abc"}
{"L":"DEBUG","T":"2024-12-02T07:51:12.661Z","M":"Fetching chart list from storage","repo":"abc"}
{"L":"DEBUG","T":"2024-12-02T07:51:12.676Z","M":"Change detected between cache and storage","repo":"abc"}
{"L":"DEBUG","T":"2024-12-02T07:51:12.676Z","M":"Regenerating index.yaml","repo":"abc"}
{"L":"DEBUG","T":"2024-12-02T07:51:12.676Z","M":"Loading charts packages from storage (this could take awhile)","repo":"abc","total":24}
{"L":"ERROR","T":"2024-12-02T07:51:12.680Z","M":"oss: service returned error: StatusCode=404, ErrorCode=NoSuchKey, ErrorMessage=\"The specified key does not exist.\", RequestId=674D66F04E22F83137933220","repo":"abc"}

From my istio proxy, I can see it's trying to get charts abc-def inside the abc tenant. And i think it's because of this line https://github.com/helm/chartmuseum/blob/8795e9930ad1f88f8c20426368327b0e500adcda/pkg/chartmuseum/server/multitenant/cache.go#L201

Is there suppose to be a / at the end? Not sure how it would affect the other backend suppliers

Thanks in advance!

titus-chu-kmon avatar Dec 02 '24 08:12 titus-chu-kmon

any updates? I had same issue.

yxxhero avatar Apr 10 '25 07:04 yxxhero

Here is a PR: https://github.com/helm/chartmuseum/pull/1082

I was able to replicate this, and this should be the fix.

nerdeveloper avatar May 18 '25 14:05 nerdeveloper