postgresml/pgcat

Updating pgcat through Debian package resets config

Closed this issue · 3 comments

Describe the bug
We have a system setup with pgcat and chose the APT repository as an installation method, just as described in the official docs. For the original installation, this works fine so far, but yields problems with upgrading the package: Each time we've upgraded the package, the service got stopped and the configuration file reset to the package maintainer's version. Effectively, this disabled pgcat and caused issues for all applications using pgcat (rendering a fatal exception).

To Reproduce
Since the APT repository only provides the most recent version of pgcat, the following steps "trick" APT into upgrading to the same version again, simulating an upgrade.

Steps to reproduce the behavior:

  1. echo "deb [trusted=yes] https://apt.postgresml.org jammy main" | sudo tee -a /etc/apt/sources.list
  2. sudo apt-get update
  3. sudo apt-get install pgcat
  4. Modify /etc/pgcat.toml to make some changes to the default configuration
  5. sudo systemctl start pgcat
  6. Trick APT into a fake, new version. Edit /var/lib/apt/lists/apt.postgresml.org_dists_jammy_main_binary-amd64_Packages and increase the version for pgcat temporarily:
    Before:
    Package: pgcat
    Version: 1.1.2-dev4
    # ...
    
    After:
    Package: pgcat
    Version: 1.1.2-dev5
    # ...
    
  7. sudo apt-get upgrade pgcat
  8. ⚡️ Check /etc/pgcat.toml: The previous modifications were lost, the file got replaced during the upgrade
  9. ⚡️ Check the service status with sudo systemctl status pgcat: pgcat is no longer running.

Expected behavior
Upgrading pgcat through the official APT repository should 1) keep the current user configuration and 2) ensure that pgcat is in the same state as before (i.e., running).

Environment:

Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy
pgcat 1.1.2-dev4

Hi @levkk,

thanks for working on the changes. Unfortunately, I am not able to verify the fix you've made for two reasons:

  1. pgcat is still not running after an upgrade, but still listed as Active: inactive (dead)
  2. Now, the config file is not overwritten, but removed entirely. Instead, the example /etc/pgcat.example.toml is provided.

Hence, I would kindly ask to have another look at this issue. Many thanks for your time and effort in fixing this bug.

Please let me know if anything is unclear!

Happy New Year and all the best for 2024!

I just wanted to check in with this issue again, @levkk. As I mentioned, I don't think that this issue has been resolved or should be closed.

Therefore, I am writing again to consider reopening this issue. Otherwise, I'll open another one referencing this one.