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

Error when using files key #145

Closed
ckt114 opened this issue Oct 14, 2019 · 16 comments
Closed

Error when using files key #145

ckt114 opened this issue Oct 14, 2019 · 16 comments

Comments

@ckt114
Copy link

ckt114 commented Oct 14, 2019

I'm trying to deploy a simple chart using the files key under a chart and it's throwing error. If i removed the files key it deployed fine.

course.yaml

---
namespace: kube-system

repositories:
  stable:
    url: https://kubernetes-charts.storage.googleapis.com

repository: stable

charts:
  nfs-client-provisioner:
    namespace: nfs-client-provisioner
    chart: nfs-client-provisioner
    version: 1.2.6
    files:
      - nfs-client-provisioner.yaml

error

$ ./reckoner plot sources.yaml
2019-10-14 15:29:01 my-desktop root[23061] INFO Installing nfs-client-provisioner
2019-10-14 15:29:01 my-desktop root[23061] ERROR Helm upgrade failed on nfs-client-provisioner
2019-10-14 15:29:01 my-desktop root[23061] ERROR ERROR: Chart failed to install.
2019-10-14 15:29:01 my-desktop root[23061] ERROR  - nfs-client-provisioner
2019-10-14 15:29:01 my-desktop root[23061] ERROR Stopping chart installations due to an error! Some of your charts may not have been installed!
⛵🔥 Encountered errors while running the course ⛵🔥

* * * * *

Chart Name: nfs-client-provisioner
Status: Failed
Error Reason: unsupported operand type(s) for +: 'NoneType' and 'str'
@bambash
Copy link
Contributor

bambash commented Oct 14, 2019

Hi @trankchung, thanks for reporting this. Which version of reckoner are you encountering this on?

@ckt114
Copy link
Author

ckt114 commented Oct 14, 2019

$ ./reckoner version
2.1.0

I tried to convert it into values and I still get an error. FYI this is the first time I'm using Reckoner. The error for when I use values is below. The file /tmp/tmph0gzjpme.yml isn't there.

COMMAND: helm upgrade --install nfs-client-provisioner stable/nfs-client-provisioner --namespace nfs-client-provisioner --kube-context test --dry-run --debug --version 1.2.6 -f /tmp/tmph0gzjpme.yml

@bambash
Copy link
Contributor

bambash commented Oct 14, 2019

I was able to reproduce the files issue, but values is working as expected. Can you share a sample of how you're declaring values:?

We'll take a look at why files would be failing.

@ckt114
Copy link
Author

ckt114 commented Oct 14, 2019

So I did several more tests and it's not values that causing the second error. It seems to be the name of the release is too long I think. When I use this it caused that error.

charts:
  nfs-client-provisioner:
    ...

But if I shorten it like below. It deployed fine.

charts:
  nfs-c-p:
    ...

I put in the dashes just to prove that dashes isn't the cause of the error.

@bambash
Copy link
Contributor

bambash commented Oct 14, 2019

Can you share your full reckoner file? I was able to get the nfs chart to work:

namespace: kube-system

repositories:
  stable:
    url: https://kubernetes-charts.storage.googleapis.com

repository: stable

charts:
  nfs-client-provisioner:
    namespace: nfs-client-provisioner
    chart: nfs-client-provisioner
    version: 1.2.6
    values:
      nfs:
        server: 'x.x.x.x'
        path: '/exported/path'

@ckt114
Copy link
Author

ckt114 commented Oct 14, 2019

It's really weird. When I use the release name nfs-client-provisioner it throws an error but when I just add an extra character it doesn't cause an error. If it change it to nfs-clientprovisioner or nfs-client-provisioners it works. Only when it's nfs-client-provisioner that it breaks. I know I can use a different release name and it wouldn't matter but why this is an issue is interesting.

course.yaml

# Namespace that contains Helm charts definitions. Usually kube-system.
namespace: kube-system

# Kubernetes context to use.
context: test

# List of helm repositories that contain the `charts` used below.
repositories:
  stable:
    url: https://kubernetes-charts.storage.googleapis.com

# Default Helm charts repository if not defined within each chart definition.
repository: stable

charts:
  nfs-client-provisioner:
    namespace: nfs-client-provisioner
    chart: nfs-client-provisioner
    version: 1.2.6
    values:
      nfs:
        server: 10.65.28.179
        path: /nfs
      storageClass:
        defaultClass: true

