Here is the script to reproduce, at least with the lxd provider.
$ juju --version
2.3.4-xenial-amd64
$ juju add-model srv
Added 'srv' model on localhost/localhost with credential 'localhost' for user 'admin'
$ juju deploy cs:postgresql
Located charm "cs:postgresql-174".
Deploying charm "cs:postgresql-174".
$ juju add-model client
Added 'client' model on localhost/localhost with credential 'localhost' for user 'admin'
$ juju deploy cs:~postgresql-charmers/postgresql-client psql
Located charm "cs:~postgresql-charmers/postgresql-client-5".
Deploying charm "cs:~postgresql-charmers/postgresql-client-5".
$ juju offer psql:db client-db
Application "psql" endpoints [db] available at "admin/client.client-db"
$ juju switch srv
lxd:admin/client -> lxd:admin/srv
$ juju find-offers
Store URL Access Interfaces
lxd admin/client.client-db admin pgsql:db
$ juju consume admin/client.client-db psql
Added admin/client.client-db as psql
$ juju add-relation postgresql:db psql:db
$ juju wait
INFO:root:All units idle since 2018-03-26 07:38:53.346395Z (postgresql/0)
$ juju remove-relation postgresql:db psql:db
$ juju remove-consumed-application psql
$ juju switch client
lxd:admin/srv -> lxd:admin/client
$ juju status | cat
Model Controller Cloud/Region Version SLA
client lxd localhost/localhost 2.3.4 unsupported
App Version Status Scale Charm Store Rev OS Notes
psql 9.5 blocked 1 postgresql-client jujucharms 5 ubuntu
Unit Workload Agent Machine Public address Ports Message
psql/0* blocked idle 0 10.0.4.86 Needs db relation
Machine State DNS Inst id Series AZ Message
0 started 10.0.4.86 juju-6de2ae-0 xenial Running
Offer Application Charm Rev Connected Endpoint Interface Role
client-db psql postgresql-client 5 1/1 db pgsql requirer
$ juju list-offers
Offer User Relation id Status Endpoint Interface Role Ingress subnets
client-db admin 0 joined db pgsql requirer
$ juju remove-offer client-db
ERROR application offer URL is missing application
$ juju remove-relation 0
$ juju list-offers
Offer User Relation id Status Endpoint Interface Role Ingress subnets
client-db admin 0 joined db pgsql requirer
$ juju wait
INFO:root:All units idle since 2018-03-26 07:41:23.353477Z (psql/0)
$ juju list-offers
Offer User Relation id Status Endpoint Interface Role Ingress subnets
client-db admin 0 joined db pgsql requirer
Here is the script to reproduce, at least with the lxd provider.
$ juju --version 174". 174". charmers/ postgresql- client psql -charmers/ postgresql- client- 5". -charmers/ postgresql- client- 5". client. client- db" client- db admin pgsql:db
2.3.4-xenial-amd64
$ juju add-model srv
Added 'srv' model on localhost/localhost with credential 'localhost' for user 'admin'
$ juju deploy cs:postgresql
Located charm "cs:postgresql-
Deploying charm "cs:postgresql-
$ juju add-model client
Added 'client' model on localhost/localhost with credential 'localhost' for user 'admin'
$ juju deploy cs:~postgresql-
Located charm "cs:~postgresql
Deploying charm "cs:~postgresql
$ juju offer psql:db client-db
Application "psql" endpoints [db] available at "admin/
$ juju switch srv
lxd:admin/client -> lxd:admin/srv
$ juju find-offers
Store URL Access Interfaces
lxd admin/client.
$ juju consume admin/client. client- db psql client- db as psql consumed- application psql
Added admin/client.
$ juju add-relation postgresql:db psql:db
$ juju wait
INFO:root:All units idle since 2018-03-26 07:38:53.346395Z (postgresql/0)
$ juju remove-relation postgresql:db psql:db
$ juju remove-
$ juju switch client
lxd:admin/srv -> lxd:admin/client
$ juju status | cat
Model Controller Cloud/Region Version SLA
client lxd localhost/localhost 2.3.4 unsupported
App Version Status Scale Charm Store Rev OS Notes
psql 9.5 blocked 1 postgresql-client jujucharms 5 ubuntu
Unit Workload Agent Machine Public address Ports Message
psql/0* blocked idle 0 10.0.4.86 Needs db relation
Machine State DNS Inst id Series AZ Message
0 started 10.0.4.86 juju-6de2ae-0 xenial Running
Offer Application Charm Rev Connected Endpoint Interface Role
client-db psql postgresql-client 5 1/1 db pgsql requirer
$ juju list-offers
Offer User Relation id Status Endpoint Interface Role Ingress subnets
client-db admin 0 joined db pgsql requirer
$ juju remove-offer client-db
ERROR application offer URL is missing application
$ juju remove-relation 0
$ juju list-offers
Offer User Relation id Status Endpoint Interface Role Ingress subnets
client-db admin 0 joined db pgsql requirer
$ juju wait
INFO:root:All units idle since 2018-03-26 07:41:23.353477Z (psql/0)
$ juju list-offers
Offer User Relation id Status Endpoint Interface Role Ingress subnets
client-db admin 0 joined db pgsql requirer
$ juju remove-relation 0 client- db
$ juju remove-offer admin/client.
ERROR cannot delete application offer "client-db": offer has 1 relation