replication-pause action fails importing urllib.parse

Bug #1527172 reported by Björn Tillenius
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postgresql (Juju Charms Collection)
Fix Released
High
Stuart Bishop

Bug Description

If you try to pause the replication of a secondary unit, the action fails trying to import urllib.parse.

This is what I did to reproduce the issue:

landscape:~/projects/postgresql-charm> juju deploy -n 2 postgresql
Added charm "cs:trusty/postgresql-32" to the environment.
landscape:~/projects/postgresql-charm> juju status --format tabular[Services]
NAME STATUS EXPOSED CHARM
postgresql active false cs:trusty/postgresql-32

[Units]
ID WORKLOAD-STATE AGENT-STATE VERSION MACHINE PORTS PUBLIC-ADDRESS MESSAGE
postgresql/0 active idle 1.25.0.1 1 5432/tcp 10.5.20.86 Live master
postgresql/1 active idle 1.25.0.1 2 5432/tcp 10.5.25.84 Live secondary

[Machines]
ID STATE VERSION DNS INS-ID SERIES HARDWARE
0 started 1.25.0.1 localhost localhost trusty
1 started 1.25.0.1 10.5.20.86 bjorn-local-machine-1 trusty arch=amd64
2 started 1.25.0.1 10.5.25.84 bjorn-local-machine-2 trusty arch=amd64
landscape:~/projects/postgresql-charm> juju action do postgresql/1 replication-pause
Action queued with id: e8b21efe-3377-4138-82d7-d33f8b313aa8
landscape:~/projects/postgresql-charm> juju action fetch --wait 0 e8b21efe-3377-4138-82d7-d33f8b313aa8
message: exit status 1
status: failed
timing:
  completed: 2015-12-17 11:45:53 +0200 EET
  enqueued: 2015-12-17 11:45:52 +0200 EET
  started: 2015-12-17 11:45:53 +0200 EET

