canonical / jhack

Chock-full of Juju hackery.
Apache License 2.0
51 stars 24 forks source link

`sync` fails on Juju 3.5.3 #173

Open phvalguima opened 3 months ago

phvalguima commented 3 months ago

Using:

channels:
  latest/stable:    0.4.0.8 2024-05-15 (306) 114MB -
  latest/candidate: 0.4.2.1 2024-06-14 (365) 114MB -
  latest/beta:      0.4.2.1 2024-06-14 (365) 114MB -
  latest/edge:      0.4.3.0 2024-07-25 (379) 115MB -
installed:          0.4.3.0            (379) 115MB -

I am getting an odd error when I've ran juju version 3.5.3: jhack sync -s ./src -s ./lib/charms/opensearch/ opensearch returns a KeyError: "applications" on: https://pastebin.ubuntu.com/p/GdnB37rK3Y/ The model is set as my default and the opensearch application does exist.

Rolling back to juju version 3.4.5 resolves the issue.

Also using Juju 3.4.5, I also created an empty model and ran the command above (so I could trigger the same KeyError as above). I can see the error message is more complete: https://pastebin.ubuntu.com/p/6rrGhk8qyq/. It does find more information about the model:

           status = {                                                 
                    │   'model': {                                    
                    │   │   'name': 'test-scale-to-one-and-back-canv',
                    │   │   'type': 'iaas',                           
                    │   │   'controller': 'localhost-localhost',      
                    │   │   'cloud': 'localhost',                     
                    │   │   'region': 'localhost',                    
                    │   │   'version': '3.4.5',                       
                    │   │   'model-status': {                         
                    │   │   │   'current': 'available',               
                    │   │   │   'since': '07 Aug 2024 18:30:44+02:00' 
                    │   │   },                                        
                    │   │   'sla': 'unsupported'                      
                    │   },                                            
                    │   'machines': {},                               
                    │   'applications': {},                           
                    │   'storage': {},                                
                    │   'controller': {                               
                    │   │   'timestamp': '18:31:19+02:00'             
                    │   }                                             
                    }                                                 
PietroPasotti commented 3 months ago

uhm that's odd, indeed. It looks like it has issues running juju status. Was the model still being set up by any chance?

PietroPasotti commented 3 months ago

can you share the output of juju status --format json?

PietroPasotti commented 3 months ago

I suspect it may have been an issue of the command being run too soon after model creation or another similar glitch. Without a reproducer and more data I can't help. Can you also try from edge?

phvalguima commented 1 month ago

Hi @PietroPasotti I can reproduce with the following steps:

sudo snap install juju --channel=3.5/stable
juju bootstrap localhost

juju add-model test2
juju deploy ubuntu

jhack version: installed: 0.4.3.3.1 (395) 114MB -

This is the juju status:

$ juju status
Model  Controller           Cloud/Region         Version  SLA          Timestamp
test2  localhost-localhost  localhost/localhost  3.5.4    unsupported  19:11:21Z

App     Version  Status  Scale  Charm   Channel        Rev  Exposed  Message
ubuntu  24.04    active      1  ubuntu  latest/stable   25  no       

Unit       Workload  Agent  Machine  Public address  Ports  Message
ubuntu/0*  active    idle   0        10.3.227.117           

Machine  State    Address       Inst id        Base          AZ  Message
0        started  10.3.227.117  juju-2cb202-0  ubuntu@24.04      Running

Now, if I run jhack, here is the output error I get: https://pastebin.ubuntu.com/p/D9tf9kMBJd/

phvalguima commented 1 month ago

I am running that test in an AWS instance with Ubuntu 22.04

phvalguima commented 1 month ago

Refreshed to edge (0.4.4.0.2) and still seeing issues.