Error in bundle causes juju to panic
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Unassigned | ||
2.8 |
Fix Released
|
High
|
Unassigned | ||
2.9 |
Fix Released
|
High
|
Unassigned |
Bug Description
Upon deployment of a bundle with a syntax error, juju panicked.
The error in the bundle was an empty charm. Look at the coredns line:
```
kubernetes-
bindings:
? ''
: oam-space
certificates: internal-space
kube-
kube-control: internal-space
loadbalancer: internal-space
cni: k8s-pods-space
charm: cs:~containers/
num_units: 3
options:
allow-
authoriza
# dns-provider: node
coredns:
kubernetes-
bindings:
? ''
: oam-space
certificates: internal-space
kube-control: internal-space
cni: k8s-pods-space
charm: cs:~containers/
expose: true
num_units: 3
options:
allow-
```
traceback :
ubuntu@infra-01:~/$ fce build --layer lmacmr [78/78]
2021-03-11-22:32:33 root WARNING ["There must be at least three zones and there must be odd number of zones. Zones found: {'zone1'}"]
2021-03-11-22:32:33 fce.build INFO Started building layer: lmacmr
2021-03-11-22:32:33 fce.juju_workload INFO Starting step: lmacmr:create_model
2021-03-11-22:32:34 fce.juju_workload INFO Finished step: lmacmr:
2021-03-11-22:32:34 fce.juju_workload INFO Starting step: lmacmr:
2021-03-11-22:32:34 fce.juju_workload INFO Finished step: lmacmr:
2021-03-11-22:32:34 fce.juju_workload INFO Starting step: lmacmr:
2021-03-11-22:32:34 fce.juju_workload INFO Finished step: lmacmr:
2021-03-11-22:32:34 fce.juju_workload INFO Starting step: lmacmr:
2021-03-11-22:32:34 fce.juju_workload INFO Finished step: lmacmr:
2021-03-11-22:32:34 fce.juju_workload INFO Starting step: lmacmr:
2021-03-11 22:32:35.077297 22:32:35 INFO juju.cmd supercommand.go:54 running juju [2.8.9 0 a48bedf0ae2096d
2021-03-11 22:32:35.077398 22:32:35 DEBUG juju.cmd supercommand.go:55 args: []string{
dle.yaml", "--overlay", "./config/
erlay_kubernete
2021-03-11 22:32:35.078217 22:32:35 INFO juju.juju api.go:67 connecting to API addresses: [172.24.70.19:17070 172.24.70.20:17070 172.24.70.21:17070]
2021-03-11 22:32:35.100555 22:32:35 DEBUG juju.api apiclient.go:1107 successfully dialed "wss://
2021-03-11 22:32:35.100596 22:32:35 INFO juju.api apiclient.go:639 connection established to "wss://
2021-03-11 22:32:35.142810 22:32:35 INFO juju.juju api.go:67 connecting to API addresses: [172.24.70.19:17070 172.24.70.20:17070 172.24.70.21:17070]
2021-03-11 22:32:35.154207 22:32:35 DEBUG juju.api apiclient.go:1107 successfully dialed "wss://
2021-03-11 22:32:35.154304 22:32:35 INFO juju.api apiclient.go:639 connection established to "wss://
2021-03-11 22:32:35.196554 22:32:35 INFO juju.juju api.go:67 connecting to API addresses: [172.24.70.19:17070 172.24.70.20:17070 172.24.70.21:17070]
2021-03-11 22:32:35.215834 22:32:35 DEBUG juju.api apiclient.go:1107 successfully dialed "wss://
2021-03-11 22:32:35.215906 22:32:35 INFO juju.api apiclient.go:639 connection established to "wss://
2021-03-11 22:32:35.255197 22:32:35 INFO juju.juju api.go:302 API endpoints changed from [172.24.70.21:17070 172.24.70.20:17070 172.24.70.19:17070] to [172.24.70.21:17070 172.24.70.19:17070 172.24.70.20:17070]
2021-03-11 22:32:35.267203 22:32:35 DEBUG juju.api monitor.go:35 RPC connection died
2021-03-11 22:32:35.269840 panic: runtime error: invalid memory address or nil pointer dereference
2021-03-11 22:32:35.269906 [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x9ba3b5]
2021-03-11 22:32:35.269924
2021-03-11 22:32:35.269939 goroutine 1 [running]:
2021-03-11 22:32:35.269960 github.
2021-03-11 22:32:35.269984 /build/
2021-03-11 22:32:35.270002 github.
2021-03-11 22:32:35.270020 /build/
2021-03-11 22:32:35.270037 github.
2021-03-11 22:32:35.270054 /build/
2021-03-11 22:32:35.270070 github.
2021-03-11 22:32:35.270087 /build/
2021-03-11 22:32:35.270107 github.
2021-03-11 22:32:35.270121 /build/
2021-03-11 22:32:35.270134 github.
2021-03-11 22:32:35.270148 /build/
2021-03-11 22:32:35.270162 github.
2021-03-11 22:32:35.270175 /build/
2021-03-11 22:32:35.270188 github.
2021-03-11 22:32:35.270206 /build/
2021-03-11 22:32:35.270230 github.
2021-03-11 22:32:35.270246 /build/
2021-03-11 22:32:35.270262 github.
2021-03-11 22:32:35.270278 /build/
2021-03-11 22:32:35.270294 github.
2021-03-11 22:32:35.270310 /build/
2021-03-11 22:32:35.270325 main.main()
2021-03-11 22:32:35.270341 /build/
2021-03-11-22:32:35 root ERROR [localhost] Command failed: juju deploy -m foundations-
rlay ./config/
2021-03-11-22:32:35 root ERROR [localhost] STDOUT follows:
22:32:35 INFO juju.cmd supercommand.go:54 running juju [2.8.9 0 a48bedf0ae2096d
22:32:35 DEBUG juju.cmd supercommand.go:55 args: []string{
config/
}
22:32:35 INFO juju.juju api.go:67 connecting to API addresses: [172.24.70.19:17070 172.24.70.20:17070 172.24.70.21:17070]
22:32:35 DEBUG juju.api apiclient.go:1107 successfully dialed "wss://
22:32:35 INFO juju.api apiclient.go:639 connection established to "wss://
22:32:35 INFO juju.juju api.go:67 connecting to API addresses: [172.24.70.19:17070 172.24.70.20:17070 172.24.70.21:17070]
22:32:35 DEBUG juju.api apiclient.go:1107 successfully dialed "wss://
22:32:35 INFO juju.api apiclient.go:639 connection established to "wss://
22:32:35 INFO juju.juju api.go:67 connecting to API addresses: [172.24.70.19:17070 172.24.70.20:17070 172.24.70.21:17070]
22:32:35 DEBUG juju.api apiclient.go:1107 successfully dialed "wss://
22:32:35 INFO juju.api apiclient.go:639 connection established to "wss://
22:32:35 INFO juju.juju api.go:302 API endpoints changed from [172.24.70.21:17070 172.24.70.20:17070 172.24.70.19:17070] to [172.24.70.21:17070 172.24.70.19:17070 172.24.70.20:17070]
22:32:35 DEBUG juju.api monitor.go:35 RPC connection died
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x9ba3b5]
goroutine 1 [running]:
github.
github.
github.
github.
github.
github.
github.
github.
github.
github.
github.
main.main()
2021-03-11-22:32:35 root ERROR [localhost] STDERR follows:
None
Traceback (most recent call last):
File "/usr/local/
load_
File "/home/
sys.
File "/home/
opts.func(opts)
File "/home/
build_
File "/home/
layer.
File "/home/
self.
File "/home/
self.
File "/home/
step.build()
File "/home/
deploy(
File "/home/
local(command, stderr=
File "/home/
return run_cmd(cmd, target_machine, **kwargs)
File "/home/
raise subprocess.
subprocess.
'--overlay', './config/
Changed in juju: | |
assignee: | nobody → Simon Richardson (simonrichardson) |
Changed in juju: | |
assignee: | Simon Richardson (simonrichardson) → nobody |
Changed in juju: | |
milestone: | 3.0.0 → 3.0-beta1 |
Changed in juju: | |
status: | Fix Committed → Fix Released |
Changed in juju: | |
status: | Fix Released → Fix Committed |
Changed in juju: | |
status: | Fix Committed → Fix Released |
I think any bundle that has a nil application definition will cause a panic, if you use any overlay when it tries to run ReadAndMergeBun dleOverlay.
applications:
foo:
bar:
charm: bar
The charm code has: Applications {
resolvedChar m, err := resolveRelative CharmPath( basePath, appData.Charm)
for app, appData := range base.Data.
However, if you leave the app as a nil value, then 'appData' is nil, and 'appData.Charm' is a nil pointer dereference.
It should be easy to do:
if appData == nil { Errorf( "application %q has no body", app)
return nil, errors.
}
I'm not super happy with that error message, but something along those lines. It will point the user to what part of the bundle is incorrectly constructed.