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

panic: runtime error: invalid memory address or nil pointer dereference #6910

Open
huhouhua opened this issue Mar 5, 2025 · 1 comment
Open

Comments

@huhouhua
Copy link

huhouhua commented Mar 5, 2025

Bug Report

What did you do?

I tried to execute this generate a project

operator-sdk create api --group app --version v1 --kind Redis --helm-chart-repo https://charts.bitnami.com/bitnami --helm-chart redis

What did you expect to see?

Successfully created

What did you see instead? Under which circumstances?

program pointer error, specific output results

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x2364c2f]

goroutine 1 [running]:
helm.sh/helm/v3/pkg/registry.(*Client).Tags(0x0, {0xc00931bdc6?, 0xc000a0f0c8?})
        /home/runner/go/pkg/mod/helm.sh/helm/[email protected]/pkg/registry/client.go:671 +0x10f
helm.sh/helm/v3/pkg/downloader.(*ChartDownloader).getOciURI(0xc000a0f4f8, {0xc00931bdc0, 0x36}, {0x0, 0x0}, 0xc00310e090)
        /home/runner/go/pkg/mod/helm.sh/helm/[email protected]/pkg/downloader/chart_downloader.go:154 +0x128
helm.sh/helm/v3/pkg/downloader.(*ChartDownloader).ResolveChartVersion(0xc000a0f4f8, {0xc00931bdc0, 0x36}, {0x0, 0x0})
        /home/runner/go/pkg/mod/helm.sh/helm/[email protected]/pkg/downloader/chart_downloader.go:199 +0xfd2
helm.sh/helm/v3/pkg/downloader.(*ChartDownloader).DownloadTo(0xc000a0f4f8, {0xc00931bdc0, 0x36}, {0x0?, 0x0?}, {0xc0001f7300, 0x1e})
        /home/runner/go/pkg/mod/helm.sh/helm/[email protected]/pkg/downloader/chart_downloader.go:90 +0x4f
github.com/operator-framework/operator-sdk/internal/plugins/helm/v1/chartutil.downloadChart({0xc0001f7300, 0x1e}, {{0xc00931bdc0, 0x36}, {0x7ffdc2ec001f, 0x22}, {0x0, 0x0}})
        internal/plugins/helm/v1/chartutil/chart.go:144 +0x35b
github.com/operator-framework/operator-sdk/internal/plugins/helm/v1/chartutil.LoadChart({{0x7ffdc2ec004f, 0x5}, {0x7ffdc2ec001f, 0x22}, {0x0, 0x0}})
        internal/plugins/helm/v1/chartutil/chart.go:117 +0x13c
github.com/operator-framework/operator-sdk/internal/plugins/helm/v1.(*createAPISubcommand).InjectResource(0xc000943970, 0x28b1660?)
        internal/plugins/helm/v1/api.go:169 +0x276
sigs.k8s.io/kubebuilder/v4/pkg/cli.(*CLI).applySubcommandHooks.(*executionHooksFactory).preRunEFunc.func1.2({0x7efdf4df6810?, 0xc000943970?})
        /home/runner/go/pkg/mod/sigs.k8s.io/kubebuilder/[email protected]/pkg/cli/cmd_helpers.go:275 +0x4a
sigs.k8s.io/kubebuilder/v4/pkg/cli.(*executionHooksFactory).forEach(0xc0000fc9a0, 0xc000a0fb50, {0x2c11479, 0x20})
        /home/runner/go/pkg/mod/sigs.k8s.io/kubebuilder/[email protected]/pkg/cli/cmd_helpers.go:198 +0x9e
sigs.k8s.io/kubebuilder/v4/pkg/cli.(*CLI).applySubcommandHooks.(*executionHooksFactory).preRunEFunc.func1(0xc00072e608?, {0xc0007eb0e0?, 0x0?, 0xa?})
        /home/runner/go/pkg/mod/sigs.k8s.io/kubebuilder/[email protected]/pkg/cli/cmd_helpers.go:273 +0x505
github.com/spf13/cobra.(*Command).execute(0xc00072e608, {0xc0007eafa0, 0xa, 0xa})
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:970 +0xa24
github.com/spf13/cobra.(*Command).ExecuteC(0xc00096b508)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
sigs.k8s.io/kubebuilder/v4/pkg/cli.CLI.Run(...)
        /home/runner/go/pkg/mod/sigs.k8s.io/kubebuilder/[email protected]/pkg/cli/cli.go:463
github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/cli.Run()
        internal/cmd/operator-sdk/cli/cli.go:66 +0x45
main.main()
        cmd/operator-sdk/main.go:28 +0x13

Environment

Operator type:

helm

Kubernetes cluster type:

$ operator-sdk version

operator-sdk version: "v1.39.1", commit: "b8a728e15447465a431343a664e9a27ff9db655e", kubernetes version: "1.31.0", go version: "go1.23.4", GOOS: "linux", GOARCH: "amd64"

$ go version (if language is Go)

go version go1.22.4 linux/amd64

$ kubectl version

Possible Solution

Additional context

Copy link

openshift-ci bot commented Mar 5, 2025

@huhouhua: The label(s) /label bug, /label helm cannot be applied. These labels are supported: acknowledge-critical-fixes-only, platform/aws, platform/azure, platform/baremetal, platform/google, platform/libvirt, platform/openstack, ga, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, px-approved, docs-approved, qe-approved, ux-approved, no-qe, downstream-change-needed, rebase/manual, cluster-config-api-changed, approved, backport-risk-assessed, bugzilla/valid-bug, cherry-pick-approved, jira/valid-bug, staff-eng-approved. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

In response to this:

/label bug
/label helm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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

1 participant