Panic if local charms in bundle not found

Bug #1783595 reported by Marc André Audet
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Harry Pidcock

Bug Description

At first I tried to deploy a bundle with an invalid path (had a typo) and got the following error:

charm path in application "my-charm" does not exist: /Users/maaudet/dev/charm/builds/amy-charm

After fixing the path I got the following panic + stack trace:

https://paste.ubuntu.com/p/xV7RXqdc7z/

I feel like this was supposed to work, but that I got an unexpected error.

If I'm wrong, it should output an error rather than panic in my opinion.

Tags: bundles deploy
Revision history for this message
Marc André Audet (maaudet) wrote :

I switched to absolute paths and it worked.

So my guess is that the first check works with relative paths, but not the second.

A solution would be to resolve the relative path.

tags: added: bundles deploy
Revision history for this message
Tim Penhey (thumper) wrote :

I'm fairly sure that relative paths do work but are relative to the bundle, not the current working directory.

In either way, it shouldn't panic.

summary: - Can't deploy local charms from bundle
+ Panic if local charms in bundle not found
Changed in juju:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Stuart Bishop (stub) wrote :
Download full text (3.5 KiB)

$ juju --version
2.6.8-bionic-amd64

$ cat tests/bundles/localha.yaml
series: bionic
applications:
  postgresql:
    charm: .
    num_units: 3

$ juju deploy tests/bundles/localha.yaml
panic: charm or bundle URL has invalid form: "/home/stub/charms/postgresql/tests/bundles"

goroutine 1 [running]:
github.com/juju/juju/vendor/gopkg.in/juju/charm%2ev6.MustParseURL(0xc420c4c9f0, 0x2a, 0xc420b09380)
 /build/juju/parts/juju/go/src/github.com/juju/juju/vendor/gopkg.in/juju/charm.v6/url.go:99 +0x6f
github.com/juju/juju/vendor/github.com/juju/bundlechanges.getSeries(0xc420c340c0, 0xc420b09380, 0x6, 0xa, 0x50b6040)
 /build/juju/parts/juju/go/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/handlers.go:980 +0xb8
github.com/juju/juju/vendor/github.com/juju/bundlechanges.(*resolver).handleApplications(0xc4209b15c0, 0xc420c75fa0)
 /build/juju/parts/juju/go/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/handlers.go:49 +0x981
github.com/juju/juju/vendor/github.com/juju/bundlechanges.FromData(0xc420c3a580, 0xc4203f2b40, 0x361e920, 0xc4207fd8c0, 0x0, 0x0, 0x0, 0x2b80400, 0xc420b053b0, 0xc420b0e4e0, ...)
 /build/juju/parts/juju/go/src/github.com/juju/juju/vendor/github.com/juju/bundlechanges/changes.go:61 +0x130
github.com/juju/juju/cmd/juju/application.(*bundleHandler).getChanges(0xc420b0e680, 0x0, 0x0)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/application/bundle.go:396 +0xb7
github.com/juju/juju/cmd/juju/application.deployBundle(0xc420272640, 0x0, 0xc420c3a580, 0xc420b10900, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/application/bundle.go:149 +0x18a
github.com/juju/juju/cmd/juju/application.(*DeployCommand).deployBundle(0xc420406c80, 0xc420272640, 0x0, 0xc420c3a580, 0xc420b10900, 0x2a, 0x0, 0x0, 0x0, 0x0, ...)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/application/deploy.go:890 +0x6c3
github.com/juju/juju/cmd/juju/application.(*DeployCommand).maybeReadLocalBundle.func1(0xc420272640, 0x36ba360, 0xc42080cc30, 0xc420b05470, 0x0)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/application/deploy.go:1337 +0x1a7
github.com/juju/juju/cmd/juju/application.(*DeployCommand).Run(0xc420406c80, 0xc420272640, 0x0, 0x0)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/juju/application/deploy.go:1154 +0x49a
github.com/juju/juju/cmd/modelcmd.(*modelCommandWrapper).Run(0xc4204d7830, 0xc420272640, 0xc4204d7830, 0xc420ab7f70)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/modelcmd/modelcommand.go:606 +0x11c
github.com/juju/juju/cmd/modelcmd.(*baseCommandWrapper).Run(0xc4202fc0f0, 0xc420272640, 0x0, 0x0)
 /build/juju/parts/juju/go/src/github.com/juju/juju/cmd/modelcmd/base.go:471 +0xab
github.com/juju/juju/vendor/github.com/juju/cmd.(*SuperCommand).Run(0xc4201d6a00, 0xc420272640, 0xc420272640, 0x0)
 /build/juju/parts/juju/go/src/github.com/juju/juju/vendor/github.com/juju/cmd/supercommand.go:493 +0x2c0
github.com/juju/juju/vendor/github.com/juju/cmd.Main(0x365cc20, 0xc4201d6a00, 0xc420272640, 0xc4200de0a0, 0x2, 0x2, 0x2dad120)
 /build/juju/parts/juju/go/src/github.com/juju/juju/vendor/github.com/juju/cmd/cmd.go:379 +0x2d9
github.com/...

Read more...

Revision history for this message
Stuart Bishop (stub) wrote :

Adding the series stops the panic:

$ cat tests/bundles/localha.yaml
series: bionic
applications:
  postgresql:
    charm: .
    num_units: 3
    series: bionic

Changed in juju:
importance: Medium → High
milestone: none → 2.7-beta1
Changed in juju:
milestone: 2.7-beta1 → 2.7-rc1
Changed in juju:
milestone: 2.7-rc1 → 2.7.1
Revision history for this message
Harry Pidcock (hpidcock) wrote :
Changed in juju:
assignee: nobody → Harry Pidcock (hpidcock)
Revision history for this message
Harry Pidcock (hpidcock) wrote :
Changed in juju:
milestone: 2.7.1 → 2.7.2
Ian Booth (wallyworld)
Changed in juju:
status: Triaged → Fix Committed
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.