`juju wait-for` panic: runtime error: invalid memory address or nil pointer dereference
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
Medium
|
Jordan Barrett |
Bug Description
To wait for a quiet environment, I'm calling `juju wait-for` as:
```
juju wait-for model ci-testing '--query=
```
This works most of the time but it caused a panic in this CI run: https:/
```
+ juju remove-application https-client
will remove application https-client
- will remove unit https-client/0
+ juju_wait
+ juju wait-for model ci-testing '--query=
model "ci-testing" found, waiting...
model "ci-testing" found, waiting...
model "ci-testing" found, waiting...
model "ci-testing" found, waiting...
model "ci-testing" found, waiting...
model "ci-testing" found, waiting...
model "ci-testing" found, waiting...
model "ci-testing" found, waiting...
model "ci-testing" found, waiting...
model "ci-testing" found, waiting...
model "ci-testing" found, waiting...
model "ci-testing" found, waiting...
model "ci-testing" is running
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x138 pc=0x494e71e]
goroutine 1 [running]:
github.
/build/
github.
/build/
github.
/build/
github.
/build/
github.
/build/
github.
/build/
github.
/build/
github.
/build/
github.
/build/
github.
/build/
github.
/build/
main.main()
/build/
+ true
+ juju exec --unit lxd/leader -- lxc config trust list --format csv
```
This was with Juju's snap 3.1.6 and the status prior to the panic:
```
+ juju status --relations
Model Controller Cloud/Region Version SLA Timestamp
ci-testing local localhost/localhost 3.1.6 unsupported 13:14:02Z
App Version Status Scale Charm Channel Rev Exposed Message
https-client active 1 https-client 0 no
lxd active 1 lxd 0 no
Unit Workload Agent Machine Public address Ports Message
https-client/0* active idle 1 10.173.35.2
lxd/0* active idle 0 10.173.35.236 8443/tcp
Machine State Address Inst id Base AZ Message
0 started 10.173.35.236 juju-b3f4b1-0 ubuntu@20.04 Running
1 started 10.173.35.2 juju-b3f4b1-1 ubuntu@22.04 Running
```
Changed in juju: | |
milestone: | 3.1.7 → 3.1.8 |
Changed in juju: | |
milestone: | 3.1.8 → 3.3.3 |
Changed in juju: | |
milestone: | 3.3.3 → 3.3.4 |
Changed in juju: | |
milestone: | 3.3.4 → 3.3.5 |
Changed in juju: | |
milestone: | 3.3.5 → 3.3.6 |
Changed in juju: | |
milestone: | 3.3.6 → 3.4.4 |
Changed in juju: | |
assignee: | Jack Shaw (jack-shaw) → Jordan Barrett (barrettj12) |
Changed in juju: | |
status: | Triaged → In Progress |
Changed in juju: | |
milestone: | 3.4.4 → 3.4.5 |
Changed in juju: | |
status: | Fix Committed → Fix Released |
This can happen due to AllWatcher backing state, where the status is not known.
It's the line with: `m.UnitInfo. AgentStatus. Current`
I think we just need to handle a nil value and return "unknown" or some such.