This is in the unit-postgresql-1.log:
2015-12-17 09:07:17 INFO replication-pause Traceback (most recent call last):
2015-12-17 09:07:17 INFO replication-pause File "/var/lib/juju/agents/unit-postgresql-1/charm/actions/replication-pause", line 29, in <module>
2015-12-17 09:07:17 INFO replication-pause import postgresql
2015-12-17 09:07:17 INFO replication-pause File "/var/lib/juju/agents/unit-postgresql-1/charm/hooks/postgresql.py", line 37, in <module>
2015-12-17 09:07:17 INFO replication-pause import wal_e
2015-12-17 09:07:17 INFO replication-pause File "/var/lib/juju/agents/unit-postgresql-1/charm/hooks/wal_e.py", line 19, in <module>
2015-12-17 09:07:17 INFO replication-pause from urllib.parse import urlparse
2015-12-17 09:07:17 INFO replication-pause ImportError: No module named parse
2015-12-17 09:30:47 INFO replication-pause Traceback (most recent call last):
2015-12-17 09:30:47 INFO replication-pause File "/var/lib/juju/agents/unit-postgresql-1/charm/actions/replication-pause", line 29, in <module>
2015-12-17 09:30:47 INFO replication-pause import postgresql
2015-12-17 09:30:47 INFO replication-pause File "/var/lib/juju/agents/unit-postgresql-1/charm/hooks/postgresql.py", line 37, in <module>
2015-12-17 09:30:47 INFO replication-pause import wal_e
2015-12-17 09:30:47 INFO replication-pause File "/var/lib/juju/agents/unit-postgresql-1/charm/hooks/wal_e.py", line 19, in <module>
2015-12-17 09:30:47 INFO replication-pause from urllib.parse import urlparse
2015-12-17 09:30:47 INFO replication-pause ImportError: No module named parse
2015-12-17 09:31:22 INFO replication-resume Traceback (most recent call last):
2015-12-17 09:31:22 INFO replication-resume File "/var/lib/juju/agents/unit-postgresql-1/charm/actions/replication-resume", line 29, in <module>
2015-12-17 09:31:22 INFO replication-resume import postgresql
2015-12-17 09:31:22 INFO replication-resume File "/var/lib/juju/agents/unit-postgresql-1/charm/hooks/postgresql.py", line 37, in <module>
2015-12-17 09:31:22 INFO replication-resume import wal_e
2015-12-17 09:31:22 INFO replication-resume File "/var/lib/juju/agents/unit-postgresql-1/charm/hooks/wal_e.py", line 19, in <module>
2015-12-17 09:31:22 INFO replication-resume from urllib.parse import urlparse
2015-12-17 09:31:22 INFO replication-resume ImportError: No module named parse
2015-12-17 09:34:07 INFO replication-pause Traceback (most recent call last):
2015-12-17 09:34:07 INFO replication-pause File "/var/lib/juju/agents/unit-postgresql-1/charm/actions/replication-pause", line 29, in <module>
2015-12-17 09:34:07 INFO replication-pause import postgresql
2015-12-17 09:34:07 INFO replication-pause File "/var/lib/juju/agents/unit-postgresql-1/charm/hooks/postgresql.py", line 37, in <module>
2015-12-17 09:34:07 INFO replication-pause import wal_e
2015-12-17 09:34:07 INFO replication-pause File "/var/lib/juju/agents/unit-postgresql-1/charm/hooks/wal_e.py", line 19, in <module>
2015-12-17 09:34:07 INFO replication-pause from urllib.parse import urlparse
2015-12-17 09:34:07 INFO replication-pause ImportError: No module named parse
2015-12-17 09:34:42 INFO replication-resume Traceback (most recent call last):
2015-12-17 09:34:42 INFO replication-resume File "/var/lib/juju/agents/unit-postgresql-1/charm/actions/replication-resume", line 29, in <module>
2015-12-17 09:34:42 INFO replication-resume import postgresql
2015-12-17 09:34:42 INFO replication-resume File "/var/lib/juju/agents/unit-postgresql-1/charm/hooks/postgresql.py", line 37, in <module>
2015-12-17 09:34:42 INFO replication-resume import wal_e
2015-12-17 09:34:42 INFO replication-resume File "/var/lib/juju/agents/unit-postgresql-1/charm/hooks/wal_e.py", line 19, in <module>
2015-12-17 09:34:42 INFO replication-resume from urllib.parse import urlparse
2015-12-17 09:34:42 INFO replication-resume ImportError: No module named parse

Related branches

Revision history for this message
Björn Tillenius (bjornt) wrote :
tags: added: cross-team-kanban landscape
Revision history for this message
Björn Tillenius (bjornt) wrote :

The traceback in the description and the log files are from different deployments. Both were done using the local provider and the template lxc isn't clean, in that it has some packages pre-installed. Re-running the tests against the MAAS provider gives the following error in the logs:

2015-12-17 13:05:20 INFO replication-pause Traceback (most recent call last):
2015-12-17 13:05:20 INFO replication-pause File "/var/lib/juju/agents/unit-postgresql-0/charm/actions/replication-pause", line 29, in <module>
2015-12-17 13:05:20 INFO replication-pause import postgresql
2015-12-17 13:05:20 INFO replication-pause File "/var/lib/juju/agents/unit-postgresql-0/charm/hooks/postgresql.py", line 28, in <module>
2015-12-17 13:05:20 INFO replication-pause import psycopg2
2015-12-17 13:05:20 INFO replication-pause ImportError: No module named psycopg2

tags: added: kanban-cross-team
removed: cross-team-kanban
Revision history for this message
Stuart Bishop (stub) wrote :

actions/replication-pause and actions/replication-resume have an incorrect shebang line. They specify python2, when they should be using python3. I'm guessing a dependent module has become python3 only, breaking the actions.

Changed in postgresql (Juju Charms Collection):
status: New → Triaged
importance: Undecided → High
Stuart Bishop (stub)
Changed in postgresql (Juju Charms Collection):
assignee: nobody → Stuart Bishop (stub)
status: Triaged → Fix Released
Revision history for this message
Stuart Bishop (stub) wrote :

Bug #1527872 for the missing tests.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.