pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.52k stars 655 forks source link

Add support for Debian trixie #7928

Open marcingretl opened 1 month ago

marcingretl commented 1 month ago

Hi, the following error appears after upgrading pgadmin4-desktop (I've tried both: 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/noble pgadmin4 main' and 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/snapshots/2024-09-12/apt/noble pgadmin4 main':

sudo apt -f install Summary:
Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0 1 not fully installed or removed. Space needed: 0 B / 29.4 GB available

Setting up pgadmin4-desktop (8.11) ... Load apparmor pgAdmin profile... AppArmor parser error for /etc/apparmor.d/pgadmin4 in profile /etc/apparmor.d/pgadmin4 at line 4: Could not open 'abi/4.0': No such file or directory dpkg: error processing package pgadmin4-desktop (--configure): installed pgadmin4-desktop package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: pgadmin4-desktop Error: Sub-process /usr/bin/dpkg returned an error code (1)

Cheers, Marcin

yogeshmahajan-1903 commented 1 month ago

@marcingretl What was your previous version?

marcingretl commented 1 month ago

Not sure but presumably the one before 8.11, since I upgrade installed packages on a daily basis.

yogeshmahajan-1903 commented 1 month ago

@marcingretl Snapshot builds are not tested. You should only install released version of pgAdmin. I am not able to reproduce the issue when I have upgrade from 8.10 to 8.11 May you can try complete uninstall and install released 8.11

marcingretl commented 1 month ago

Well, as stated I also used 'https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/noble'. So this is not a night build issue.

marcingretl commented 1 month ago

Last daily snapshot (https://ftp.postgresql.org/pub/pgadmin/pgadmin4/snapshots/2024-09-18/apt/noble) doesn't fix the issue.

yogeshmahajan-1903 commented 1 month ago

Can you please try complete uninstall and install released 8.11

marcingretl commented 1 month ago

And I did it today in the morning for the latest snapshot -> no success.

marcingretl commented 1 month ago

I think I know what's going on: you're trying to use AppArmor with ABI 4.0, while in Debian there is only 3.0 available: https://packages.debian.org/search?keywords=apparmor&searchon=names&suite=all&section=all (or for trixie directly: https://packages.debian.org/trixie/amd64/apparmor/filelist)

adityatoshniwal commented 1 month ago

Hi @marcingretl,

When we tested, Noble (24) and above versions had ABI 4.0. I'm not sure why its still 3.0 on your OS.

adityatoshniwal commented 1 month ago

Ahh OK! So you're using Ubuntu Trixie. pgAdmin is not supported on trixie yet. https://www.pgadmin.org/download/pgadmin-4-apt/

marcingretl commented 1 month ago

Hi, I'm using Debian trixie/sid (yes, mixed distos). And as I wrote: each Debian version supports only 3.0, so 8.1(2) is basically unavailable for Debian users then.

adityatoshniwal commented 1 month ago

Hi, I'm using Debian trixie/sid (yes, mixed distos). And as I wrote: each Debian version supports only 3.0, so 8.1(2) is basically unavailable for Debian users then.

No, app armor changes are only for Ubuntu 24 and above:

# Ubuntu 24 requires apparmor profile to work.
OS_ID=$(grep "^ID=" /etc/os-release | awk -F "=" '{ print $2 }')
OS_VERSION=$(grep "^VERSION_ID=" /etc/os-release | awk -F "=" '{ print $2 }' | sed 's/"//g' | awk -F "." '{ print $1 }')

if [ "${OS_ID}" == 'ubuntu' ] && [ "${OS_VERSION}" -ge "24" ]; then
  cat << EOF > "${DESKTOPROOT}/DEBIAN/conffiles"
/etc/apparmor.d/pgadmin4
EOF

  mkdir -p "${DESKTOPROOT}/etc/apparmor.d"
  cp "${SOURCEDIR}/pkg/debian/pgadmin4-aa-profile" "${DESKTOPROOT}/etc/apparmor.d/pgadmin4"

  cat << EOF > "${DESKTOPROOT}/DEBIAN/postinst"
#!/bin/sh

echo "Load apparmor pgAdmin profile..."
apparmor_parser -r /etc/apparmor.d/pgadmin4
EOF
  chmod 755 "${DESKTOPROOT}/DEBIAN/postinst"
fi
marcingretl commented 1 month ago

Ok, maybe what I've said was a little misleading.

The newest supported Debian is Bookworm and you're right, the pgadmin4 8.11 is available for this release. However, Bookworm uses Python 3.11 which is unavailable in Trixie (Debian testing release). That makes any 8.1(1/2) unavailable for users of Debian higher than Bookworm (released on 2023-06-10), since there is neither Python 3.11 nor AppArmor 4.

adityatoshniwal commented 1 month ago

Hi @marcingretl, Yep, pgAdmin doesn't support Debian Trixie yet. We will take this as a feature request to support it. Thanks.

liaohongxing commented 1 month ago

postgresql already supports Trixie, and pgAdmin should

https://apt.postgresql.org/pub/repos/apt/dists/

marcingretl commented 1 month ago

No, it does not. This is because in Trixie there is no: a) Python 3.11 (required by pgAdmin for Bookworm); b) AppArmor 4 (required by builds for Ubuntu).

So, if pgAdmin is expected to work on Debian-s newer than Bookworm please either change Python to 3.12 or AppArmor to 3 (ABI 3.0).

marcingretl commented 1 month ago

Any chance for PgAdmin4 8.(1/2) for Debian Trixie or newer?

marcingretl commented 1 month ago

Workaround for those, who use Dabian not Ubuntu:

  1. install pgadmin4-server 8.12 for Ubuntu Noble (works with Python 3.12, not 3.11)
  2. install pgadmin4-desktop 8.12 do Debian Bookworm (needs AppArmor 3, not 4)
adityatoshniwal commented 1 month ago

Any chance for PgAdmin4 8.(1/2) for Debian Trixie or newer?

We're already in the middle of 8.12 release which is most probably going to be released today. We can plan it for next release.

sverrehu commented 1 month ago

In case anyone would accept a dirty hack: I was able to install it on Ubuntu Noble running in a container without AppArmor by the following procedure in the Dockerfile:

RUN touch /bin/apparmor_parser && chmod 755 /bin/apparmor_parser \
    && apt-get -y --no-install-recommends install pgadmin4-desktop pgadmin4 \
    && rm /bin/apparmor_parser

It makes the install script think that apparmor_parser is available just long enough to pass installation.