Project

General

Profile

Bug #6403

Postgresql misconfigured when not the default distrib package (ex: Centos 6 with Postgresql 9.3 from pgfoundry.org)

Added by emb3dd3d server over 4 years ago. Updated 4 months ago.

Status:
Released
Priority:
3
Category:
System integration
Target version:
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
User visibility:
Infrequent - complex configurations | third party integrations
Effort required:
Priority:
61

Description

Just fyi...

I was attempting to install rudder-reports to Centos 6x with Postgresql 9.3 from the pgdg repository http://svn.pgrpms.org/browser/rpm/redhat/9.3/pgdg-yum/CTOS-6/pgdg-93-centos.repo . I was met with the issue of not finding the /var/lib/pgsql/data/pg_hba.conf file or /etc/init.d/postgresql. After scratching my head a little I created a symlink from /var/lib/pgsql/9.3/data/pg_hba.conf to the expected path in order to complete the installation as well as a symlink from /etc/init.d/postgresql-9.3 to /etc/init.d/postgresql. I also had to manually configure my pg_hba.conf to change to md5 for local and localhost, create user db rudder with owner rudder and run the schema import from /opt/rudder/etc/postgresql/reportsSchema.sql . I am sure there will be some more issues going forward, just wanted to let someone be aware if they run across this same thing to look for this. Thanks with help from ncharles on irc for assisting with this.


Subtasks

Bug #14742: System technique don't support PostgreSQL from other source than the distributionReleasedBenoît PECCATTEActions
Bug #14846: Error message in logs during install on postgresql detection ReleasedNicolas CHARLESActions

Related issues

Related to Rudder - Bug #6412: Technique uses /root as an hardcoded value for the home of user rootReleasedActions
Related to Rudder - Bug #6686: Error while installing rudder-reports on centos 7Rejected2015-06-01Actions
Related to Rudder - Bug #7395: After a fresh install on Centos, the Rudder server web interface does not workReleased2015-11-13Actions
Related to Rudder - Bug #6546: rudder-reports package should use the correct PostgreSQL serviceReleased2015-04-29Actions
Related to Rudder - Bug #14296: System technique try to edit pg_hba file only on SUSE, but packaging takes care of this partReleasedActions
Related to Rudder - Bug #14827: Error when upgrading to Rudder 5.0.10 using centos7 with custom postgresqlReleasedActions
Related to Rudder - Bug #14744: Postgresql misconfigured when not the default distrib package (ex: Centos 6 with Postgresql 9.3 from pgfoundry.org)ReleasedActions
Has duplicate Rudder - Bug #14106: Use postgresql-setup initdb in postgresql setupRejectedActions

Associated revisions

Revision b97da489 (diff)
Added by Nicolas CHARLES 7 months ago

Fixes #6403: Postgresql misconfigured when not the default distrib package (ex: Centos 6 with Postgresql 9.3 from pgfoundry.org)

History

#1

Updated by François ARMAND over 4 years ago

  • Subject changed from Postgresql difficulty on Centos 6 with Postgresql 9.3 from pgfoundry.org to Postgresql misconfigured when not the default distrib package (ex: Centos 6 with Postgresql 9.3 from pgfoundry.org)
  • Category set to System integration
  • Assignee set to Nicolas CHARLES
  • Priority changed from N/A to 3
  • Target version changed from Ideas (not version specific) to 2.10.12

Thanks for reporting.

Nico, could you tell us a little more on that one. For now, I can sum-up the list of problems and workarounds as:
  • 1/ missing expected starting script (=> symlink provided one to /etc/init.d/postgresql)
  • 2/ missing expected authz file (=> symlink provided one to /var/lib/pgsql/data/pg_hba.conf)
  • 3/ initialisation not done (=> do it again, by hand)

Do you see other problems ?

For #3, there must be a easier way than playing things by hand, like running again post-installation script of the package. Do you know (or perhaps Matthieu ?) how to do that with rpm/deb ?

It seems that the first easy step for that one is to document what are the requirement for non standard pg installation (perhaps just the two symlinks ?), and how to get of the mud if needed.

#2

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 2.10.12 to 2.10.13
#3

Updated by Nicolas CHARLES over 4 years ago

  • Assignee changed from Nicolas CHARLES to Matthieu CERDA

