-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(snap) jhack reads juju status as empty #30
Comments
Was able to replicate the issue when moving these commands from cloud-init to running with sudo as
On the same environment, installing via |
Hi Carl, thanks for the report. I suspect it has something to do with some juju-envvars being unset in the python subprocess. |
What is Here's the output of `printenv`
|
yeah sorry, printenv is what I meant. And I think I need the env as available to the snap -- something like |
Here's the output of
|
does anything show up with And if you try and run |
|
does it only happen when there are no applications (the status you posted shows an empty model), or also after you've deployed something? Maybe something changed in the juju status output. Can you share the output of |
It also happens after I deploy something Output of {
"model": {
"name": "foo",
"type": "caas",
"controller": "micro",
"cloud": "microk8s",
"region": "localhost",
"version": "2.9.29",
"model-status": {
"current": "available",
"since": "03 Jan 2023 13:37:30Z"
},
"sla": "unsupported"
},
"machines": {},
"applications": {
"mysql-k8s": {
"charm": "mysql-k8s",
"series": "kubernetes",
"os": "kubernetes",
"charm-origin": "charmhub",
"charm-name": "mysql-k8s",
"charm-rev": 28,
"charm-channel": "edge",
"scale": 1,
"provider-id": "db3fcd29-0dee-4bee-a0af-3c5d2a79dc37",
"address": "10.152.183.72",
"exposed": false,
"application-status": {
"current": "waiting",
"message": "installing agent",
"since": "05 Jan 2023 15:06:33Z"
},
"relations": {
"database-peers": [
"mysql-k8s"
],
"restart": [
"mysql-k8s"
]
},
"units": {
"mysql-k8s/0": {
"workload-status": {
"current": "error",
"message": "hook failed: \"install\"",
"since": "05 Jan 2023 15:09:24Z"
},
"juju-status": {
"current": "idle",
"since": "05 Jan 2023 15:09:24Z",
"version": "2.9.29"
},
"leader": true,
"address": "10.1.193.22",
"provider-id": "mysql-k8s-0"
}
},
"endpoint-bindings": {
"": "alpha",
"certificates": "alpha",
"database": "alpha",
"database-peers": "alpha",
"mysql": "alpha",
"osm-mysql": "alpha",
"restart": "alpha"
}
}
},
"storage": {
"storage": {
"database/0": {
"kind": "filesystem",
"life": "alive",
"status": {
"current": "attached",
"message": "Successfully provisioned volume pvc-8fbae690-2722-4f71-9534-38182f6dd14c",
"since": "05 Jan 2023 15:06:42Z"
},
"persistent": false,
"attachments": {
"units": {
"mysql-k8s/0": {
"life": "alive"
}
}
}
}
},
"filesystems": {
"0": {
"provider-id": "8fbae690-2722-4f71-9534-38182f6dd14c",
"volume": "0",
"storage": "database/0",
"Attachments": {
"containers": {
"mysql-k8s/0": {
"mount-point": "/var/lib/juju/storage/database/0",
"read-only": false,
"life": "alive"
}
},
"units": {
"mysql-k8s/0": {
"life": "alive"
}
}
},
"pool": "kubernetes",
"size": 1024,
"life": "alive",
"status": {
"current": "attached",
"message": "Successfully provisioned volume pvc-8fbae690-2722-4f71-9534-38182f6dd14c",
"since": "05 Jan 2023 15:06:42Z"
}
}
},
"volumes": {
"0": {
"provider-id": "pvc-8fbae690-2722-4f71-9534-38182f6dd14c",
"storage": "database/0",
"attachments": {
"containers": {
"mysql-k8s/0": {
"read-only": false,
"life": "alive"
}
},
"units": {
"mysql-k8s/0": {
"life": "alive"
}
}
},
"pool": "kubernetes",
"size": 1024,
"persistent": false,
"life": "alive",
"status": {
"current": "attached",
"since": "05 Jan 2023 15:06:42Z"
}
}
}
},
"controller": {
"timestamp": "15:10:15Z"
}
} and inside of the snap shell
Juju version inside of the snap shell: juju status without --format=json inside the snap shell works as expected The juju agent version is |
uh that's surprising. |
Correct |
opened a broader issue addressing the root cause |
Output from
jhack tail
:I used
pdb.set_trace()
here to check the values of: (by following this method)juju_status(json=True)
was{}
jhack.helpers.juju_version()
was'3.0.0'
jhack.helpers.juju_models()
was''
In my local environment:
juju version
was2.9.37-ubuntu-amd64
Copy-pasting code from
tail_charms.py
into a python3 interpreter gave me:raw
was'2.9.37-ubuntu-amd64'
raw.split("-")[0]
was'2.9.37'
I did run this command:
sudo snap connect jhack:dot-local-share-juju snapd
I also tried refreshing the snap from
latest/stable: 0.3.2 2022-11-02 (120)
tolatest/beta: 0.3.2 2022-11-22 (124)
andlatest/edge: 0.3.2 2022-11-24 (126)
with the same issue.Running on Google Compute Engine Ubuntu 22.04
GCE environment:
Cloud-init:
Commands run as `ubuntu` user after cloud-init:
The text was updated successfully, but these errors were encountered: