kubevirt / hyperconverged-cluster-operator

Operator pattern for managing multi-operator products
Apache License 2.0
154 stars 152 forks source link

docker build results in "panic: runtime error: invalid memory address or nil pointer dereference" #76

Closed rwsu closed 5 years ago

rwsu commented 5 years ago

I attempted the "Launching the HCO through OLM" flow and hit upon this error at the docker build command:

[rwsu@localhost converged]$ docker build --no-cache -t docker.io/$HCO_DOCKER_ORG/hco-registry:example -f Dockerfile .
Sending build context to Docker daemon 138.2 kB
Step 1/5 : FROM quay.io/openshift/origin-operator-registry
Trying to pull repository quay.io/openshift/origin-operator-registry ... 
sha256:1f04ce4e147c4a25cc9bb8140aaa9fae869a1c5536f16659fb0ba70d2c95809f: Pulling from quay.io/openshift/origin-operator-registry
c2340472a0fa: Pull complete 
6e55351c18ff: Pull complete 
b2d2704dda6c: Pull complete 
a2c10be042b9: Pull complete 
2fb22ae1422d: Pull complete 
Digest: sha256:1f04ce4e147c4a25cc9bb8140aaa9fae869a1c5536f16659fb0ba70d2c95809f
Status: Downloaded newer image for quay.io/openshift/origin-operator-registry:latest
 ---> ef8b579a36cf
Step 2/5 : COPY olm-catalog /registry
 ---> 1bfa961b7e49
Removing intermediate container 084e7d059d2f
Step 3/5 : RUN initializer --manifests /registry --output bundles.db
 ---> Running in bfe375b7a6d5
time="2019-05-06T23:37:34Z" level=info msg="validating manifests" dir=/registry
validate /registry/kubevirt-hyperconverged/0.0.1/cdi-operator.crb.yaml
validate /registry/kubevirt-hyperconverged/0.0.1/cdi.crd.yaml
validate /registry/kubevirt-hyperconverged/0.0.1/cna-operator.crb.yaml
validate /registry/kubevirt-hyperconverged/0.0.1/cna.crd.yaml
validate /registry/kubevirt-hyperconverged/0.0.1/common-template-bundles.crd.yaml
validate /registry/kubevirt-hyperconverged/0.0.1/hco.crd.yaml
validate /registry/kubevirt-hyperconverged/0.0.1/kubevirt-hyperconverged-operator.v0.0.1.clusterserviceversion.yaml
validate /registry/kubevirt-hyperconverged/0.0.1/kubevirt.crd.yaml
validate /registry/kubevirt-hyperconverged/0.0.1/kwebui.crd.yaml
validate /registry/kubevirt-hyperconverged/0.0.1/node-labeller-bundles.crd.yaml
validate /registry/kubevirt-hyperconverged/0.0.1/node-maintenance.crd.yaml
validate /registry/kubevirt-hyperconverged/0.0.1/template-validator.crd.yaml
validate /registry/kubevirt-hyperconverged/kubevirt-hyperconverged.package.yaml
time="2019-05-06T23:37:34Z" level=info msg="loading Bundles" dir=/registry
time="2019-05-06T23:37:34Z" level=info msg=directory dir=/registry file=registry load=bundles
time="2019-05-06T23:37:34Z" level=info msg="found csv, loading bundle" dir=/registry file=bundles.db load=bundles
time="2019-05-06T23:37:34Z" level=info msg="could not decode contents of file /registry/bundles.db into package: error converting YAML to JSON: yaml: control characters are not allowed" dir=/registry file=bundles.db load=bundles
time="2019-05-06T23:37:34Z" level=info msg=directory dir=/registry file=kubevirt-hyperconverged load=bundles
time="2019-05-06T23:37:34Z" level=info msg=directory dir=/registry file=0.0.1 load=bundles
time="2019-05-06T23:37:34Z" level=info msg="found csv, loading bundle" dir=/registry file=cdi-operator.crb.yaml load=bundles
time="2019-05-06T23:37:34Z" level=info msg="found csv, loading bundle" dir=/registry file=cdi.crd.yaml load=bundles
time="2019-05-06T23:37:34Z" level=info msg="could not decode contents of file /registry/kubevirt-hyperconverged/0.0.1/cdi.crd.yaml into package: error unmarshaling JSON: v1alpha1 is not in dotted-tri format" dir=/registry file=cdi.crd.yaml load=bundles
time="2019-05-06T23:37:34Z" level=info msg="found csv, loading bundle" dir=/registry file=cna-operator.crb.yaml load=bundles
time="2019-05-06T23:37:34Z" level=info msg="found csv, loading bundle" dir=/registry file=cna.crd.yaml load=bundles
time="2019-05-06T23:37:34Z" level=info msg="could not decode contents of file /registry/kubevirt-hyperconverged/0.0.1/cna.crd.yaml into package: error unmarshaling JSON: v1alpha1 is not in dotted-tri format" dir=/registry file=cna.crd.yaml load=bundles
time="2019-05-06T23:37:34Z" level=info msg="found csv, loading bundle" dir=/registry file=common-template-bundles.crd.yaml load=bundles
time="2019-05-06T23:37:34Z" level=info msg="could not decode contents of file /registry/kubevirt-hyperconverged/0.0.1/common-template-bundles.crd.yaml into package: error unmarshaling JSON: v1 is not in dotted-tri format" dir=/registry file=common-template-bundles.crd.yaml load=bundles
time="2019-05-06T23:37:34Z" level=info msg="found csv, loading bundle" dir=/registry file=hco.crd.yaml load=bundles
time="2019-05-06T23:37:34Z" level=info msg="could not decode contents of file /registry/kubevirt-hyperconverged/0.0.1/hco.crd.yaml into package: error unmarshaling JSON: v1alpha1 is not in dotted-tri format" dir=/registry file=hco.crd.yaml load=bundles
time="2019-05-06T23:37:34Z" level=info msg="found csv, loading bundle" dir=/registry file=kubevirt-hyperconverged-operator.v0.0.1.clusterserviceversion.yaml load=bundles
time="2019-05-06T23:37:34Z" level=info msg="loading bundle file" dir=/registry file=cdi-operator.crb.yaml load=bundle
time="2019-05-06T23:37:34Z" level=info msg="found csv, loading bundle" dir=/registry file=cdi-operator.crb.yaml load=bundle
time="2019-05-06T23:37:34Z" level=info msg="could not decode contents of file /registry/kubevirt-hyperconverged/0.0.1/cdi-operator.crb.yaml into file: error unmarshaling JSON: Object 'Kind' is missing in 'null'" dir=/registry file=cdi-operator.crb.yaml load=bundle
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xc96165]

goroutine 1 [running]:
github.com/operator-framework/operator-registry/pkg/registry.(*Bundle).Size(...)
    /go/src/github.com/operator-framework/operator-registry/pkg/registry/bundle.go:69
github.com/operator-framework/operator-registry/pkg/sqlite.(*DirectoryLoader).LoadBundleWalkFunc(0xc4204c6160, 0xc42008e070, 0x6a, 0x10abfa0, 0xc420344270, 0x0, 0x0, 0xc42008e0e0, 0xc4203442a8)
    /go/src/github.com/operator-framework/operator-registry/pkg/sqlite/directory.go:113 +0x7d5
github.com/operator-framework/operator-registry/pkg/sqlite.(*DirectoryLoader).LoadBundleWalkFunc-fm(0xc42008e070, 0x6a, 0x10abfa0, 0xc420344270, 0x0, 0x0, 0x42, 0xc4205d1858)
    /go/src/github.com/operator-framework/operator-registry/pkg/sqlite/directory.go:50 +0x69
path/filepath.walk(0xc42008e070, 0x6a, 0x10abfa0, 0xc420344270, 0xc4205d1c00, 0x0, 0x0)
    /usr/local/go/src/path/filepath/path.go:357 +0x402
path/filepath.walk(0xc420037e60, 0x27, 0x10abfa0, 0xc420279450, 0xc4204f1c00, 0x0, 0x0)
    /usr/local/go/src/path/filepath/path.go:381 +0x2c2
path/filepath.walk(0xc420037d40, 0x21, 0x10abfa0, 0xc4202792b0, 0xc4204f1c00, 0x0, 0x0)
    /usr/local/go/src/path/filepath/path.go:381 +0x2c2
path/filepath.walk(0x7ffee6fbdedb, 0x9, 0x10abfa0, 0xc420279040, 0xc4204f1c00, 0x0, 0x0)
    /usr/local/go/src/path/filepath/path.go:381 +0x2c2
path/filepath.Walk(0x7ffee6fbdedb, 0x9, 0xc420541c00, 0x1, 0xc420101800)
    /usr/local/go/src/path/filepath/path.go:403 +0x106
github.com/operator-framework/operator-registry/pkg/sqlite.(*DirectoryLoader).Populate(0xc4204c6160, 0xc4204c6160, 0xc420106238)
    /go/src/github.com/operator-framework/operator-registry/pkg/sqlite/directory.go:50 +0x16e
main.runCmdFunc(0xc4200e1680, 0xc4204f2700, 0x0, 0x4, 0x0, 0x0)
    /go/src/github.com/operator-framework/operator-registry/cmd/initializer/main.go:54 +0x1e6
github.com/operator-framework/operator-registry/vendor/github.com/spf13/cobra.(*Command).execute(0xc4200e1680, 0xc420030150, 0x4, 0x4, 0xc4200e1680, 0xc420030150)
    /go/src/github.com/operator-framework/operator-registry/vendor/github.com/spf13/cobra/command.go:762 +0x468
github.com/operator-framework/operator-registry/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc4200e1680, 0xff988e, 0x35, 0xc4203d9550)
    /go/src/github.com/operator-framework/operator-registry/vendor/github.com/spf13/cobra/command.go:852 +0x30a
github.com/operator-framework/operator-registry/vendor/github.com/spf13/cobra.(*Command).Execute(0xc4200e1680, 0xfca11a, 0x5)
    /go/src/github.com/operator-framework/operator-registry/vendor/github.com/spf13/cobra/command.go:800 +0x2b
main.main()
    /go/src/github.com/operator-framework/operator-registry/cmd/initializer/main.go:32 +0x22b
The command '/bin/sh -c initializer --manifests /registry --output bundles.db' returned a non-zero code: 2
rwsu commented 5 years ago

@djzager mentioned that the cluster-admin cluster role bindings for cdi-operator and cluster-network-addons may be causing this issue.

Temporary workaround is to remove them:

rm deploy/converged/olm-catalog/kubevirt-hyperconverged/0.0.1/*.crb.yaml
kubevirt-bot commented 5 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

kubevirt-bot commented 5 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten