juju models reports "missing type, model details not valid"

Bug #1750833 reported by Roger Peppe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Critical
Ian Booth
2.3
Invalid
Critical
Unassigned

Bug Description

This PR is incompatible with older API versions that do not return type information in the model. https://github.com/juju/juju/pull/8406

The juju models command reports:

    % juju models
    missing type, model details not valid
    ERROR missing type, model details not valid

See this comment: https://github.com/juju/juju/pull/8406#discussion_r169649328

Juju commit juju-2.3.3-621-g3dc31c2

Revision history for this message
John A Meinel (jameinel) wrote :

As this seems to be a regression in compatibility (new 'juju models' fails to run against an older jujud), I'd consider this critical.

Changed in juju:
importance: Undecided → Critical
status: New → Triaged
Ian Booth (wallyworld)
Changed in juju:
assignee: nobody → Ian Booth (wallyworld)
milestone: none → 2.4-beta1
Revision history for this message
Ian Booth (wallyworld) wrote :

I tried to reproduce this without luck.
I bootstrapped a 2.3.3 version of Juju.
I then compiled a 2.4-beta1 client.
juju models worked as expected.

Could you tell me what you did to see this? The api client code was updated to fill in missing model type values from older agents so I am not sure why you're seeing the failure. Any repro steps would be great.

Changed in juju:
status: Triaged → Incomplete
Revision history for this message
Roger Peppe (rogpeppe) wrote :
Download full text (5.0 KiB)

repro with:

   juju login jimm.staging.jujucharms.com
   juju models

Here's some log output from a repro. This is with JIMM - it's possible it's doing something wrong with the facade versions that's causing the client to behave wrongly.

 % juju models --debug --logging-config TRACE
 21:51:06 INFO juju.cmd supercommand.go:56 running juju [2.4-beta1 gc devel +104445e Wed Feb 7 19:22:09 2018 +0000]
 21:51:06 DEBUG juju.cmd supercommand.go:57 args: []string{"juju", "models", "--debug", "--logging-config", "TRACE"}
 21:51:06 INFO juju.juju api.go:67 connecting to API addresses: [jimm.staging.jujucharms.com:443]
 21:51:06 DEBUG juju.api apiclient.go:696 looked up jimm.staging.jujucharms.com -> [185.125.191.194]
 21:51:06 DEBUG juju.api apiclient.go:839 successfully dialed "wss://jimm.staging.jujucharms.com:443/api"
 21:51:06 INFO juju.api apiclient.go:598 connection established to "wss://jimm.staging.jujucharms.com:443/api"
 21:51:06 TRACE juju.rpc.jsoncodec codec.go:225 -> {"request-id":1,"type":"Admin","version":3,"request":"Login","params":{"auth-tag":"","credentials":"","nonce":"","macaroons":[[redacted]],"cli-args":"juju models --debug --logging-config TRACE","user-data":""}}
 21:51:06 TRACE juju.rpc.jsoncodec codec.go:120 <- {"request-id":1,"response":{"controller-tag":"controller-a030379a-940f-4760-8fcf-3062b41a04e8","user-info":{"display-name":"rogpeppe","identity":"user-rogpeppe@external","controller-access":"","model-access":""},"facades":[{"name":"Admin","versions":[3]},{"name":"Bundle","versions":[1]},{"name":"Cloud","versions":[1]},{"name":"Controller","versions":[3]},{"name":"JIMM","versions":[1]},{"name":"ModelManager","versions":[2]},{"name":"Pinger","versions":[1]},{"name":"UserManager","versions":[1]}],"server-version":"2.2.2.2"}}
 21:51:06 TRACE juju.rpc.jsoncodec codec.go:225 -> {"request-id":2,"type":"ModelManager","version":2,"request":"ListModels","params":{"tag":"user-rogpeppe@external"}}
 21:51:06 TRACE juju.rpc.jsoncodec codec.go:120 <- {"request-id":2,"response":{"user-models":[{"model":{"name":"bar","uuid":"127da4f5-d588-4147-855b-25cf6e3a53d5","owner-tag":"user-rogpeppe@external"},"last-connection":null},{"model":{"name":"foo","uuid":"9507f451-a79e-490f-8a4d-a7c935a43706","owner-tag":"user-rogpeppe@external"},"last-connection":null},{"model":{"name":"migrate-test6","uuid":"be1966a2-8711-4cb2-8082-d7a5c12c409a","owner-tag":"user-rogpeppe@external"},"last-connection":null}]}}
 21:51:06 TRACE juju.rpc.jsoncodec codec.go:225 -> {"request-id":3,"type":"ModelManager","version":2,"request":"ModelInfo","params":{"entities":[{"tag":"model-127da4f5-d588-4147-855b-25cf6e3a53d5"},{"tag":"model-9507f451-a79e-490f-8a4d-a7c935a43706"},{"tag":"model-be1966a2-8711-4cb2-8082-d7a5c12c409a"}]}}
 21:51:06 TRACE juju.rpc.jsoncodec codec.go:120 <- {"request-id":3,"response":{"results":[{"result":{"name":"bar","uuid":"127da4f5-d588-4147-855b-25cf6e3a53d5","controller-uuid":"a030379a-940f-4760-8fcf-3062b41a04e8","provider-type":"ec2","default-series":"xenial","cloud-tag":"cloud-aws","cloud-region":"eu-central-1","cloud-credential-tag":"cloudcred-aws_rogpeppe@external_ec2","owner-tag":"user-rogpeppe@external","life":"alive","status":{"st...

Read more...

Ian Booth (wallyworld)
Changed in juju:
status: Incomplete → In Progress
Revision history for this message
Roger Peppe (rogpeppe) wrote : Re: [Bug 1750833] Re: juju models reports "missing type, model details not valid"

On 21 February 2018 at 22:47, Ian Booth <email address hidden> wrote:
> Ah we need jimm PR - juju core is fine.
>

No it's not :)

> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1750833
>
> Title:
> juju models reports "missing type, model details not valid"
>
> Status in juju:
> Incomplete
> Status in juju 2.3 series:
> Invalid
>
> Bug description:
> This PR is incompatible with older API versions that do not return
> type information in the model. https://github.com/juju/juju/pull/8406
>
> The juju models command reports:
>
> % juju models
> missing type, model details not valid
> ERROR missing type, model details not valid
>
> See this comment:
> https://github.com/juju/juju/pull/8406#discussion_r169649328
>
> Juju commit juju-2.3.3-621-g3dc31c2
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1750833/+subscriptions

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

Ah found it - there's some legacy code for old controllers in core that I missed when filling in the model type defaults.

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

I am all for fixing old juju code and will look at the PR but the question remains - if it's a code path/api that we are hoping to make obsolete, why does jimm use it? Should it not be updated to use later API?

Revision history for this message
John A Meinel (jameinel) wrote :

JIMM should probably be updated. However, if you bootstrap a Juju 2.2
controller (JIMM compatible), we should make sure that Juju 2.3 is able to
talk to it.

The reason Ian couldn't reproduce is that it isn't a bug in 2.4 talking to
2.3, it is a bug in 2.3 talking to 2.2.

John
=:->

On Thu, Feb 22, 2018 at 4:59 AM, Anastasia <email address hidden>
wrote:

> I am all for fixing old juju code and will look at the PR but the
> question remains - if it's a code path/api that we are hoping to make
> obsolete, why does jimm use it? Should it not be updated to use later
> API?
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1750833
>
> Title:
> juju models reports "missing type, model details not valid"
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1750833/+subscriptions
>

Revision history for this message
John A Meinel (jameinel) wrote :

(its possible that we might argue that 2.4 doesn't need to talk to a 2.2
controller, though I'd definitely argue it. But *definitely* a 2.3 client
should be compatible with a 2.2 controller.)

On Thu, Feb 22, 2018 at 6:40 AM, John Meinel <email address hidden> wrote:

> JIMM should probably be updated. However, if you bootstrap a Juju 2.2
> controller (JIMM compatible), we should make sure that Juju 2.3 is able to
> talk to it.
>
> The reason Ian couldn't reproduce is that it isn't a bug in 2.4 talking to
> 2.3, it is a bug in 2.3 talking to 2.2.
>
> John
> =:->
>
>
> On Thu, Feb 22, 2018 at 4:59 AM, Anastasia <anastasia.macmood@canonical.
> com> wrote:
>
>> I am all for fixing old juju code and will look at the PR but the
>> question remains - if it's a code path/api that we are hoping to make
>> obsolete, why does jimm use it? Should it not be updated to use later
>> API?
>>
>> --
>> You received this bug notification because you are subscribed to juju.
>> Matching subscriptions: juju bugs
>> https://bugs.launchpad.net/bugs/1750833
>>
>> Title:
>> juju models reports "missing type, model details not valid"
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/juju/+bug/1750833/+subscriptions
>>
>
>

Ian Booth (wallyworld)
Changed in juju:
status: In Progress → Fix Committed
Revision history for this message
John A Meinel (jameinel) wrote :
Revision history for this message
Ian Booth (wallyworld) wrote :

The root cause is wholely in 2.4 - it has nothing to do with 2.2 or 2.3
There was a case where a legacy api client missed filling in the model type when talking to an old server.

Revision history for this message
John A Meinel (jameinel) wrote :

To second Ian's comment, I just confirmed that the 2.3 branch params.ModelInfo struct (which is what is being populated) did not have a Type field (for IAAS vs CAAS) so it couldn't have needed to have that field populated.

Revision history for this message
John A Meinel (jameinel) wrote :

this was only a bug in the develop branch, so the fix is actually "released" since develop was fixed.

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.