This is the error when I use the relase name as nfs-client-provisioner.

$ ./reckoner plot releng.yaml --dry-run
2019-10-14 16:22:38 my-desktop root[30522] INFO Installing nfs-client-provisioner
2019-10-14 16:22:40 my-desktop root[30522] ERROR Helm upgrade failed on nfs-client-provisioner
2019-10-14 16:22:40 my-desktop root[30522] ERROR ERROR: Chart failed to install.
2019-10-14 16:22:40 my-desktop root[30522] ERROR  - nfs-client-provisioner
2019-10-14 16:22:40 my-desktop root[30522] ERROR Stopping chart installations due to an error! Some of your charts may not have been installed!
⛵🔥 Encountered errors while running the course ⛵🔥

* * * * *

Chart Name: nfs-client-provisioner
Status: Failed
Error Reason: Command Failed with output below:
STDOUT: [debug] Created tunnel using local port: '49526'

[debug] SERVER: "127.0.0.1:49526"

[debug] Fetched stable/nfs-client-provisioner to /home/ctran/.helm/cache/archive/nfs-client-provisioner-1.2.6.tgz

UPGRADE FAILED
ROLLING BACK
Error: "nfs-client-provisioner" has no deployed releases

STDERR: Error: UPGRADE FAILED: "nfs-client-provisioner" has no deployed releases

COMMAND: helm upgrade --install nfs-client-provisioner stable/nfs-client-provisioner --namespace nfs-client-provisioner --kube-context test --dry-run --debug --version 1.2.6 -f /tmp/tmpnla57y6e.yml

@bambash
Copy link
Contributor

bambash commented Oct 14, 2019

It looks like you're running into a Helm issue. Helm will fail to upgrade a release if the initial install failed. You need to purge the failed installation, and reinstall.

@ckt114
Copy link
Author

ckt114 commented Oct 14, 2019

I suspected you would say that and I made sure that wasn't the case. Please see my commands below

$ helm list
*returns nothing*

$ ./reckoner plot course.yaml
2019-10-14 16:33:14 CLT-CTRAN-L1W root[31967] INFO Installing nfs-client-provisioner
2019-10-14 16:33:16 CLT-CTRAN-L1W root[31967] ERROR Helm upgrade failed on nfs-client-provisioner
2019-10-14 16:33:16 CLT-CTRAN-L1W root[31967] ERROR ERROR: Chart failed to install.
2019-10-14 16:33:16 CLT-CTRAN-L1W root[31967] ERROR  - nfs-client-provisioner
2019-10-14 16:33:16 CLT-CTRAN-L1W root[31967] ERROR Stopping chart installations due to an error! Some of your charts may not have been installed!
⛵🔥 Encountered errors while running the course ⛵🔥

* * * * *

Chart Name: nfs-client-provisioner
Status: Failed
Error Reason: Command Failed with output below:
STDOUT: UPGRADE FAILED
ROLLING BACK
Error: "nfs-client-provisioner" has no deployed releases

STDERR: Error: UPGRADE FAILED: "nfs-client-provisioner" has no deployed releases

COMMAND: helm upgrade --install nfs-client-provisioner stable/nfs-client-provisioner --namespace nfs-client-provisioner --kube-context test --version 1.2.6 -f /tmp/tmpxk9xv_86.yml

@ckt114 ckt114 closed this as completed Oct 14, 2019
@ckt114 ckt114 reopened this Oct 14, 2019
@ckt114
Copy link
Author

ckt114 commented Oct 14, 2019

Okay I figured out the second issue. It's odd that when deleting the chart helm didn't delete the configmap.

Please look into the files issue and let me know.

Thanks,

@sudermanjr
Copy link
Member

It's odd that when deleting the chart helm didn't delete the configmap.

If you don't do a --purge when deleting, then the configmap remains for that release. A helm ls will not show this error, but a helm ls --all will.

@sudermanjr
Copy link
Member

sudermanjr commented Oct 15, 2019

In regards to your original errors, I am unable to reproduce them as well:

Course.yml

---
namespace: kube-system

repositories:
  stable:
    url: https://kubernetes-charts.storage.googleapis.com

repository: stable

