postgresql-plpython-.* install fails on focal

Bug #1925970 reported by jarred wilson
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
PostgreSQL Charm
Invalid
Undecided
Unassigned

Bug Description

I am attempting to deploy postgresql and am hitting issues with the 'leader-settings-changed' hook failing. Upon further inspection, the charm is failing to install 'postgresql-plpython-.*' because it is not available on focal. It does however show as available on bionic so I am assuming the issue is with the focal repositories.

```
This is a Juju debug-hooks tmux session. Remember:
1. You need to execute hooks/actions manually if you want them to run for trapped events.
2. When you are finished with an event, you can run 'exit' to close the current window and allow Juju to continue processing
new events for this unit without exiting a current debug-session.
3. To run an action or hook and end the debugging session avoiding processing any more events manually, use:

./hooks/leader-settings-changed
tmux kill-session -t landscape-postgresql/0 # or, equivalently, CTRL+a d

4. CTRL+a is tmux prefix.

More help and info is available in the online documentation:
https://discourse.jujucharms.com/t/debugging-charm-hooks

root@landscapesql-2:/var/lib/juju/agents/unit-landscape-postgresql-0/charm# cd /var/lib/juju/agents/unit-landscape-postgresql-0/charm/
root@landscapesql-2:/var/lib/juju/agents/unit-landscape-postgresql-0/charm# ./hooks/leader-settings-changed
none
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'postgresql-12-debversion' for regex 'postgresql-.*-debversion'
E: Unable to locate package postgresql-plpython-.*
E: Couldn't find any package by glob 'postgresql-plpython-.*'
E: Couldn't find any package by regex 'postgresql-plpython-.*'
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'postgresql-12-debversion' for regex 'postgresql-.*-debversion'
E: Unable to locate package postgresql-plpython-.*
E: Couldn't find any package by glob 'postgresql-plpython-.*'
E: Couldn't find any package by regex 'postgresql-plpython-.*'
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'postgresql-12-debversion' for regex 'postgresql-.*-debversion'
E: Unable to locate package postgresql-plpython-.*
E: Couldn't find any package by glob 'postgresql-plpython-.*'
E: Couldn't find any package by regex 'postgresql-plpython-.*'
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'postgresql-12-debversion' for regex 'postgresql-.*-debversion'
E: Unable to locate package postgresql-plpython-.*
E: Couldn't find any package by glob 'postgresql-plpython-.*'
E: Couldn't find any package by regex 'postgresql-plpython-.*'
Traceback (most recent call last):
  File "/usr/lib/python3.8/shutil.py", line 788, in move
    os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmppxtf9657' -> '/var/lib/postgresql/scripts/find_latest_ready_wal.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./hooks/leader-settings-changed", line 18, in <module>
    main()
  File "/var/lib/juju/agents/unit-landscape-postgresql-0/.venv/lib/python3.8/site-packages/charms/reactive/__init__.py", line 74, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-landscape-postgresql-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-landscape-postgresql-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-landscape-postgresql-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-landscape-postgresql-0/charm/reactive/postgresql/nagios.py", line 117, in update_nrpe_config
    helpers.write(check_script_path, check_script, mode=0o755)
  File "/var/lib/juju/agents/unit-landscape-postgresql-0/charm/reactive/postgresql/helpers.py", line 75, in write
    shutil.move(f.name, path)
  File "/usr/lib/python3.8/shutil.py", line 802, in move
    copy_function(src, real_dst)
  File "/usr/lib/python3.8/shutil.py", line 432, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.8/shutil.py", line 261, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/postgresql/scripts/find_latest_ready_wal.py'
```

Revision history for this message
jarred wilson (jardon) wrote :

I believe that this package is actually requested by FCE not Postgresql. To work around the issue I had to force postgresql to deploy on bionic. This is not an issue with the charm and can be closed. Thank you!

Vern Hart (vern)
Changed in postgresql-charm:
status: New → Invalid
information type: Public → Private
Vern Hart (vern)
information type: Private → Public
Revision history for this message
Vern Hart (vern) wrote :

I have encountered the same issue when deploying postgresql on focal. This is indeed an fce issue as we are setting extra_packages to "python-apt postgresql-contrib postgresql-.*-debversion postgresql-plpython-.*"

The problem seems to be the fact that the package is now called postgresql-plpython3-.* (specifically postgresql-plpython3-12) on focal.

That said, if I install postgresql-plpython3-12 instead, the landscape-schema --bootstrap from the landscape-server charm fails with:

  psycopg2.OperationalError: could not access file "$libdir/plpython2":
    No such file or directory

So it seems until the landscape-server charm properly supports focal, the postgresql charm deployed with it must also be bionic.

I tried to add this bug to cpe-foundation but it erred saying it didn't allow public bugs so I made the bug private and it erred saying cpe-foundation doesn't allow private bugs. Sheesh... I'll file a new bug. https://bugs.launchpad.net/cpe-foundation/+bug/1950290

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.