juju2 beta11 unable to parse PORT during a maas bootstrap

Bug #1599972 reported by Adam Stokes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Critical
Michael Foord

Bug Description

When attempting to bootstrap via MAAS we hit this error:

(conjure-dev) 1 ubuntu@brucewillis:~⟫ JUJU_LOGGING_CONFIG="<root>=TRACE" juju --debug bootstrap sparkle maas/battlemidget.lol:5240 --upload-tools --config image-stream=daily --config enable-os-upgrade=false --bootstrap-series=xenial --credential sparkle
2016-07-07 18:57:10 INFO juju.cmd supercommand.go:63 running juju [2.0-beta11.4111 gc go1.6.2]
2016-07-07 18:57:10 INFO cmd cmd.go:141 cloud "maas" not found, trying as a provider name
2016-07-07 18:57:10 INFO cmd cmd.go:141 interpreting %q as the cloud endpoint
2016-07-07 18:57:10 DEBUG juju.cmd.juju.commands bootstrap.go:445 preparing controller with config: map[type:maas name:controller uuid:b03a5ab1-66c8-4955-8882-120f7d3dc099 image-stream:daily enable-os-upgrade:false]
2016-07-07 18:57:10 DEBUG juju.provider.maas environprovider.go:32 opening model "controller".
2016-07-07 18:57:10 ERROR cmd supercommand.go:458 malformed maas-server URL 'battlemidget.lol:5240': %!s(<nil>)
2016-07-07 18:57:10 DEBUG cmd supercommand.go:459 (error details: [{github.com/juju/juju/cmd/juju/commands/bootstrap.go:504: } {github.com/juju/juju/environs/open.go:108: } {github.com/juju/juju/environs/open.go:194: } {github.com/juju/juju/provider/maas/environ.go:189:
 } {malformed maas-server URL 'battlemidget.lol:5240': %!s(<nil>)}])

MAAS doesn't assume port 80 is always available so having access to set the port of the actual MAAS web application is usually beneficial.

tags: added: conjure
Changed in juju-core:
status: New → Triaged
importance: Undecided → Medium
Changed in juju-core:
milestone: none → 2.0.1
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi Cheryl,

This needs to be critical because MAAS no longer offers port 80 (we only do for backwards compatibility), but MAAS binds to port 5240.

Changed in juju-core:
importance: Medium → Critical
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Also, this needs to be targetted for a 2.0 release.

Changed in juju-core:
milestone: 2.0.1 → 2.0-beta13
tags: added: 2.0 maas-provider
Changed in juju-core:
milestone: 2.0-beta13 → 2.0-beta14
Changed in juju-core:
assignee: nobody → Michael Foord (mfoord)
Michael Foord (mfoord)
Changed in juju-core:
status: Triaged → In Progress
Revision history for this message
Michael Foord (mfoord) wrote :

What version of maas is this against?

Revision history for this message
Michael Foord (mfoord) wrote :

Ok, so understanding the bug properly it's a juju problem not a maas problem. However right now I'm failing to reproduce (bootstrapping specifying ip:5240 for maas server is working for me).

Revision history for this message
Michael Foord (mfoord) wrote :

Ah, it seems maas/ip:port works, maas/domain-with.dot:port doesn't. So I can reproduce.

Revision history for this message
Michael Foord (mfoord) wrote :

$ JUJU_LOGGING_CONFIG="<root>=DEBUG" juju bootstrap maas2-vm maas/cloud.lol:5240 --upload-tools
ERROR malformed maas-server URL 'cloud.lol:5240': %!s(<nil>)

Revision history for this message
Michael Foord (mfoord) wrote :

Note that specifying the url in the form http://cloud.lol:5240/MAAS works - so it is possible to workaround.

The specific bug is in line 135 of provider/maas/config.go where "cloud.lol:5240" is parsed incorrectly (well perfectly correctly according to the spec of what a url should look like) by url.Parse.

Revision history for this message
Michael Foord (mfoord) wrote :
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta14 → 2.0-beta15
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta15 → none
milestone: none → 2.0-beta15
tags: added: auto-sanity tpe-lab
tags: added: taipei-lab
removed: tpe-lab
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.