8000 panic: runtime error: invalid memory address or nil pointer dereference · Issue #2039 · roboll/helmfile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
panic: runtime error: invalid memory address or nil pointer dereference #2039
Closed
@notjames

Description

@notjames

Linking from #2036 (you can see directory structure and project details there), I attempted passing .Values up the helmfile "chain" for this project in an attempt to propagate up said chain. The following panic occurred during build:

processing file "helmfile.yaml" in directory "."
first-pass rendering starting for "helmfile.yaml.part.0": inherited=&{default map[] map[]}, overrode=<nil>
first-pass uses: &{default map[] map[]}
first-pass rendering output of "helmfile.yaml.part.0":
 0: ---
 1: environments:
 2:   default:
 3:     values:
 4:     - "env-toggles.yaml"
 5: 

envvals_loader: loaded env-toggles.yaml:map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]]
first-pass produced: &{default map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]] map[]}
first-pass rendering result of "helmfile.yaml.part.0": {default map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]] map[]}
vals:
map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]]
defaultVals:[]
second-pass rendering result of "helmfile.yaml.part.0":
 0: ---
 1: environments:
 2:   default:
 3:     values:
 4:     - "env-toggles.yaml"
 5: 

envvals_loader: loaded env-toggles.yaml:map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]]
merged environment: &{default map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]] map[]}
first-pass rendering starting for "helmfile.yaml.part.1": inherited=&{default map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]] map[]}, overrode=<nil>
first-pass uses: &{default map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]] map[]}
first-pass rendering output of "helmfile.yaml.part.1":
 0: helmfiles:
 1: - path: "../helmfile.yaml"
 2:   values:
 3:   - map[]
 4: 

first-pass produced: &{default map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]] map[]}
first-pass rendering result of "helmfile.yaml.part.1": {default map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]] map[]}
vals:
map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]]
defaultVals:[]
second-pass rendering result of "helmfile.yaml.part.1":
 0: helmfiles:
 1: - path: "../helmfile.yaml"
 2:   values:
 3:   - map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]]
 4: 

merged environment: &{default map[cluster:map[domain_name:jimtest.dev.company id:jimconn] enable:map[ambassador:true argocd:true arm64_support:foobar aws_nlb_with_tls_termination_at_lb:false dex:true ingress_nginx:true opa_policy_manager:false]] map[]}
processing file "helmfile.yaml" in directory ".."
changing working directory to "/repo/environments/devel"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x12e7afe]

goroutine 1 [running]:
github.com/roboll/helmfile/pkg/state.(*Storage).normalizePath(0xc000588360, 0xc0003ca0e0, 0xdc, 0x4f86d1, 0x242d800)
        /home/circleci/workspace/helmfile/pkg/state/storage.go:89 +0x3e
github.com/roboll/helmfile/pkg/state.(*Storage).ExpandPaths(0xc000588360, 0xc0003ca0e0, 0xdc, 0x1, 0x1, 0xc000662108, 0x17, 0xc000588930)
        /home/circleci/workspace/helmfile/pkg/state/storage.go:74 +0x5a
github.com/roboll/helmfile/pkg/state.(*Storage).resolveFile(0xc000588360, 0xc00081c170, 0x16f354a, 0x12, 0xc0003ca0e0, 0xdc, 0x0, 0x0, 0x0, 0xc00081bee0, ...)
        /home/circleci/workspace/helmfile/pkg/state/storage.go:32 +0xee
github.com/roboll/helmfile/pkg/state.(*EnvironmentValuesLoader).LoadEnvironmentValues(0xc00081c180, 0xc00081c170, 0xc0003bc1b0, 0x1, 0x1, 0x2447640, 0x8, 0x247bc88, 0xc00012e0a0)
        /home/circleci/workspace/helmfile/pkg/state/envvals_loader.go:49 +0x585
github.com/roboll/helmfile/pkg/app.(*desiredStateLoader).Load(0xc0005422c0, 0xc00003fec3, 0xd, 0x2477518, 0x0, 0x0, 0xc0003bc1b0, 0x1, 0x1, 0x0, ...)
        /home/circleci/workspace/helmfile/pkg/app/desired_state_file_loader.go:55 +0x1fe
github.com/roboll/helmfile/pkg/app.(*App).loadDesiredStateFromYaml(0xc0004b78c0, 0xc00003fec3, 0xd, 0xc00081c568, 0x1, 0x1, 0x0, 0xc00062a070, 0x70)
        /home/circleci/workspace/helmfile/pkg/app/app.go:705 +0x2c5
github.com/roboll/helmfile/pkg/app.(*App).visitStates.func1(0xc00003fec3, 0xd, 0xc00064e1e0, 0x4f, 0x0, 0x0)
        /home/circleci/workspace/helmfile/pkg/app/app.go:757 +0x190
github.com/roboll/helmfile/pkg/app.(*App).visitStateFiles.func1(0xc00062a1c0, 0x55)
        /home/circleci/workspace/helmfile/pkg/app/app.go:670 +0xa2
github.com/roboll/helmfile/pkg/app.(*App).within(0xc0004b78c0, 0xc00003fec0, 0x2, 0xc00081c960, 0xc00081c920, 0x2)
        /home/circleci/workspace/helmfile/pkg/app/app.go:631 +0x33c