Paths of postgres are hardcoded in Rudder, which is a real problem (see also #6412).
The issue is if the install of postgres does not use "standart" paths, Rudder is lost, and can't properly manage database and give access

For 3/ the solution may be to rerun the rudder-init; for the first 2, i'm not sure symlink is the right solution (it is quite dirty), but rather to detect the correct paths of installation

Matthieu may know how to detet the proper path of postgres installation

#4

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 2.10.13 to 2.10.14
#5

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 2.10.14 to 2.10.15
#6

Updated by Matthieu CERDA over 4 years ago

Hmmmm...

The problem is, there is no standard installation path, only possible candidates on each type of OSes, that may or may not match the currently used one (eg. if the user uses home made packages storing things in /var/lib/my-postgres-9/ so it does not conflict with system packages).

For me, the problem is not that we do not cover every possible case, it is more that we do not give the possibility to do something else (we assume defaults but do not give easily the option to the user to do something else.)

For the ACL configuration, we could try to configure automatically, and just skip and output a helpful message explaining how to do it manually if we can't.

For the postgresql service name, it is an entirely other problem, as there is also no easy way to guess the name used. We can only try to detect it, that's what I did on the Rudder 3.1 init script (get all service candidates matching "postgresql", and use the last one, like "postgresql91")

#7

Updated by Alexis MOUSSET over 4 years ago

  • Related to Bug #6686: Error while installing rudder-reports on centos 7 added
#8

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 2.10.15 to 2.10.16
#9

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 2.10.16 to 2.10.17
#10

Updated by Vincent MEMBRÉ about 4 years ago

  • Target version changed from 2.10.17 to 2.10.18
#11

Updated by Vincent MEMBRÉ about 4 years ago

  • Target version changed from 2.10.18 to 2.10.19
#12

Updated by Vincent MEMBRÉ about 4 years ago

  • Target version changed from 2.10.19 to 2.10.20
#13

Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 2.10.20 to 277
#14

Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 277 to 2.11.18
#15

Updated by Vincent MEMBRÉ almost 4 years ago

  • Target version changed from 2.11.18 to 2.11.19
#16

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.11.19 to 2.11.20
#17

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.11.20 to 2.11.21
#18

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.11.21 to 2.11.22
#19

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.11.22 to 2.11.23
#20

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 2.11.23 to 2.11.24
#21

Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 2.11.24 to 308
#22

Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 308 to 3.1.14
#23

Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 3.1.14 to 3.1.15
#24

Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 3.1.15 to 3.1.16
#25

Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 3.1.16 to 3.1.17
#26

Updated by Benoît PECCATTE about 3 years ago

  • Assignee deleted (Matthieu CERDA)
#27

Updated by Vincent MEMBRÉ almost 3 years ago

  • Target version changed from 3.1.17 to 3.1.18
#28

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 3.1.18 to 3.1.19
#29

Updated by Jonathan CLARKE over 2 years ago

  • Severity set to Critical - prevents main use of Rudder | no workaround | data loss | security
  • User visibility set to Infrequent - complex configurations | third party integrations
#30

Updated by Benoît PECCATTE over 2 years ago

  • Priority set to 41
#31

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 3.1.19 to 3.1.20
#32

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 3.1.20 to 3.1.21
#33

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 3.1.21 to 3.1.22
#34

Updated by Benoît PECCATTE over 2 years ago

  • Priority changed from 41 to 54
#35

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 3.1.22 to 3.1.23
#36

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 3.1.23 to 3.1.24
#37

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 3.1.24 to 3.1.25
#38

Updated by Vincent MEMBRÉ almost 2 years ago

  • Target version changed from 3.1.25 to 387
#39

Updated by Vincent MEMBRÉ almost 2 years ago

  • Target version changed from 387 to 4.1.10
#40

Updated by Vincent MEMBRÉ over 1 year ago

  • Target version changed from 4.1.10 to 4.1.11
#41

Updated by Vincent MEMBRÉ over 1 year ago

  • Target version changed from 4.1.11 to 4.1.12
  • Priority changed from 54 to 55
#42

Updated by Vincent MEMBRÉ over 1 year ago

  • Target version changed from 4.1.12 to 4.1.13
#43

Updated by Vincent MEMBRÉ over 1 year ago

  • Target version changed from 4.1.13 to 4.1.14
  • Priority changed from 55 to 56
#44

Updated by Benoît PECCATTE over 1 year ago

  • Target version changed from 4.1.14 to 4.1.15
#45

Updated by Vincent MEMBRÉ about 1 year ago

  • Target version changed from 4.1.15 to 4.1.16
  • Priority changed from 56 to 57
#46

Updated by Vincent MEMBRÉ about 1 year ago

  • Target version changed from 4.1.16 to 4.1.17
  • Priority changed from 57 to 58
#47

Updated by Vincent MEMBRÉ 12 months ago

  • Target version changed from 4.1.17 to 4.1.18
#48

Updated by Vincent MEMBRÉ 10 months ago

  • Target version changed from 4.1.18 to 4.1.19
  • Priority changed from 58 to 59
#49

Updated by François ARMAND 10 months ago

  • Assignee set to Nicolas CHARLES
#50

Updated by Alexis MOUSSET 10 months ago

  • Target version changed from 4.1.19 to 4.1.20
#51

Updated by Nicolas CHARLES 9 months ago

  • Related to Bug #7395: After a fresh install on Centos, the Rudder server web interface does not work added
#52

Updated by Nicolas CHARLES 9 months ago

We introduced correct detection of pg_hba file in #7395 (for rpm only, as debian defaults seem sane enough), and we detect corectly the postgres service name as of #6546

#53

Updated by Nicolas CHARLES 9 months ago

  • Related to Bug #6546: rudder-reports package should use the correct PostgreSQL service added
#54

Updated by Nicolas CHARLES 9 months ago

  • Related to Bug #14296: System technique try to edit pg_hba file only on SUSE, but packaging takes care of this part added
#55

Updated by François ARMAND 9 months ago

  • Target version changed from 4.1.20 to 4.1.21
  • Priority changed from 59 to 60
#56

Updated by Vincent MEMBRÉ 7 months ago

  • Target version changed from 4.1.21 to 4.1.22
#57

Updated by Nicolas CHARLES 7 months ago

I tried to use Postgresql 11 with Rudder 5.0.9
At install I got the following error

  Installation : 1398866025:rudder-reports-5.0.9.release-1.EL.7.noarch                                                                                                                    12/36 
Unit postgresql.service could not be found.
INFO: Initializing PostgreSQL ...The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
 Done
Failed to start postgresql.service: Unit not found.
psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Postgresql failed to start! Halting
warning: %post(rudder-reports-1398866025:5.0.9.release-1.EL.7.noarch) scriptlet failed, exit status 1
Non-fatal POSTIN scriptlet failure in rpm package 1398866025:rudder-reports-5.0.9.release-1.EL.7.noarch
  Mise à jour  : openldap-2.4.44-21.el7_6.x86_64                                                                                                                                          13/36 
  Installation : openldap-clients-2.4.44-21.el7_6.x86_64                                                                                                                                  14/36 
  Installation : perl-Digest-1.17-245.el7.noarch                                                                                                                                          15/36 

#58

Updated by Nicolas CHARLES 7 months ago

indeed, service name is postgresql-11, which isn't find by

systemctl list-unit-files --type service | awk -F'.' '{print $1}' | grep -E "^postgresql[0-9]*$" 

then the following command fails

service ${POSTGRESQL_SERVICE_NAME} initdb
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

when using package from distrib

doc https://www.postgresql.org/download/linux/redhat/ says that
RHEL 5,6 should do

   service postgresql initdb
   chkconfig postgresql on

rhel7 should do

  postgresql-setup initdb
  systemctl enable postgresql.service
  systemctl start postgresql.service

when using package downloaded from postgresql repo

same as when using from distro, except we need full path from postgresql-setup

/usr/pgsql-9.6/bin/postgresql96-setup initdb
systemctl enable postgresql-9.6
systemctl start postgresql-9.6

/usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl enable postgresql-10
systemctl start postgresql-10

/usr/pgsql-11/bin/postgresql-11-setup initdb
systemctl enable postgresql-11
systemctl start postgresql-11

Note the extra *-* for 10 and after

#59

Updated by Nicolas CHARLES 7 months ago

  • Target version changed from 4.1.22 to 5.0.10

to get the proper postgresql setup, we can run

ls -1  /usr/pgsql-*/bin/postgresql*-setup | sort -V | tail -1

and if not there, failback to postgresql-setup

#60

Updated by Nicolas CHARLES 7 months ago

  • Status changed from New to In progress
#61

Updated by Nicolas CHARLES 7 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Nicolas CHARLES to Benoît PECCATTE
  • Pull Request set to https://github.com/Normation/rudder-packages/pull/1873
#62

Updated by Rudder Quality Assistant 7 months ago

  • Assignee changed from Benoît PECCATTE to Nicolas CHARLES
#63

Updated by Nicolas CHARLES 7 months ago

  • Status changed from Pending technical review to Pending release
#64

Updated by Nicolas CHARLES 7 months ago

  • Has duplicate Bug #14106: Use postgresql-setup initdb in postgresql setup added
#65

Updated by Nicolas CHARLES 6 months ago

  • Related to Bug #14827: Error when upgrading to Rudder 5.0.10 using centos7 with custom postgresql added
#66

Updated by Vincent MEMBRÉ 6 months ago

  • Priority changed from 60 to 61

This bug has been fixed in Rudder 5.0.10 which was released today.

#67

Updated by Vincent MEMBRÉ 4 months ago

  • Related to Bug #14744: Postgresql misconfigured when not the default distrib package (ex: Centos 6 with Postgresql 9.3 from pgfoundry.org) added
#68

Updated by Vincent MEMBRÉ 4 months ago

  • Status changed from Pending release to Released

Also available in: Atom PDF