juju deploy panics with invalid --to option

Bug #1935726 reported by Brent Barr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Heather Lanigan

Bug Description

Not a big issue, but maybe worth some input sanitizing:

root@server:~# juju --version
2.9.7-ubuntu-amd64
root@server:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal

Accidentally used "--to 0,1,2," with the trailing comma, which caused a panic.

root@server:~# juju deploy -n 3 --to 0,1,2, --config vip=10.0.0.101 keystone
WARNING 3 unit(s) will be deployed, extra placement directives will be ignored
Located charm "keystone" in charm-hub, revision 533
Deploying "keystone" from charm-hub charm "keystone", revision 533 in channel stable
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1c54ce6]

goroutine 1 [running]:
github.com/juju/juju/cmd/juju/application.(*deployAPIAdapter).Deploy(0xc0003b47e0, 0xc000914840, 0xc00022dff0, 0x9, 0xc00022dff9, 0x5, 0xc0003757a0, 0x20, 0xc000081840, 0x40, ...)
        /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/application/deploy.go:129 +0x66
github.com/juju/juju/cmd/juju/application/deployer.(*deployCharm).deploy(0xc000700380, 0xc00050df90, 0x7efd8aa4f2e0, 0xc0003b47e0, 0x0, 0x0)
        /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/application/deployer/charm.go:255 +0x1086
github.com/juju/juju/cmd/juju/application/deployer.(*repositoryCharm).PrepareAndDeploy(0xc000700380, 0xc00050df90, 0x7efd8aa4f2e0, 0xc0003b47e0, 0x4e25f40, 0xc000295aa0, 0x4d9e000, 0xc000293950, 0x0, 0x0)
        /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/application/deployer/charm.go:536 +0xd9b
github.com/juju/juju/cmd/juju/application.(*DeployCommand).Run(0xc00031f500, 0xc00050df90, 0x0, 0x0)
        /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/application/deploy.go:815 +0x776
github.com/juju/juju/cmd/modelcmd.(*modelCommandWrapper).Run(0xc00028e690, 0xc00050df90, 0x7059020, 0x3bd4d60)
        /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/modelcmd/modelcommand.go:651 +0x10a
github.com/juju/juju/cmd/modelcmd.(*baseCommandWrapper).Run(0xc0002b03e0, 0xc00050df90, 0x0, 0x0)
        /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/modelcmd/base.go:546 +0xa8
github.com/juju/cmd.(*SuperCommand).Run(0xc0004a9900, 0xc00050df90, 0xc00050df90, 0x0)
        /build/snapcraft-juju-35d6cf/parts/juju/src/vendor/github.com/juju/cmd/supercommand.go:523 +0x2ba
github.com/juju/cmd.Main(0x4e720c0, 0xc0004a9900, 0xc00050df90, 0xc000167a00, 0x8, 0x8, 0x0)
        /build/snapcraft-juju-35d6cf/parts/juju/src/vendor/github.com/juju/cmd/cmd.go:387 +0x2bf
github.com/juju/juju/cmd/juju/commands.jujuMain.Run(0x46f7ee0, 0xc000138000, 0x9, 0x9, 0xc00000dda0)
        /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/commands/main.go:200 +0x424
github.com/juju/juju/cmd/juju/commands.Main(...)
        /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/commands/main.go:123
main.main()
        /build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/main.go:37 +0xb9

Command ran fine after fixing the --to option:
root@server:~# juju deploy -n 3 --to 0,1,2 --config vip=10.0.0.101 keystone
Located charm "keystone" in charm-hub, revision 533
Deploying "keystone" from charm-hub charm "keystone", revision 533 in channel stable

Tags: bitesize
Brent Barr (brentbarr)
no longer affects: charm-openstack-dashboard
Revision history for this message
Pen Gale (pengale) wrote :

Triaged as medium, but added "bitesize" tag so that it's easy to find for someone looking for low hanging fruit.

Changed in juju:
status: New → Triaged
importance: Undecided → Medium
description: updated
tags: added: bitesize
Changed in juju:
status: Triaged → In Progress
assignee: nobody → Heather Lanigan (hmlanigan)
milestone: none → 2.9.31
Revision history for this message
Heather Lanigan (hmlanigan) wrote :
Ian Booth (wallyworld)
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
milestone: 2.9.31 → 2.9.30
milestone: 2.9.30 → 2.9.31
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.