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

Problem if appVersion is decimal #705

Closed
markusheiden opened this issue Jul 18, 2023 · 6 comments
Closed

Problem if appVersion is decimal #705

markusheiden opened this issue Jul 18, 2023 · 6 comments

Comments

@markusheiden
Copy link

markusheiden commented Jul 18, 2023

Since 2023-07-15 18:00 (timezone most probably CEST) helm repo add --force-update --username gitlab-ci-token --password ${CI_JOB_TOKEN} ${CI_PROJECT_NAME} ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/stable (according to https://docs.gitlab.com/ee/user/packages/helm_repository/) does no longer work against the GitLab package registry that uses ChartMuseum to my knowledge.

Error: looks like "https://gitlab.com/api/v4/projects/34739132/packages/helm/stable" is not a valid chart repository or cannot be reached: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number into Go struct field ChartVersion.entries.appVersion of type string

To me, this looks like the JSON generated from our Chart.yaml is wrong. Example Chart.yaml from our repo (last successful deployment):

apiVersion: v2
appVersion: "599799e0" <-- Could be decimal e.g. "12345678" 
name: xxx
type: application
version: 1.0.0+599799e0 

Here the appVersion may be a valid decimal number instead (because int representations are a a subset of hex representations). Maybe using that value for generating JSON without escaping in the decimal case causes the problem?

The downloaded index.yaml looks correct. I wonder where JSON comes into play here at all?

@markusheiden markusheiden changed the title appVersion regression Problem if appVersion is decimal Jul 18, 2023
@scbizu
Copy link
Contributor

scbizu commented Jul 24, 2023

What is your helm version and the index.yaml? I think I need some further investigation .

BTW I do not think it is the issue about CM 🤔 .

@markusheiden
Copy link
Author

I tried with Hem 3.12.0 - 3.12.2.

I agree, that this may be a Helm issue. If so, I apologize for creating this issue.
I don't know the "protocol" between Helm and the repo, so I was unsure about that.

@cbuto
Copy link
Contributor

cbuto commented Jul 24, 2023

@markusheiden it would also be good to know what version of ChartMuseum you are seeing this happen with. I did some testing locally and I can't seem to reproduce with the latest ChartMuseum release + Helm 3.12.

#290 also looks related.

@scbizu
Copy link
Contributor

scbizu commented Jul 25, 2023

Per my knowledge , I think the real Chart.yaml.appVersion will be 12345678 rather than "12345678" , the former is the number and the latter is the string , the valid appVersion should be string.

@markusheiden
Copy link
Author

markusheiden commented Jul 27, 2023

@cbuto I experienced the problem with the GitLab chart registry. To my knowledge they use ChartMuseum (at least we use helm cm-push for pushing), but I don't know which version. I asked them, but they didn't answer: https://gitlab.com/gitlab-org/gitlab/-/issues/418899

@markusheiden
Copy link
Author

I tried to reproduce the issue by uploading different styles of appVersions as numbers and as strings. The error did not happen again. So I will close this issue.

Sorry for taking your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants