1.20 client can't destroy a 1.21 or 1.22 environment

Bug #1394450 reported by Menno Finlay-Smits
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Anastasia
1.21
Fix Released
Critical
Anastasia

Bug Description

I stumbled upon this by accident today. To reproduce:

* with 1.22 client: juju bootstrap
* with 1.20 client: juju destroy-environment --force --yes local

The output I see is:

WARNING unknown config field "prefer-ipv6"
WARNING unknown config field "block-destroy-environment"
WARNING unknown config field "agent-metadata-url"
WARNING unknown config field "set-numa-control-policy"
WARNING unknown config field "uuid"
WARNING unknown config field "uuid"
WARNING unknown config field "prefer-ipv6"
WARNING unknown config field "agent-metadata-url"
WARNING unknown config field "set-numa-control-policy"
WARNING unknown config field "block-destroy-environment"
WARNING unknown config field "prefer-ipv6"
WARNING unknown config field "block-destroy-environment"
WARNING unknown config field "uuid"
WARNING unknown config field "agent-metadata-url"
WARNING unknown config field "set-numa-control-policy"
ERROR cannot find network interface "": net: invalid interface name
ERROR failure setting config: cannot find address of network-bridge: "": net: invalid interface name

and the environment is left untouched.

summary: - 1.20 client can't destroy a 1.22 envrionment
+ 1.20 client can't destroy a 1.22 environment
Revision history for this message
Anastasia (anastasia-macmood) wrote : Re: 1.20 client can't destroy a 1.22 environment

Error is related to the translation from localhost loopback proxy urls to bridge ip...

In other words, the call getAddressForInterface(networkBridge) returned empty string

Revision history for this message
Menno Finlay-Smits (menno.smits) wrote :

The same thing happens when attempt to destroy a 1.21 environment with a 1.20 client.

I've updated this ticket to indicate this.

summary: - 1.20 client can't destroy a 1.22 environment
+ 1.20 client can't destroy a 1.21 or 1.22 environment
Ian Booth (wallyworld)
Changed in juju-core:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Anastasia (anastasia-macmood)
tags: added: destroy-environment regression
Revision history for this message
Anastasia (anastasia-macmood) wrote :

the failure happens in cmd client before it goes over the wire. Specifically at

environ, err := environs.NewFromName(c.envName, store)

this will eventuate in the call to env config which will try to substitute network-bridge adresses which in these versions is ""...
Hence, it falls over before reaching server.

This a representative stack trace...

....../src/github.com/juju/juju/provider/local/config.go:74 (0x80965e)
        com/juju/juju/provider/local.(*environConfig).networkBridge: debug.PrintStack()
....../src/github.com/juju/juju/provider/local/environ.go:301 (0x80c87a)
        com/juju/juju/provider/local.(*localEnviron).resolveBridgeAddress: networkBridge := config.networkBridge()
....../src/github.com/juju/juju/provider/local/environ.go:286 (0x80c64a)
        com/juju/juju/provider/local.(*localEnviron).SetConfig: if err := env.resolveBridgeAddress(cfg); err != nil {
....../src/github.com/juju/juju/provider/local/environprovider.go:80 (0x80fa1c)
        com/juju/juju/provider/local.environProvider.Open: if err := environ.SetConfig(cfg); err != nil {
....../src/github.com/juju/juju/provider/local/config.go:1 (0x815da2)
        com/juju/juju/provider/local.(*environProvider).Open: // Copyright 2013 Canonical Ltd.
....../src/github.com/juju/juju/environs/open.go:164 (0x4d0e5e)
        com/juju/juju/environs.New: return p.Open(config)
....../src/github.com/juju/juju/environs/open.go:127 (0x4d0c30)
        com/juju/juju/environs.NewFromName: env, err := New(cfg)
....../src/github.com/juju/juju/cmd/juju/destroyenvironment.go:78 (0x40b585)
        (*DestroyEnvironmentCommand).Run: environ, err := environs.NewFromName(c.envName, store)
....../src/github.com/juju/cmd/supercommand.go:321 (0x46fc9a)
        com/juju/cmd.(*SuperCommand).Run: err := c.subcmd.Run(ctx)
....../src/github.com/juju/cmd/cmd.go:247 (0x46b193)
        com/juju/cmd.Main: if err := c.Run(ctx); err != nil {
....../src/github.com/juju/juju/cmd/juju/main.go:77 (0x4105ea)
        Main: os.Exit(cmd.Main(jcmd, ctx, args[1:]))
....../src/github.com/juju/juju/cmd/juju/main.go:174 (0x412a04)
        main: Main(os.Args)
/usr/lib/go/src/pkg/runtime/proc.c:220 (0x44471f)
        main: main·main();
/usr/lib/go/src/pkg/runtime/proc.c:1394 (0x446c50)
        goexit: runtime·goexit(void)

Revision history for this message
Anastasia (anastasia-macmood) wrote :

Older clients can't destroy newer environments because a) default network bridge name changed to empty string and b) reasonable default for network bridge name was only provided via getter.

This change moves the guess of reasonable default to config creation.

Revision history for this message
Curtis Hovey (sinzui) wrote :

We may not need change 1.21 because the network change is specific to 1.22.

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

Comment #2 says this issue was verified on a 1.21 environment so on that basis 1.21 will need to be fixed.

Changed in juju-core:
status: Triaged → Fix Committed
Revision history for this message
Anastasia (anastasia-macmood) wrote :

In addition to unit tests for envirnonment setup, I have also manually tested - both 1.22 and 1.21 env were successfully destroyed by 1.20 client.

Curtis Hovey (sinzui)
Changed in juju-core:
importance: Critical → High
Curtis Hovey (sinzui)
Changed in juju-core:
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.