github.com/roboll/helmfile/pkg/app.(*App).visitStateFiles(0xc0004b78c0, 0xc00003fec0, 0x10, 0x2477518, 0x0, 0x0, 0xc00010a750, 0x1, 0x1, 0x0, ...)
        /home/circleci/workspace/helmfile/pkg/app/app.go:664 +0x2ee
github.com/roboll/helmfile/pkg/app.(*App).visitStates(0xc0004b78c0, 0xc00003fec0, 0x10, 0x2477518, 0x0, 0x0, 0xc00010a750, 0x1, 0x1, 0x0, ...)
        /home/circleci/workspace/helmfile/pkg/app/app.go:750 +0x125
github.com/roboll/helmfile/pkg/app.(*App).visitStates.func1.2(0xc000000068, 0x1743b78)
        /home/circleci/workspace/helmfile/pkg/app/app.go:810 +0x2e5
github.com/roboll/helmfile/pkg/app.(*App).visitStates.func1(0x16ecb15, 0xd, 0xc000046380, 0x62, 0x0, 0x0)
        /home/circleci/workspace/helmfile/pkg/app/app.go:827 +0x95e
github.com/roboll/helmfile/pkg/app.(*App).visitStateFiles.func1(0x0, 0x0)
        /home/circleci/workspace/helmfile/pkg/app/app.go:670 +0xa2
github.com/roboll/helmfile/pkg/app.(*App).within(0xc0004b78c0, 0x16e044f, 0x1, 0xc00081d2e8, 0xc00081d2a8, 0x2)
        /home/circleci/workspace/helmfile/pkg/app/app.go:612 +0x629
github.com/roboll/helmfile/pkg/app.(*App).visitStateFiles(0xc0004b78c0, 0x0, 0x0, 0x2477518, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/circleci/workspace/helmfile/pkg/app/app.go:664 +0x2ee
github.com/roboll/helmfile/pkg/app.(*App).visitStates(0xc0004b78c0, 0x0, 0x0, 0x2477518, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/circleci/workspace/helmfile/pkg/app/app.go:750 +0x125
github.com/roboll/helmfile/pkg/app.(*App).visitStatesWithSelectorsAndRemoteSupport(0xc0004b78c0, 0x0, 0x0, 0xc00081d618, 0x2449200, 0xc00081d690, 0x1, 0x1, 0x10, 0x15447c0)
        /home/circleci/workspace/helmfile/pkg/app/app.go:1010 +0x4ff
github.com/roboll/helmfile/pkg/app.(*App).ForEachState(0xc0004b78c0, 0xc00081d698, 0x2449200, 0xc00081d690, 0x1, 0x1, 0x16cc080, 0xc0006306a0)
        /home/circleci/workspace/helmfile/pkg/app/app.go:886 +0xf2
github.com/roboll/helmfile/pkg/app.(*App).PrintState(0xc0004b78c0, 0x1b8d2a0, 0xc0006306a0, 0xc0006306a0, 0xc0001272c0)
        /home/circleci/workspace/helmfile/pkg/app/app.go:501 +0xb1
main.main.func15(0xc0004b78c0, 0xc00067c420, 0x0, 0xc000630650, 0x0)
        /home/circleci/workspace/helmfile/main.go:660 +0x6d
main.action.func1(0xc00067c420, 0xc00063c900, 0xc00063c910)
        /home/circleci/workspace/helmfile/main.go:961 +0xdc
github.com/urfave/cli.HandleAction(0x145b0a0, 0xc000493670, 0xc00067c420, 0xc00067c420, 0x0)
        /home/circleci/workspace/helmfile/vendor/github.com/urfave/cli/app.go:524 +0x105
github.com/urfave/cli.Command.Run(0x16e2705, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1718f66, 0x29, 0x0, ...)
        /home/circleci/workspace/helmfile/vendor/github.com/urfave/cli/command.go:173 +0x579
github.com/urfave/cli.(*App).Run(0xc00061a380, 0xc00010c150, 0x3, 0x3, 0x0, 0x0)
        /home/circleci/workspace/helmfile/vendor/github.com/urfave/cli/app.go:277 +0x808
main.main()
        /home/circleci/workspace/helmfile/main.go:692 +0x54d7

The change I made which caused this was such:

in environments/devel/test-cluster/env-toggles.yaml:

---
cluster:
  domain_name: jimtest.dev.company
  id: jimconn
enable:
  arm64_support: foobar
  aws_nlb_with_tls_termination_at_lb: false
  argocd: true
  dex: true
  ambassador: true
  ingress_nginx: true
  opa_policy_manager: false

in environments/devel/test-cluster/helmfile.yaml:

---
environments:
  default:
    values:
    - "env-toggles.yaml"

---
helmfiles:
- path: "../helmfile.yaml"
  values:
  - {{ .Values }}

in environments/devel/helmfile.yaml:

---
helmfiles:
- path: "../helmfile.yaml"
  values:
  - {{ .Values }}

in environments/helmfile.yaml:

---
bases:
- common/global-default.env.yaml.gotmpl
- common/helm-defaults.yaml
- common/repos.yaml
- common/versions.yaml

---
helmfiles:
- path: "../helmfile.yaml"
  values:
  - {{ .Values }}

and in the parent directory to environments which is the root of the helmfile repo:

---
helmfiles:
- path: "charts/helmfile.yaml"
  values:
  - {{ .Values }}

this one goes on to call the helmfile.yaml within the charts directory, but the panic seems to be happening before it even gets there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0