PostgreSQL config from previous install found at /etc/postgresql/10/main/postgresql.conf
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PostgreSQL Charm |
Triaged
|
Medium
|
Unassigned |
Bug Description
I've just found the following problem when deploying postgresql charm with point in time recovery options:
$ juju status
Model Controller Cloud/Region Version SLA Timestamp
postgresql maas-region1 maas-region1 2.5.1 unsupported 09:59:49+02:00
App Version Status Scale Charm Store Rev OS Notes
keystone 13.0.2 active 1 keystone jujucharms 301 ubuntu
mysql 5.7.20-29.24 active 1 percona-cluster jujucharms 276 ubuntu
postgresql 10.8 blocked 1 postgresql jujucharms 199 ubuntu
swift-proxy 2.17.1 active 1 swift-proxy jujucharms 83 ubuntu
swift-storage 2.17.1 active 1 swift-storage jujucharms 256 ubuntu
Unit Workload Agent Machine Public address Ports Message
keystone/0* active idle 0/lxd/0 172.18.0.109 5000/tcp Unit is ready
mysql/0* active idle 0/lxd/1 172.18.0.102 3306/tcp Unit is ready
postgresql/0* blocked idle 0/lxd/4 172.18.0.107 PostgreSQL config from previous install found at /etc/postgresql
swift-proxy/0* active idle 0/lxd/2 172.18.0.110 8080/tcp Unit is ready
swift-storage/0* active idle 0 172.18.0.108 Unit is ready
Machine State DNS Inst id Series AZ Message
0 started 172.18.0.108 ehptre bionic default Deployed
0/lxd/0 started 172.18.0.109 juju-bd1991-0-lxd-0 bionic default Container started
0/lxd/1 started 172.18.0.102 juju-bd1991-0-lxd-1 bionic default Container started
0/lxd/2 started 172.18.0.110 juju-bd1991-0-lxd-2 bionic default Container started
0/lxd/4 started 172.18.0.107 juju-bd1991-0-lxd-4 bionic default Container started
$ juju run --unit postgresql/0 "charms.reactive -p get_flags"
['apt.installed
'apt.installed
'leadership.
'leadership.
'leadership.
'leadership.
'postgresql.
'postgresql.
'postgresql.
'postgresql.
'postgresql.
'postgresql.
'postgresql.
'postgresql.
'postgresql.
'postgresql.
'snap.
'snap.
'snap.
'workloadstatu
In order to reproduce the issue please follow the instructions below:
$ cat swift-minimal-
series: bionic
machines:
"0":
constraints: tags=swift
series: bionic
services:
keystone:
charm: cs:keystone
num_units: 1
options:
admin-
token-
worker-
to:
- lxd:0
mysql:
charm: cs:percona-cluster
num_units: 1
options:
innodb-
max-
to:
- lxd:0
swift-proxy:
charm: cs:swift-proxy
num_units: 1
options:
replicas: 1
zone-
to:
- lxd:0
swift-storage:
charm: cs:swift-storage
num_units: 1
options:
block-device: sdb sdc sdd
zone: 1
to:
- 0
relations:
- [ "keystone:
- [ "keystone:
- [ "swift-
$ juju deploy swift-minimal-
Resolving charm: cs:keystone
Resolving charm: cs:percona-cluster
Resolving charm: cs:swift-proxy
Resolving charm: cs:swift-storage
Executing changes:
- upload charm cs:keystone-301 for series bionic
- deploy application keystone on bionic using cs:keystone-301
- upload charm cs:percona-
- deploy application mysql on bionic using cs:percona-
- upload charm cs:swift-proxy-83 for series bionic
- deploy application swift-proxy on bionic using cs:swift-proxy-83
- upload charm cs:swift-
- deploy application swift-storage on bionic using cs:swift-
- add new machine 0
- add relation keystone:shared-db - mysql:shared-db
- add relation keystone:
- add relation swift-proxy:
- add unit swift-storage/0 to new machine 0
- add lxd container 0/lxd/0 on new machine 0
- add lxd container 0/lxd/1 on new machine 0
- add lxd container 0/lxd/2 on new machine 0
- add unit keystone/0 to 0/lxd/0
- add unit mysql/0 to 0/lxd/1
- add unit swift-proxy/0 to 0/lxd/2
Deploy of bundle completed.
$ cat postgresql.yaml
postgresql:
wal_e_
os_username: admin
os_password: admin
os_auth_url: http://
os_tenant_name: admin
$ juju deploy postgresql --config postgresql.yaml
Located charm "cs:postgresql-
Deploying charm "cs:postgresql-
Attached is the log from the postgresql/0 unit.
Running the following command:
$ juju run --unit postgresql/0 "charms.reactive -p set_flag postgresql. cluster. initial- check"
moves the charm forward, however, it fails with the following errors:
2019-06-06 08:13:35 DEBUG update-status Authorization Failure. Authorization Failed: (http:// 172.18. 0.109:35357/ v3/tokens): The resource could not be found. (HTTP 404) (Request-ID: req-b6f8785c- 890a-400b- a8cc-568a96cad6 f1) juju/agents/ unit-postgresql -1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ __init_ _.py", line 73, in main dispatch( restricted= restricted_ mode) juju/agents/ unit-postgresql -1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ bus.py" , line 390, in dispatch other_handlers) juju/agents/ unit-postgresql -1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ bus.py" , line 359, in _invoke invoke( ) juju/agents/ unit-postgresql -1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ bus.py" , line 181, in invoke _action( *args) juju/agents/ unit-postgresql -1/charm/ reactive/ postgresql/ wal_e.py" , line 154, in ensure_ swift_container check_call( cmd, universal_ newlines= True) python3. 6/subprocess. py", line 291, in check_call ror(retcode, cmd) CalledProcessEr ror: Command '['/snap/ bin/wal- e.envdir' , '/etc/postgresq l/10/main/ wal-e.env' , '/snap/ bin/wal- e.swift' , 'post', 'backup']' returned non-zero exit status 1.
2019-06-06 08:13:35 ERROR juju-log Hook error:
Traceback (most recent call last):
File "/var/lib/
bus.
File "/var/lib/
_invoke(
File "/var/lib/
handler.
File "/var/lib/
self.
File "/var/lib/
subprocess.
File "/usr/lib/
raise CalledProcessEr
subprocess.
2019-06-06 08:13:35 DEBUG update-status /var/lib/ juju/agents/ unit-postgresql -1/charm/ reactive/ postgresql/ helpers. py:107: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https:/ /msg.pyyaml. org/load for full details. juju/agents/ unit-postgresql -1/charm/ hooks/update- status" , line 22, in <module> juju/agents/ unit-postgresql -1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ __init_ _.py", line 73, in main restricted= restricted_ mode) juju/agents/ unit-postgresql -1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ bus.py" , line 390, in dispatch other_handlers) juju/agents/ unit-postgresql -1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ bus.py" , line 359, in _invoke juju/agents/ unit-postgresql -1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ bus.py" , line 181, in invoke
2019-06-06 08:13:35 DEBUG update-status return yaml.load(f)
2019-06-06 08:13:35 DEBUG update-status Traceback (most recent call last):
2019-06-06 08:13:35 DEBUG update-status File "/var/lib/
2019-06-06 08:13:35 DEBUG update-status main()
2019-06-06 08:13:35 DEBUG update-status File "/var/lib/
2019-06-06 08:13:35 DEBUG update-status bus.dispatch(
2019-06-06 08:13:35 DEBUG update-status File "/var/lib/
2019-06-06 08:13:35 DEBUG update-status _invoke(
2019-06-06 08:13:35 DEBUG update-status File "/var/lib/
2019-06-06 08:13:35 DEBUG update-status handler.invoke()
2019-06-06 08:13:35 DEBUG update-status File "/var/lib/
2019-06-06 08:13:35 DEBUG update-status self._action(*args)
2019-06-06 08:13:35 DEBUG update-status File "...