charts:
  nfs-client-provisioner:
    chart: nfs-client-provisioner
    namespace: nfs-client-provisioner
    version: 1.2.6
    files:
      - nfs-client-provisioner.yaml

nfs-client-provisioner.yaml

test:
  value:
    file: none

The original error message you posted looks to be something wrong with the actual file you are passing in, which I cannot seem to find in this thread.

Error Reason: unsupported operand type(s) for +: 'NoneType' and 'str'

There should be no issues setting the release name to the chart name (we do it a lot). Can you post a full listing of your course file, values file, and the helm version you are using? Steps to reproduce the error should be sufficient.

@ckt114
Copy link
Author

ckt114 commented Oct 15, 2019

$ cat course.yaml
---
namespace: kube-system

repositories:
  stable:
    url: https://kubernetes-charts.storage.googleapis.com

repository: stable

charts:
  nfs-client-provisioner:
    chart: nfs-client-provisioner
    version: 1.2.6
    files:
    - nfs-client-provisioner.yaml


$ cat nfs-client-provisioner.yaml
---
nfs:
  server: 10.65.28.66
  path: /nfs

storageClass:
  defaultClass: true

$ helm version
Client: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}

$ ./reckoner plot course.yaml
2019-10-14 20:56:08 my-desktop root[5357] INFO Installing nfs-client-provisioner
2019-10-14 20:56:08 my-desktop root[5357] ERROR Helm upgrade failed on nfs-client-provisioner
2019-10-14 20:56:08 my-desktop root[5357] ERROR ERROR: Chart failed to install.
2019-10-14 20:56:08 my-desktop root[5357] ERROR  - nfs-client-provisioner
2019-10-14 20:56:08 my-desktop root[5357] ERROR Stopping chart installations due to an error! Some of your charts may not have been installed!
⛵🔥 Encountered errors while running the course ⛵🔥

* * * * *

Chart Name: nfs-client-provisioner
Status: Failed
Error Reason: unsupported operand type(s) for +: 'NoneType' and 'str'

@bambash
Copy link
Contributor

bambash commented Oct 15, 2019

I was able to reproduce the issue and come up with a workaround. It happens when you run reckoner plot on a course file in the current working directory. Supplying the full path to the course file seems to bypass the issue.

example course file

---
namespace: kube-system

repositories:
  stable:
    url: https://kubernetes-charts.storage.googleapis.com

repository: stable

charts:
  nfs-client-provisioner:
    namespace: nfs-client-provisioner
    chart: nfs-client-provisioner
    version: 1.2.6
    files:
      - values.yml

directory listing

$ ls 
nfs-test.yml  values.yml

breaking

$ reckoner plot nfs-test.yml
2019-10-15 09:50:46 sys76 root[21167] ERROR Helm upgrade failed on nfs-client-provisioner
2019-10-15 09:50:46 sys76 root[21167] ERROR ERROR: Chart failed to install.
2019-10-15 09:50:46 sys76 root[21167] ERROR  - nfs-client-provisioner
2019-10-15 09:50:46 sys76 root[21167] ERROR Stopping chart installations due to an error! Some of your charts may not have been installed!
⛵🔥 Encountered errors while running the course ⛵🔥

* * * * *

Chart Name: nfs-client-provisioner
Status: Failed
Error Reason: unsupported operand type(s) for +: 'NoneType' and 'str'

workaround

$ reckoner plot $PWD/nfs-test.yml 
2019-10-15 10:05:31 sys76 root[15493] INFO Installing nfs-client-provisioner
2019-10-15 10:05:32 sys76 root[15493] INFO Release "nfs-client-provisioner" has been upgraded. Happy Helming!
LAST DEPLOYED: Tue Oct 15 10:05:32 2019
NAMESPACE: nfs-client-provisioner
STATUS: DEPLOYED
.....

@ckt114
Copy link
Author

ckt114 commented Oct 15, 2019

Thanks @bambash. I’ll try this instead.

@bambash
Copy link
Contributor

bambash commented Oct 16, 2019

@trankchung should be fixed in latest release
https://github.com/FairwindsOps/reckoner/releases/tag/v2.1.1

@ckt114
Copy link
Author

ckt114 commented Oct 16, 2019

Thanks @bambash

@ckt114 ckt114 closed this as completed Oct 16, 2019
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