You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
appVersion unmarshalling error, detected as a floating point #6849
bugCategorizes issue or PR as related to a bug.v2.xIssues and Pull Requests related to the major version v2v3.xIssues and Pull Requests related to the major version v3
If I try to use helm v3 release candidate with existing repositories on our organization, the helm repo add command fails. I was able to replicate it with this simple example:
$ helm3 repo add test-local-repo http://localhost:8000
Error: looks like "http://localhost:8000" 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
It seems that yaml parser detects the appVersion as a floating point. This worked correctly with helm version v3.0.0-beta.5, but fails with v3.0.0-rc.1
Output of helm version:
$ helm3 version
version.BuildInfo{Version:"v3.0.0-rc.1", GitCommit:"ee77ae3d40fd599445ebd99b8fc04e2c86ca366c", GitTreeState:"clean", GoVersion:"go1.13.3"}
I'm thinking anything that creates or serves index.yaml should put double quotes on anything that's a string. That just solves the problem entirely. What do you folks think? I can't think of any other clean way of fixing this
re-labeling as a bug for Helm 2, as this has to do with how helm repo index generates the index fields. The YAML parser in Helm 3 is parsing the string correctly as scientific notation.
re-labeling as a bug for Helm 2, as this has to do with how helm repo index generates the index fields. The YAML parser in Helm 3 is parsing the string correctly as scientific notation.
But for version field, how likely people would put a scientific value there? If it is not considered to be fixed in 3.x, which means all existing index.yaml in chart repo has to be re-generated for helm v3 client binary.
@kopwei I'll check if helm 3 also creates repo index like this. In any case, it's not the client's fault. And however, we can't look at the likeliness/probability of people having scientific like notations. I also had a similar issue in our codebase today, and realized it's the same issue as this. 😅
Also, index has to be recreated anyway when repositories are updated with new versions of charts. So, I wouldn't consider that as a problem. I would just consider it as a small fix for users, if they are facing this issue. Fix would be update helm and recreate index
@karuppiah7890 , normally a helm binary user is not the maintainer of chart repo, which means we need to push the chart repo maintainer to upgrade the helm binary in continuous integration tool to latest v2 in order to re-generate the charts until we can use the helmv3 client binary. Or. the workaround I can think of is to run "helm repo add" command with helm-v3.0.0-beta5 and then switch to helm v3 release to perform the rest installation job.
But for version field, how likely people would put a scientific value there?
It doesn't matter whether or not the use case is valid for the application. The point is that the YAML parser used in Helm fixed a bug to match the YAML specification on scientific notation. A field with a value of 72551e2 is considered a number as per the YAML spec, and the parser is now correctly treating it as such.
The bug is that the code to serialize the index in YAML is not quoting the appversion field to a string type correctly. Had it been handling that correctly before, this would not be an issue.
This can be closed as the latest version of v2 (2.16.1) and v3 (3.0.0) both create repository index with double quotes around appVersion when Chart.yaml has content like this appVersion: 72225e2.
But it gets converted to appVersion: "7.2225e+06" in the packaged chart and the same comes in the repository index. There are different issues for explaining and discussing that #6921 (v3) and #6922 (v2, closed)
bugCategorizes issue or PR as related to a bug.v2.xIssues and Pull Requests related to the major version v2v3.xIssues and Pull Requests related to the major version v3
Activity
bacongobbler commentedon Oct 31, 2019
72551e2is scientific notation. Looks like a freaky edge case. Thanks for identifying the issue!If you wrap the appversion field in double quotes, does the parser work as expected?
kopwei commentedon Nov 4, 2019
Wrapping "72551e2" with quote fix the issue temporarily. It seems it is brought in by #6808 .
kopwei commentedon Nov 4, 2019
Since git hash is widely used in versioning, many existing chart repo will not work after upgrade to helmv3
karuppiah7890 commentedon Nov 4, 2019
I'm thinking anything that creates or serves
index.yamlshould put double quotes on anything that's a string. That just solves the problem entirely. What do you folks think? I can't think of any other clean way of fixing thisThis fix would require
helm repo indexto create yamls with double quotes around strings, and changes in https://github.com/helm/chartmuseum too may be, as people use that toobacongobbler commentedon Nov 4, 2019
re-labeling as a bug for Helm 2, as this has to do with how
helm repo indexgenerates the index fields. The YAML parser in Helm 3 is parsing the string correctly as scientific notation.karuppiah7890 commentedon Nov 4, 2019
I'll see what I can do with regards to this. Will raise a PR once I find out how this can be fixed
kopwei commentedon Nov 4, 2019
But for version field, how likely people would put a scientific value there? If it is not considered to be fixed in 3.x, which means all existing index.yaml in chart repo has to be re-generated for helm v3 client binary.
karuppiah7890 commentedon Nov 4, 2019
@kopwei I'll check if helm 3 also creates repo index like this. In any case, it's not the client's fault. And however, we can't look at the likeliness/probability of people having scientific like notations. I also had a similar issue in our codebase today, and realized it's the same issue as this. 😅
Also, index has to be recreated anyway when repositories are updated with new versions of charts. So, I wouldn't consider that as a problem. I would just consider it as a small fix for users, if they are facing this issue. Fix would be update helm and recreate index
kopwei commentedon Nov 4, 2019
@karuppiah7890 , normally a helm binary user is not the maintainer of chart repo, which means we need to push the chart repo maintainer to upgrade the helm binary in continuous integration tool to latest v2 in order to re-generate the charts until we can use the helmv3 client binary. Or. the workaround I can think of is to run "helm repo add" command with helm-v3.0.0-beta5 and then switch to helm v3 release to perform the rest installation job.
bacongobbler commentedon Nov 4, 2019
It doesn't matter whether or not the use case is valid for the application. The point is that the YAML parser used in Helm fixed a bug to match the YAML specification on scientific notation. A field with a value of
72551e2is considered a number as per the YAML spec, and the parser is now correctly treating it as such.The bug is that the code to serialize the index in YAML is not quoting the
appversionfield to a string type correctly. Had it been handling that correctly before, this would not be an issue.bacongobbler commentedon Nov 4, 2019
Good call about checking
helm repo indexfor Helm 3, @karuppiah7890. I forgot that it still existed.karuppiah7890 commentedon Nov 16, 2019
This can be closed as the latest version of v2 (2.16.1) and v3 (3.0.0) both create repository index with double quotes around
appVersionwhenChart.yamlhas content like thisappVersion: 72225e2.But it gets converted to
appVersion: "7.2225e+06"in the packaged chart and the same comes in the repository index. There are different issues for explaining and discussing that #6921 (v3) and #6922 (v2, closed)karuppiah7890 commentedon Nov 16, 2019
@bacongobbler ^