panic when bootstrapping with openstack provider if endpoint omits api version

Bug #1634770 reported by Andrew McDermott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Anastasia

Bug Description

$ juju version
2.0.0-xenial-amd64

I was bootstrapping using the openstack provider and had the following cloud defined:

  nuc03-openstack:
    type: openstack
    auth-types: [userpass]
    regions:
      RegionOne:
        endpoint: http://192.168.20.218:5000/

If I bootstrap I get the following panic because I omitted '/v2.0' in the endpoint.

$ juju bootstrap nuc03-openstack
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0x21a4a80, 0xc820010160)
 /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
github.com/juju/juju/provider/openstack.identityClientVersion(0xc820227300, 0x1b, 0x0, 0x0, 0x0)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/provider.go:681 +0x265
github.com/juju/juju/provider/openstack.authClient(0xc8201cee00, 0x9, 0x7ffd7a721f5c, 0xf, 0xc8201cfb90, 0x9, 0xc820227300, 0x1b, 0x0, 0x0, ...)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/provider.go:602 +0x6e
github.com/juju/juju/provider/openstack.(*Environ).SetConfig(0xc820170640, 0xc820223bf0, 0x0, 0x0)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/provider.go:662 +0x171
github.com/juju/juju/provider/openstack.EnvironProvider.Open(0x7f65ef7a2ac0, 0x3b0a1b8, 0x7f65ef7a2af8, 0x3b0a1b8, 0x7f65ef7a2b30, 0x3b0a1b8, 0xc8201cee00, 0x9, 0x7ffd7a721f5c, 0xf, ...)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/provider/openstack/provider.go:93 +0x4d3
github.com/juju/juju/provider/openstack.(*EnvironProvider).Open(0x3ae9ac0, 0xc8201cee00, 0x9, 0x7ffd7a721f5c, 0xf, 0xc8201cfb90, 0x9, 0xc820227300, 0x1b, 0x0, ...)
 <autogenerated>:342 +0xdd
github.com/juju/juju/environs/bootstrap.prepare(0x7f65ef7d87e8, 0xc8202d8a30, 0x7f65ef7a2b58, 0x3ae9ac0, 0xc8204335f0, 0xc820299500, 0xc8203f6800, 0x19, 0xc8201cee00, 0x9, ...)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/environs/bootstrap/prepare.go:158 +0x254
github.com/juju/juju/environs/bootstrap.Prepare(0x7f65ef7d87e8, 0xc8202d8a30, 0x7f65ef7d3340, 0xc8201cea20, 0xc8204335f0, 0xc820299500, 0xc8203f6800, 0x19, 0xc8201cee00, 0x9, ...)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/environs/bootstrap/prepare.go:97 +0x5b2
github.com/juju/juju/cmd/juju/commands.(*bootstrapCommand).Run(0xc8203fc280, 0xc82031a820, 0x0, 0x0)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go:666 +0x4845
github.com/juju/juju/cmd/modelcmd.(*modelCommandWrapper).Run(0xc820427f20, 0xc82031a820, 0x0, 0x0)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/cmd/modelcmd/modelcommand.go:282 +0x4f
github.com/juju/juju/cmd/modelcmd.(*baseCommandWrapper).Run(0xc820321670, 0xc82031a820, 0x0, 0x0)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/cmd/modelcmd/base.go:325 +0xd4
github.com/juju/cmd.(*SuperCommand).Run(0xc8203f0a20, 0xc82031a820, 0x0, 0x0)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/cmd/supercommand.go:456 +0x688
github.com/juju/cmd.Main(0x7f65ef7a7920, 0xc8203f0a20, 0xc82031a820, 0xc8200800d0, 0x2, 0x2, 0x2d5cd50)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/cmd/cmd.go:280 +0x2f0
github.com/juju/juju/cmd/juju/commands.main.Run(0x2d5e640, 0xc8200800c0, 0x3, 0x3, 0x269bb60)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/main.go:157 +0x850
github.com/juju/juju/cmd/juju/commands.Main(0xc8200800c0, 0x3, 0x3, 0xc820000180)
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/commands/main.go:114 +0x48
main.main()
 /build/juju-core-6j1yha/juju-core-2.0.0/src/github.com/juju/juju/cmd/juju/main.go:27 +0x3b

Changed in juju:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 2.0.1
Revision history for this message
Anastasia (anastasia-macmood) wrote :
Changed in juju:
status: Triaged → In Progress
assignee: nobody → Anastasia (anastasia-macmood)
Changed in juju:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
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.