canonical / postgresql-operator

A Charmed Operator for running PostgreSQL on machines
https://charmhub.io/postgresql
Apache License 2.0
8 stars 19 forks source link

Revision 472 import error #620

Open yhaliaw opened 5 days ago

yhaliaw commented 5 days ago

Steps to reproduce

  1. juju deploy postgresql --channel 14/edge, the current revision for this is 472

Expected behavior

The application eventually settle to Active state, and the database is available for use.

Actual behavior

The application is in error state. E.g.:

postgresql/0   error     idle   0        10.142.70.45           hook failed: "storage-attached"

From the debug-logs, it seems this is the cause:

unit.postgresql/0.pgdata-storage-attached ModuleNotFoundError: No module named 'psycopg2._psycopg'

Full debug-log in later section.

Versions

Operating system: The juju machine is ubuntu@22.04

Juju CLI: 3.5.3-ubuntu-amd64

Juju agent: 3.5.3

Charm revision: 472

LXD: The juju machine is openstack VMs.

Log output

Juju debug log:

unit-postgresql-0: 14:31:06 INFO juju Starting unit workers for "postgresql/0"
unit-postgresql-0: 14:31:06 INFO juju.worker.apicaller [3130dc] "unit-postgresql-0" successfully connected to "10.146.16.27:17070"
unit-postgresql-0: 14:31:06 INFO juju.worker.apicaller [3130dc] password changed for "unit-postgresql-0"
unit-postgresql-0: 14:31:06 INFO juju.worker.apicaller [3130dc] "unit-postgresql-0" successfully connected to "10.146.16.27:17070"
unit-postgresql-0: 14:31:06 INFO juju.worker.upgrader no waiter, upgrader is done
unit-postgresql-0: 14:31:06 INFO juju.worker.migrationminion migration migration phase is now: NONE
unit-postgresql-0: 14:31:06 INFO juju.worker.logger logger worker started
unit-postgresql-0: 14:31:06 ERROR juju.worker.meterstatus error running "meter-status-changed": charm missing from disk
unit-postgresql-0: 14:31:06 INFO juju.worker.uniter unit "postgresql/0" started
unit-postgresql-0: 14:31:06 INFO juju.worker.uniter resuming charm install
unit-postgresql-0: 14:31:06 INFO juju.worker.uniter.charm downloading ch:amd64/postgresql-472 from API server
unit-postgresql-0: 14:40:33 INFO juju.worker.uniter hooks are retried true
unit-postgresql-0: 14:40:33 WARNING unit.postgresql/0.pgdata-storage-attached Traceback (most recent call last):
unit-postgresql-0: 14:40:33 WARNING unit.postgresql/0.pgdata-storage-attached   File "/var/lib/juju/agents/unit-postgresql-0/charm/./src/charm.py", line 18, in <module>
unit-postgresql-0: 14:40:33 WARNING unit.postgresql/0.pgdata-storage-attached     import psycopg2
unit-postgresql-0: 14:40:33 WARNING unit.postgresql/0.pgdata-storage-attached   File "/var/lib/juju/agents/unit-postgresql-0/charm/venv/psycopg2/__init__.py", line 51, in <module>
unit-postgresql-0: 14:40:33 WARNING unit.postgresql/0.pgdata-storage-attached     from psycopg2._psycopg import (                     # noqa
unit-postgresql-0: 14:40:33 WARNING unit.postgresql/0.pgdata-storage-attached ModuleNotFoundError: No module named 'psycopg2._psycopg'
unit-postgresql-0: 14:40:33 ERROR juju.worker.uniter.operation hook "pgdata-storage-attached" (via hook dispatching script: dispatch) failed: exit status 1
unit-postgresql-0: 14:40:33 INFO juju.worker.uniter awaiting error resolution for "storage-attached" hook

Additional context

syncronize-issues-to-jira[bot] commented 5 days ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/DPE-5459.

This message was autogenerated

dragomirp commented 1 day ago

Hi, @yhaliaw, rev. 472 is an arm64 revision, if you are deploying on amd64 the revision is 472. You can verify the revision using juju info postgresql --arch=amd64 --base=ubuntu@22.04. There are some protections available on the K8s charm we should port, to get a more obvious error message