juju client panics during bootstrap on a k8s cloud

Bug #1964533 reported by Adam Dyess
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Critical
Thomas Miller

Bug Description

I have a machine based controller running in vsphere with charmed-kubernetes running.
kubectl functions just fine and nothing seems to be amiss.

So, I added a new cloud to the controller (and client) without storage

❯ juju add-k8s k8s-cloud --controller addyess-controller --client --skip-storage
k8s substrate added as cloud "k8s-cloud" with no configured storage provisioning capability.
You can now bootstrap to this cloud by running 'juju bootstrap k8s-cloud'.

Good, then following the output from the above instructions ---

❯ juju bootstrap k8s-cloud ck8s --debug -vv
16:10:23 INFO juju.cmd supercommand.go:56 running juju [2.9.25 0 695d9bc09df0725a168df52707336bb6a3a92ff7 gc go1.17.6]
16:10:23 DEBUG juju.cmd supercommand.go:57 args: []string{"/snap/juju/18221/bin/juju", "bootstrap", "k8s-cloud", "ck8s", "--debug", "-vv"}
16:10:23 INFO cmd bootstrap.go:595
Now you can run
    juju add-model <model-name>
to create a new model to deploy workloads.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x184ccf3]

goroutine 1 [running]:
github.com/juju/juju/caas/kubernetes/provider.kubernetesEnvironProvider.FinalizeCloud({{{_, _}, _}, {_, _}, _, _}, {_, _}, {{0xc00077e0b6, ...}, ...})
    /build/snapcraft-juju-35d6cf/parts/juju/src/caas/kubernetes/provider/cloud.go:249 +0x213
github.com/juju/juju/cmd/juju/commands.(*bootstrapCommand).cloud(0xc0003a6e00, 0x0)
    /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/commands/bootstrap.go:1137 +0x2e9
github.com/juju/juju/cmd/juju/commands.(*bootstrapCommand).Run(0xc0003a6e00, 0xc0005a89c0)
    /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/commands/bootstrap.go:620 +0x1a5
github.com/juju/juju/cmd/modelcmd.(*modelCommandWrapper).Run(0xc0001d4270, 0xc000b827b0)
    /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/modelcmd/modelcommand.go:651 +0x132
github.com/juju/juju/cmd/modelcmd.(*baseCommandWrapper).Run(0xc000425790, 0x200000006)
    /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/modelcmd/base.go:551 +0xaf
github.com/juju/cmd/v3.(*SuperCommand).Run(0xc0002843c0, 0xc0005a89c0)
    /build/snapcraft-juju-35d6cf/parts/juju/src/vendor/github.com/juju/cmd/v3/supercommand.go:523 +0x377
github.com/juju/cmd/v3.Main({0x4c0bde0, 0xc0002843c0}, 0xc0005a89c0, {0xc0002a1ef0, 0x5, 0x5})
    /build/snapcraft-juju-35d6cf/parts/juju/src/vendor/github.com/juju/cmd/v3/cmd.go:397 +0x24b
github.com/juju/juju/cmd/juju/commands.jujuMain.Run({0xc000086180}, {0xc00006e1e0, 0x6, 0x6})
    /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/commands/main.go:201 +0x62c
github.com/juju/juju/cmd/juju/commands.Main(...)
    /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/commands/main.go:124
main.main()
    /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/main.go:37 +0x72

❯ juju controllers
Use --refresh option with this command to see the latest information.

Controller Model User Access Cloud/Region Models Nodes HA Version
addyess-controller* k8s-core admin superuser k8s-vsphere/Boston 3 4 none 2.9.22

~
❯ juju clouds
Only clouds with registered credentials are shown.
There are more clouds, use --all to see them.

Clouds available on the controller:
Cloud Regions Default Type
k8s-cloud 1 default k8s
k8s-vsphere 1 Boston vsphere

Clouds available on the client:
Cloud Regions Default Type Credentials Source Description
k8s-cloud 0 k8s 1 local A Kubernetes Cluster
k8s-vsphere 1 Boston vsphere 1 local

Revision history for this message
Adam Dyess (addyess) wrote :

in this event, i don't know why but there was no need for me to bootstrap a controller? Right away i was able to add a model on the new cloud:

> juju add-model vsphere-ccm k8s-cloud
Added 'vsphere-ccm' model on k8s-cloud/default with credential 'k8s-cloud' for user 'admin'

Revision history for this message
Ian Booth (wallyworld) wrote :

RE: the controller question, yes, you just need one controller here. The controller used to deploy charmed k8s is fine to use to manage models on that k8s cluster.

The panic is due to an issue setting up the credential for the controller started in the k8s cluster. This will need to be fixed.

Changed in juju:
milestone: none → 2.9.27
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Thomas Miller (tlmiller)
Revision history for this message
Thomas Miller (tlmiller) wrote :
Changed in juju:
status: Triaged → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.