Closed AmberCharitos closed 1 year ago
# clone trino charm repo: git clone https://github.com/canonical/trino-k8s-operator.git # checkout postgres-relation branch git checkout postgres-relation # pack charm cd trino-k8s-charm charmcraft pack # deploy trino charm juju deploy ./trino-k8s_ubuntu-22.04-amd64.charm --resource trino-image=trinodb/trino:418 # deploy postgres charm juju deploy postgresql-k8s --channel 14/stable # relate charms juju relate postgresql-k8s:database trino-k8s:postgresql_db
A relation is created between trino-k8s charm and postgresql-k8s charm, resulting in db_context being logged for the admin user.
trino-k8s
postgresql-k8s
db_context
Postgres Charm throw an error and goes into error status
Operating system: Ubuntu 22.04.1 LTS
Ubuntu 22.04.1 LTS
Juju CLI: 3.1.2-genericlinux-amd64
3.1.2-genericlinux-amd64
Juju agent: 3.1.2
3.1.2
Charm revision: 14.7
14.7
microk8s: MicroK8s v1.25.10 revision 5354
MicroK8s v1.25.10 revision 5354
Juju debug log: log.txt
2023-06-22T11:32:29.318Z [container-agent] 2023-06-22 11:32:29 ERROR juju-log database:134: Failed to create user: syntax error at or near ";" 2023-06-22T11:32:29.318Z [container-agent] LINE 1: ...134" WITH LOGIN ENCRYPTED PASSWORD 'QN20iew3AUq51Yve' admin; 2023-06-22T11:32:29.318Z [container-agent] ^ 2023-06-22T11:32:29.318Z [container-agent] 2023-06-22T11:32:29.324Z [container-agent] 2023-06-22 11:32:29 ERROR juju-log database:134: 2023-06-22T11:32:29.324Z [container-agent] Traceback (most recent call last): 2023-06-22T11:32:29.324Z [container-agent] File "/var/lib/juju/agents/unit-postgres-two-0/charm/lib/charms/postgresql_k8s/v0/postgresql.py", line 174, in create_user 2023-06-22T11:32:29.324Z [container-agent] cursor.execute( 2023-06-22T11:32:29.324Z [container-agent] psycopg2.errors.SyntaxError: syntax error at or near ";" 2023-06-22T11:32:29.324Z [container-agent] LINE 1: ...134" WITH LOGIN ENCRYPTED PASSWORD 'QN20iew3AUq51Yve' admin; 2023-06-22T11:32:29.324Z [container-agent] ^ 2023-06-22T11:32:29.324Z [container-agent] 2023-06-22T11:32:29.324Z [container-agent] 2023-06-22T11:32:29.324Z [container-agent] During handling of the above exception, another exception occurred: 2023-06-22T11:32:29.324Z [container-agent] 2023-06-22T11:32:29.324Z [container-agent] Traceback (most recent call last): 2023-06-22T11:32:29.324Z [container-agent] File "/var/lib/juju/agents/unit-postgres-two-0/charm/src/relations/postgresql_provider.py", line 86, in _on_database_requested 2023-06-22T11:32:29.324Z [container-agent] self.charm.postgresql.create_user(user, password, extra_user_roles=extra_user_roles) 2023-06-22T11:32:29.324Z [container-agent] File "/var/lib/juju/agents/unit-postgres-two-0/charm/lib/charms/postgresql_k8s/v0/postgresql.py", line 179, in create_user 2023-06-22T11:32:29.324Z [container-agent] raise PostgreSQLCreateUserError() 2023-06-22T11:32:29.324Z [container-agent] charms.postgresql_k8s.v0.postgresql.PostgreSQLCreateUserError
https://warthogs.atlassian.net/browse/DPE-2167
Hi @AmberCharitos!
This issue should be fixed by https://github.com/canonical/postgresql-k8s-operator/pull/201.
Thank you @marceloneppel !
@AmberCharitos, revision 116 from 14/edge channel has the fix.
14/edge
Steps to reproduce
Expected behavior
A relation is created between
trino-k8s
charm andpostgresql-k8s
charm, resulting indb_context
being logged for the admin user.Actual behavior
Postgres Charm throw an error and goes into error status
Versions
Operating system:
Ubuntu 22.04.1 LTS
Juju CLI:
3.1.2-genericlinux-amd64
Juju agent:
3.1.2
Charm revision:
14.7
microk8s:
MicroK8s v1.25.10 revision 5354
Log output
Juju debug log: log.txt
Additional context