Skip to content
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

Block charm on inappropriate architecture (warn users about ARM revision deployed to AMD hardware) #463

Open
cbartz opened this issue Apr 30, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@cbartz
Copy link

cbartz commented Apr 30, 2024

Steps to reproduce

  1. juju deploy postgresql-k8s --trust --channel 14/edge --revision=240

Expected behavior

Unit goes into active status.

Actual behavior

Unit goes into error status.

image

Versions

Operating system: Ubuntu 22.04.4 LTS

Juju CLI: 3.1.8-genericlinux-amd64

Juju agent: 3.1.8

Charm revision: 240

microk8s: MicroK8s v1.29.2 revision 6529

Log output

Juju debug log:

unit-postgresql-k8s-0: 10:16:28 WARNING juju.worker.proxyupdater unable to set snap core settings [proxy.http= proxy.https= proxy.store=]: exec: "snap": executable file not found in $PATH, output: ""
unit-postgresql-k8s-0: 10:17:15 WARNING unit.postgresql-k8s/0.install Traceback (most recent call last):
unit-postgresql-k8s-0: 10:17:15 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 15, in <module>
unit-postgresql-k8s-0: 10:17:15 WARNING unit.postgresql-k8s/0.install     import psycopg2
unit-postgresql-k8s-0: 10:17:15 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/psycopg2/__init__.py", line 51, in <module>
unit-postgresql-k8s-0: 10:17:15 WARNING unit.postgresql-k8s/0.install     from psycopg2._psycopg import (                     # noqa
unit-postgresql-k8s-0: 10:17:15 WARNING unit.postgresql-k8s/0.install ModuleNotFoundError: No module named 'psycopg2._psycopg'
unit-postgresql-k8s-0: 10:17:15 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1
unit-postgresql-k8s-0: 10:17:21 WARNING unit.postgresql-k8s/0.install Traceback (most recent call last):
unit-postgresql-k8s-0: 10:17:21 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 15, in <module>
unit-postgresql-k8s-0: 10:17:21 WARNING unit.postgresql-k8s/0.install     import psycopg2
unit-postgresql-k8s-0: 10:17:21 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/psycopg2/__init__.py", line 51, in <module>
unit-postgresql-k8s-0: 10:17:21 WARNING unit.postgresql-k8s/0.install     from psycopg2._psycopg import (                     # noqa
unit-postgresql-k8s-0: 10:17:21 WARNING unit.postgresql-k8s/0.install ModuleNotFoundError: No module named 'psycopg2._psycopg'
unit-postgresql-k8s-0: 10:17:21 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1
unit-postgresql-k8s-0: 10:17:31 WARNING unit.postgresql-k8s/0.install Traceback (most recent call last):
unit-postgresql-k8s-0: 10:17:31 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 15, in <module>
unit-postgresql-k8s-0: 10:17:31 WARNING unit.postgresql-k8s/0.install     import psycopg2
unit-postgresql-k8s-0: 10:17:31 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/psycopg2/__init__.py", line 51, in <module>
unit-postgresql-k8s-0: 10:17:31 WARNING unit.postgresql-k8s/0.install     from psycopg2._psycopg import (                     # noqa
unit-postgresql-k8s-0: 10:17:31 WARNING unit.postgresql-k8s/0.install ModuleNotFoundError: No module named 'psycopg2._psycopg'
unit-postgresql-k8s-0: 10:17:31 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1
unit-postgresql-k8s-0: 10:17:52 WARNING unit.postgresql-k8s/0.install Traceback (most recent call last):
unit-postgresql-k8s-0: 10:17:52 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 15, in <module>
unit-postgresql-k8s-0: 10:17:52 WARNING unit.postgresql-k8s/0.install     import psycopg2
unit-postgresql-k8s-0: 10:17:52 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/psycopg2/__init__.py", line 51, in <module>
unit-postgresql-k8s-0: 10:17:52 WARNING unit.postgresql-k8s/0.install     from psycopg2._psycopg import (                     # noqa
unit-postgresql-k8s-0: 10:17:52 WARNING unit.postgresql-k8s/0.install ModuleNotFoundError: No module named 'psycopg2._psycopg'
unit-postgresql-k8s-0: 10:17:52 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1
unit-postgresql-k8s-0: 10:18:32 WARNING unit.postgresql-k8s/0.install Traceback (most recent call last):
unit-postgresql-k8s-0: 10:18:32 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 15, in <module>
unit-postgresql-k8s-0: 10:18:32 WARNING unit.postgresql-k8s/0.install     import psycopg2
unit-postgresql-k8s-0: 10:18:32 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/psycopg2/__init__.py", line 51, in <module>
unit-postgresql-k8s-0: 10:18:32 WARNING unit.postgresql-k8s/0.install     from psycopg2._psycopg import (                     # noqa
unit-postgresql-k8s-0: 10:18:32 WARNING unit.postgresql-k8s/0.install ModuleNotFoundError: No module named 'psycopg2._psycopg'
unit-postgresql-k8s-0: 10:18:32 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1
unit-postgresql-k8s-0: 10:19:55 WARNING unit.postgresql-k8s/0.install Traceback (most recent call last):
unit-postgresql-k8s-0: 10:19:55 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/./src/charm.py", line 15, in <module>
unit-postgresql-k8s-0: 10:19:55 WARNING unit.postgresql-k8s/0.install     import psycopg2
unit-postgresql-k8s-0: 10:19:55 WARNING unit.postgresql-k8s/0.install   File "/var/lib/juju/agents/unit-postgresql-k8s-0/charm/venv/psycopg2/__init__.py", line 51, in <module>
unit-postgresql-k8s-0: 10:19:55 WARNING unit.postgresql-k8s/0.install     from psycopg2._psycopg import (                     # noqa
unit-postgresql-k8s-0: 10:19:55 WARNING unit.postgresql-k8s/0.install ModuleNotFoundError: No module named 'psycopg2._psycopg'
unit-postgresql-k8s-0: 10:19:55 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1

Additional context

@cbartz cbartz added the bug Something isn't working label Apr 30, 2024
Copy link
Contributor

@taurus-forever
Copy link
Contributor

taurus-forever commented Jun 7, 2024

Hi @cbartz , as I can see the revision 240 was an ARM build.

Did you deploy it to ARM hardware? As your juju CLI is AMD 3.1.8-genericlinux-amd64, but the controller architecture is not mentioned.

For AMD architecture you should use revision 239 . However I recommend to let juju choose proper revision for your architecture (by using channel without specifying revision). If you still need ARM build, please consider to use 14/candidate revisions (they are going to be stable soon).

Resolved?

@taurus-forever
Copy link
Contributor

@marceloneppel IMHO, we should improve our charm to make sure extected architecture matching to the running hardware and block the charm otherwise, I think such issues will be popular (due to revision pinning in many places).

I will keep this open for @lucasgameiroborges to pickup. ACK?

@cbartz
Copy link
Author

cbartz commented Jun 7, 2024

@taurus-forever Looking at the shell history, it seems I explicitly specified revision 240 (not sure why to be honest, probably to make sure I get the latest rev) and it is on amd. Sorry about that!

The experience on charmhub is not good regarding different revs per architecture, it is not even mentioning arm there!

@dragomirp
Copy link
Contributor

The experience on charmhub is not good regarding different revs per architecture, it is not even mentioning arm there!

I find it easiest to filter with juju info postgresql-k8s --arch=amd64 [email protected]

@taurus-forever
Copy link
Contributor

taurus-forever commented Jun 7, 2024

@cbartz there is an upcoming improvements on CharmHub WEB, so it will be easier to navigate between architectures.
Also we are trying to indicate clearly the revisions in all official release notes.

Meanwhile, yes, the command recommended above is the safest way to go here. We will keep it open to check architecture in the charm and produce reasonable blocking message on the user mistake.

TODO: #463 (comment)

Thank you for reporting anyway!

@taurus-forever taurus-forever changed the title Deployment of rev 240 fails Block charm on appropriate architecture (warn users about ARM revision deployed to AMD hardware) Jun 7, 2024
@taurus-forever taurus-forever changed the title Block charm on appropriate architecture (warn users about ARM revision deployed to AMD hardware) Block charm on inappropriate architecture (warn users about ARM revision deployed to AMD hardware) Jun 7, 2024
@carlcsaposs-canonical
Copy link
Contributor

FYI, related juju feature request to improve UX: https://bugs.launchpad.net/juju/+bug/2073962

@lucasgameiroborges lucasgameiroborges self-assigned this Aug 28, 2024
@lucasgameiroborges
Copy link
Member

Hi @cbartz !

This issue received a relevant patch in this PR, already released on edge channel: #613

Now, the charm should warn the user in case of wrong arch version deployment. Feel free to give it a try and reopen this in case of problems.

Thank you for raising!

@lucasgameiroborges
Copy link
Member

Actually, there might be a problem in the latest release of this feature, we are investigating the issue now, reopening for clarity!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants