Bootstrap: invalid memory address or nil pointer dereference

Bug #1643591 reported by Aaron Bentley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Expired
Medium
Unassigned

Bug Description

When I bootstrapped canonistack, I got a panic. This was with 2.0.1 on xenial/amd64

$ rm ~/sandbox/logz/* -r; ./assess_cloud.py $JUJU_HOME/example-clouds.yaml canonistack /usr/bin/juju ~/sandbox/logz assess-cloud --region lcy02
rm: cannot remove '/home/abentley/sandbox/logz/*': No such file or directory
Namespace(agent_stream=None, agent_url=None, bootstrap_host=None, cloud='canonistack', deadline=None, debug=False, example_clouds='/home/abentley/canonical/cloud-city/example-clouds.yaml', juju_bin='/usr/bin/juju', keep_env=False, logs='/home/abentley/sandbox/logz', machine=[], region='lcy02', series=None, temp_env_name='assess-cloud', upload_tools=False, verbose=20)
2016-11-21 10:08:54 INFO /usr/bin/python /home/abentley/canonical/juju-ci-tools/timeout.pyc 600.00 -- juju --show-log kill-controller assess-cloud -y
error: controller assess-cloud not found
2016-11-21 10:08:54 INFO juju --show-log bootstrap --constraints mem=2G canonistack/lcy02 assess-cloud --config /tmp/tmpoXZjYU.yaml --default-model assess-cloud --agent-version 2.0.1
10:08:54 INFO juju.cmd supercommand.go:63 running juju [2.0.1 gc go1.6.2]
10:08:54 INFO cmd cmd.go:141 Adding contents of "/home/abentley/canonical/cloud-city/jes-homes/assess-cloud/ssh/juju_id_rsa.pub" to authorized-keys
10:08:54 INFO cmd cmd.go:141 Adding contents of "/home/abentley/.ssh/id_rsa.pub" to authorized-keys
10:08:54 INFO juju.provider.openstack provider.go:76 opening model "controller"
Creating Juju controller "assess-cloud" on canonistack/lcy02
10:08:57 INFO juju.cmd.juju.commands bootstrap.go:507 combined bootstrap constraints: mem=2048M
10:08:57 INFO cmd cmd.go:141 Loading image metadata
Looking for packaged Juju agent version 2.0.1 for amd64
10:09:03 INFO juju.environs.bootstrap tools.go:72 looking for bootstrap agent binaries: version=2.0.1
10:09:03 INFO juju.environs.tools tools.go:101 finding agent binaries in stream "released"
10:09:03 INFO juju.environs.tools tools.go:103 reading agent binaries with major.minor version 2.0
10:09:03 INFO juju.environs.tools tools.go:111 filtering agent binaries by version: 2.0.1
10:09:03 INFO juju.environs.tools tools.go:117 filtering agent binaries by architecture: amd64
10:09:06 INFO juju.environs.bootstrap tools.go:74 found 16 packaged agent binaries
10:09:06 INFO cmd cmd.go:141 Starting new instance for initial controller
Launching controller instance(s) on canonistack/lcy02...
10:09:13 INFO juju.environs.instances image.go:106 find instance - using image with id: 4ed6eab0-c00c-49b8-b2ba-ebdaf644ef81
10:09:20 INFO juju.provider.openstack provider.go:1032 started instance "2c59fd50-cbf9-42c8-abfb-1352ddf50b75"
 - 2c59fd50-cbf9-42c8-abfb-1352ddf50b75 (arch=amd64 mem=2G cores=1)
10:09:20 INFO juju.environs.bootstrap bootstrap.go:587 newest version: 2.0.1
10:09:20 INFO juju.environs.bootstrap bootstrap.go:602 picked bootstrap tools version: 2.0.1
10:09:20 INFO juju.environs.bootstrap bootstrap.go:378 Installing Juju agent on bootstrap instance
Fetching Juju GUI 2.2.3
Waiting for address
Attempting to connect to 10.55.33.27:22
10:10:48 INFO juju.cloudconfig userdatacfg_unix.go:346 Fetching agent: curl -sSfw 'tools from %{url_effective} downloaded: HTTP %{http_code}; time %{time_total}s; size %{size_download} bytes; speed %{speed_download} bytes/s ' --retry 10 -o $bin/tools.tar.gz <[https://swift.canonistack.canonical.com/v1/AUTH_526ad877f3e3464589dc1145dfeaac60/juju-dist/tools/agent/2.0.1/juju-2.0.1-xenial-amd64.tgz]>
Warning: Identity file /home/abentley/canonical/cloud-city/jes-homes/assess-cloud/ssh/juju_id_rsa not accessible: No such file or directory.
Warning: Permanently added '10.55.33.27' (ECDSA) to the list of known hosts.
Logging to /var/log/cloud-init-output.log on the bootstrap machine
Running apt-get update
Running apt-get upgrade
Installing curl, cpu-checker, bridge-utils, cloud-utils, tmux
Fetching Juju agent version 2.0.1 for amd64
Installing Juju machine agent
Starting Juju machine agent (service jujud-machine-0)
Bootstrap agent now started
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x5ba969]

goroutine 1 [running]:
panic(0x2385020, 0xc820014110)
 /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
github.com/juju/juju/environs.Destroy(0x7ffff192f042, 0xc, 0x7fa2de0e66d0, 0xc82008e6e0, 0x7fa2de0f2738, 0xc82044c760, 0x0, 0x0)
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/juju/environs/open.go:35 +0x1f9
github.com/juju/juju/cmd/juju/commands.(*bootstrapCommand).Run.func2.1(0x0, 0x0)
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go:471 +0xd3
github.com/juju/juju/cmd/juju/commands.handleBootstrapError(0xc82030a9b0, 0x7fa2de126868, 0xc8205423c0, 0xc8206b9060)
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go:1020 +0xfa
github.com/juju/juju/cmd/juju/commands.(*bootstrapCommand).Run.func2(0xc8206b9aa8, 0xc82030f900, 0xc82030a9b0, 0x7fa2de0e66d0, 0xc82008e6e0, 0x7fa2de12d4d8, 0xc82044c760)
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go:472 +0x159
github.com/juju/juju/cmd/juju/commands.(*bootstrapCommand).Run(0xc82030f900, 0xc82030a9b0, 0x7fa2de126868, 0xc8205423c0)
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/juju/cmd/juju/commands/bootstrap.go:560 +0x1dfa
github.com/juju/juju/cmd/modelcmd.(*modelCommandWrapper).Run(0xc82041b800, 0xc82030a9b0, 0x0, 0x0)
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/juju/cmd/modelcmd/modelcommand.go:282 +0x4f
github.com/juju/juju/cmd/modelcmd.(*baseCommandWrapper).Run(0xc82033a7d0, 0xc82030a9b0, 0x0, 0x0)
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/juju/cmd/modelcmd/base.go:325 +0xd4
github.com/juju/cmd.(*SuperCommand).Run(0xc8203d8fc0, 0xc82030a9b0, 0x0, 0x0)
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/cmd/supercommand.go:456 +0x688
github.com/juju/cmd.Main(0x7fa2de0af940, 0xc8203d8fc0, 0xc82030a9b0, 0xc82000a280, 0xc, 0xc, 0x2fd3898)
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/cmd/cmd.go:280 +0x2f0
github.com/juju/juju/cmd/juju/commands.main.Run(0x2fd5228, 0xc82000a270, 0xd, 0xd, 0x28b5f90)
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/juju/cmd/juju/commands/main.go:160 +0x850
github.com/juju/juju/cmd/juju/commands.Main(0xc82000a270, 0xd, 0xd, 0xc820000180)
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/juju/cmd/juju/commands/main.go:117 +0x48
main.main()
 /build/juju-core-F4_m6w/juju-core-2.0.1/src/github.com/juju/juju/cmd/juju/main.go:27 +0x3b
2016-11-21 10:13:32 ERROR Command '('juju', '--show-log', 'bootstrap', '--constraints', 'mem=2G', 'canonistack/lcy02', 'assess-cloud', '--config', '/tmp/tmpoXZjYU.yaml', '--default-model', 'assess-cloud', '--agent-version', '2.0.1')' returned non-zero exit status 2
Traceback (most recent call last):
  File "/home/abentley/canonical/juju-ci-tools/utility.py", line 553, in logged_exception
    yield
  File "/home/abentley/canonical/juju-ci-tools/deploy_stack.py", line 847, in handle_bootstrap_exceptions
    yield
  File "/home/abentley/canonical/juju-ci-tools/deploy_stack.py", line 804, in bootstrap_context
    yield
  File "/home/abentley/canonical/juju-ci-tools/deploy_stack.py", line 975, in booted_context
    upload_tools, self.series, kwargs)
  File "/home/abentley/canonical/juju-ci-tools/deploy_stack.py", line 520, in create_initial_model
    **boot_kwargs)
  File "/home/abentley/canonical/juju-ci-tools/jujupy.py", line 1721, in bootstrap
    self.juju('bootstrap', args, include_e=False)
  File "/home/abentley/canonical/juju-ci-tools/jujupy.py", line 1894, in juju
    model, check, timeout, extra_env)
  File "/home/abentley/canonical/juju-ci-tools/jujupy.py", line 1115, in juju
    rval = call_func(args)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '('juju', '--show-log', 'bootstrap', '--constraints', 'mem=2G', 'canonistack/lcy02', 'assess-cloud', '--config', '/tmp/tmpoXZjYU.yaml', '--default-model', 'assess-cloud', '--agent-version', '2.0.1')' returned non-zero exit status 2
2016-11-21 10:13:32 INFO /usr/bin/python /home/abentley/canonical/juju-ci-tools/timeout.pyc 600.00 -- juju --show-log kill-controller assess-cloud -y
error: controller assess-cloud not found
$

Aaron Bentley (abentley)
Changed in juju:
importance: Undecided → High
milestone: none → 2.1.0
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.1.0 → 2.2.0-alpha1
milestone: 2.2.0-alpha1 → none
importance: High → Medium
Revision history for this message
Anastasia (anastasia-macmood) wrote :

My guess is that it is no longer an issue.

Changed in juju:
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for juju because there has been no activity for 60 days.]

Changed in juju:
status: Incomplete → Expired
Revision history for this message
to-hiro (to-hiro) wrote :

Hello,

Just sharing that I had a similar problem with Bionic. It might be because I forgot to add the port number in my yaml file (It should be http://192.168.100.1:5240). It actually worked from CLI.

ubuntu@nuc1:~$ juju add-cloud my-maas ./mymaas.yaml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0x8061a8]

goroutine 1 [running]:
github.com/juju/juju/cloud.cloudFromInternal(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cloud/clouds.go:427 +0x68
github.com/juju/juju/cloud.ParseCloudMetadata(0xc4204502c0, 0xbb, 0x2bb, 0xbb, 0x2bb, 0x0)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cloud/clouds.go:309 +0x155
github.com/juju/juju/cloud.ParseCloudMetadataFile(0x7fffb1af2543, 0xd, 0x20001a0000000000, 0xc42048e030, 0x0)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cloud/personalclouds.go:42 +0x6a
github.com/juju/juju/cmd/juju/commands.cloudToCommandAdapter.ParseCloudMetadataFile(0x7fffb1af2543, 0xd, 0x0, 0x0, 0x1)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/commands/main.go:509 +0x35
github.com/juju/juju/cmd/juju/cloud.(*AddCloudCommand).Run(0xc420481180, 0xc420269450, 0x2bb52c0, 0xc420481180)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/cloud/add.go:135 +0x73
github.com/juju/cmd.(*SuperCommand).Run(0xc420315320, 0xc420269450, 0xc420269450, 0x0)
 /build/juju/parts/juju/go/src/github.com/juju/cmd/supercommand.go:456 +0x2c0
github.com/juju/cmd.Main(0x2bb4e40, 0xc420315320, 0xc420269450, 0xc42003a0d0, 0x3, 0x3, 0x2591f60)
 /build/juju/parts/juju/go/src/github.com/juju/cmd/cmd.go:317 +0x266
github.com/juju/juju/cmd/juju/commands.main.Run(0x29cb4c0, 0xc42003a0c0, 0x4, 0x4, 0x0)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/commands/main.go:173 +0x189
github.com/juju/juju/cmd/juju/commands.Main(0xc42003a0c0, 0x4, 0x4, 0xc42000c140)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/commands/main.go:125 +0x4b
main.main()
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/main.go:32 +0x8c

ubuntu@nuc1:~$ cat mymaas.yaml
clouds:
  my-maas:
type: maas
auth-types: [oauth1]
endpoint: http://192.168.100.1/MAAS/
maas-oauth: LH4FUUZGvJyavWvY99:SqncuCntFJ2dJPsq7V:r3Xb68L9BGsXtD9P3zfXdxDX78cw7MK7

ubuntu@nuc1:~$ juju --version
2.3.8-bionic-amd64

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.