timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.84k stars 884 forks source link

Dependency error with yum on CentOS 8 #2691

Open mennowo opened 3 years ago

mennowo commented 3 years ago

System:

When trying to install TimescaleDB on CentOS 8, I get an error with yum. I installed postgres 12 as provided by the os: dnf module enable postgresql:12 and then dnf install postgresql-server. Then when trying to install timescale I get: "nothing provides postgresql12 >= 12 needed by timescaledb-postgresql-12-1.7.4.0.el8.x86_64". I believe this could be fixed by changing the dependency of the package to "postgresql >= 12".

mennowo commented 3 years ago

A small followup. Using this command:

dnf -qy module disable postgresql

the dependency error will disappear, and timescale can install under CentOS.

Nonetheless, it would be better to correct the dependencies, as "postgresql12 >= 12" does not make much sense to begin with. The solution would be to alter the SPEC file for timescale, changing

Requires: postgresql12 >= 12
Requires: postgresql12-server >= 12

to

Requires: postgresql >= 12
Requires: postgresql-server >= 12

This will still work with the RPMs as provided by postgres in their PGDG repos, but will also enable using the version of Postgresql provided in RHEL/CentOS 8 through appstream.

I'd happily test this for both approaches and do a PR, but the .spec file for the RPM packege is not in the repository.

On a sidenote: the RPMs are advertised as signed, while they actually are not.

mennowo commented 3 years ago

Any hope for a resolution for this issue? It should be an easy fix an will help ease deployment of timescale in RHEL environments, cause RedHat provides support on postges as long as it is deployed via appstream.

svenklemm commented 3 years ago

Unfortunately your suggested solution would break when system postgres is disabled.

https://serverfault.com/questions/411444/rpm-set-required-somepackage-0-5-0-and-somepackage-0-6-0

mennowo commented 3 years ago

Thanks for looking in to this. We looked a bit further and were able to find and fix the issue. It actually lies with the PGDG packages, which ignore version constraints.

Requires: postgresql-server >= 12, postgresql-server < 13

actually works. All RHEL8/AppStream postgresql versions respect this (tested on all versions). However, not all PGDG versions respect this:

Solution

Requires:       postgresql-server >= 12, postgresql-server < 13
Requires:       postgresql >= 12, postgresql < 13
Requires:       pkgconfig(libpq) >= 12
Conflicts:      postgresql96-server, postgresql10-server, postgresql11-server
Conflicts:      postgresql13-server, postgresql14-server, postgresql15-server
Conflicts:      postgresql96, postgresql10, postgresql11
Conflicts:      postgresql13, postgresql14, postgresql15

This is compatible for RHEL8/AppStream and PGDG repos as well. I hope this makes it possible to switch to AppStream PostgreSQL soon.

Notes

Setup for PGDG

dnf module -y disable postgresql
dnf install timescaledb-postgresql-12
postgresql-12-setup initdb
sudo -u postgres timescaledb-tune -pg-config /usr/pgsql-12/bin/pg_config # -yes
systemctl start  postgresql12.service
systemctl enable postgresql12.service

Setup for AppStream

dnf module -y reset postgresql; dnf module -y enable postgresql:12
dnf install timescaledb-postgresql-12-NEW
postgresql-setup --initdb
sudo -u postgres timescaledb-tune -conf-path /var/lib/pgsql/data
systemctl start  postgresql.service
systemctl enable postgresql.service

Setup for AppStream using same datadir as PGDG multiple solutions ready including migration plan

Background

I created a postgresql12-appstream meta-package and tested any possible Requires & Conflicts constraints (many rpmbuild actions). Results for all RHEL8/AppStream postgresql versions using extreme tests/variants are OK. However, the (external) PGDG packages ignore version constraints. Conclusion: cause is incorrect version constraints in the PGDG packages (see below).

# rpm -q --provides postgresql10-server
config(postgresql10-server) = 10.10-1PGDG.rhel8
postgresql-server
postgresql10-server = 10.10-1PGDG.rhel8
postgresql10-server(x86-64) = 10.10-1PGDG.rhel8

Problem here is, any version of postgresql-server will match

# rpm -q --provides postgresql11-server
config(postgresql11-server) = 11.11-1PGDG.rhel8
postgresql-server >= 11.11-1PGDG.rhel8
postgresql11-server = 11.11-1PGDG.rhel8
postgresql11-server(x86-64) = 11.11-1PGDG.rhel8

Problem here is, any version >= 11 of postgresql-server will match (12 too!); even stranger, Requires: postgresql-server < 11 matches too(!) for some reason

# rpm -q --provides postgresql12-server
config(postgresql12-server) = 12.6-1PGDG.rhel8
postgresql-server >= 12.6-1PGDG.rhel8
postgresql12-server = 12.6-1PGDG.rhel8
postgresql12-server(x86-64) = 12.6-1PGDG.rhel8

Problem here is, any version >= 12 of postgresql-server will match (13 too!); but not stranger here, Requires: postgresql-server < 12 will not match (which is OK)

Side note

I noticed timescaledb-postgresql-12 leaves files around not owned by any package:

/usr/lib64/timescaledb-loader-pg12
/usr/lib64/timescaledb-pg12
/usr/lib64/pgsql/timescaledb-1.7.5.so
/usr/lib64/pgsql/timescaledb-tsl-1.7.5.so
/usr/lib64/pgsql/timescaledb.so
/usr/share/pgsql/extension/timescaledb* (47 files here)

Maybe nice to make those files really part of the package ...

And last but not least, we would appreciate GPG-signed packages.

mennowo commented 3 years ago

Any chance for a follow-up on this one? The provided solution should work as-is.

svenklemm commented 3 years ago

Hmm those conflict lines will prevent the installation of multiple major postgres versions, i guess you cant do that with the system package but you certainly can with the packages from the PGDG repo.

mennowo commented 3 years ago

You can leave out any 'Conflicts:' statements as you see fit; the approach will still be an easy way to allow Timescale to work with both Appstream and PGDG on CentOS/RHEL. Would be great to have this!

demianph commented 3 years ago

RHEL 8.4 appstream modules includes postrgresql versions through 13.3, Any chance we can get timescale to work with it? Running into some kind of issue where the PGDG repo just times out (possible corporate security).

aliensmily commented 2 years ago

We are installing postgresql from RHEL8 appstream too, Would be nice to have the possibility to install TimescaleDB from a repository...

lumarel commented 1 year ago

As this topic looks like it has started sleeping, is there any progress to support the RHEL provided (and especially supported) PostgreSQL packages?

bhill0 commented 9 months ago

Just to add to this: I have run into the same with RHEL 9.3 provided PostgreSQL as well:

rpm -qa | grep postgres
postgresql-private-libs-13.13-1.el9_3.x86_64
postgresql-13.13-1.el9_3.x86_64
postgresql-server-13.13-1.el9_3.x86_64
dnf install -y timescaledb-2-postgresql-13
....
Error: 
 Problem: cannot install the best candidate for the job
  - nothing provides postgresql13 >= 13.4 needed by timescaledb-2-postgresql-13-2.13.1-0.el9.x86_64 from timescale_timescaledb
  - nothing provides postgresql13-server >= 13.4 needed by timescaledb-2-postgresql-13-2.13.1-0.el9.x86_64 from timescale_timescaledb
YBUSherb commented 6 months ago

Would also appreciate if timescaledb would be usable with RHEL8 or RHEL9 postgresql appstream