Project

General

Profile

Actions

Bug #6403

closed

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

Added by emb3dd3d server about 9 years ago. Updated almost 5 years ago.

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

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 2 (0 open2 closed)

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 8 (0 open8 closed)

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

Updated by François ARMAND about 9 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.

Actions #2

Updated by Vincent MEMBRÉ about 9 years ago

  • Target version changed from 2.10.12 to 2.10.13
Actions #3

Updated by Nicolas CHARLES about 9 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

Actions #4

Updated by Vincent MEMBRÉ about 9 years ago

  • Target version changed from 2.10.13 to 2.10.14
Actions #5

Updated by Vincent MEMBRÉ almost 9 years ago

  • Target version changed from 2.10.14 to 2.10.15
Actions #6

Updated by Matthieu CERDA almost 9 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")

Actions #7

Updated by Alexis Mousset almost 9 years ago

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

Updated by Vincent MEMBRÉ almost 9 years ago

  • Target version changed from 2.10.15 to 2.10.16
Actions #9

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.10.16 to 2.10.17
Actions #10

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.10.17 to 2.10.18
Actions #11

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.10.18 to 2.10.19
Actions #12

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.10.19 to 2.10.20
Actions #13

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.10.20 to 277
Actions #14

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 277 to 2.11.18
Actions #15

Updated by Vincent MEMBRÉ over 8 years ago

  • Target version changed from 2.11.18 to 2.11.19
Actions #16

Updated by Vincent MEMBRÉ about 8 years ago

  • Target version changed from 2.11.19 to 2.11.20
Actions #17

Updated by Vincent MEMBRÉ about 8 years ago

  • Target version changed from 2.11.20 to 2.11.21
Actions #18

Updated by Vincent MEMBRÉ almost 8 years ago

  • Target version changed from 2.11.21 to 2.11.22
Actions #19

Updated by Vincent MEMBRÉ almost 8 years ago

  • Target version changed from 2.11.22 to 2.11.23
Actions #20

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 2.11.23 to 2.11.24
Actions #21

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 2.11.24 to 308
Actions #22

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 308 to 3.1.14
Actions #23

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.14 to 3.1.15
Actions #24

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.15 to 3.1.16
Actions #25

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.16 to 3.1.17
Actions #26

Updated by Benoît PECCATTE over 7 years ago

  • Assignee deleted (Matthieu CERDA)
Actions #27

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 3.1.17 to 3.1.18
Actions #28

Updated by Vincent MEMBRÉ about 7 years ago

  • Target version changed from 3.1.18 to 3.1.19
Actions #29

Updated by Jonathan CLARKE about 7 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
Actions #30

Updated by Benoît PECCATTE about 7 years ago

  • Priority set to 41
Actions #31

Updated by Vincent MEMBRÉ about 7 years ago

  • Target version changed from 3.1.19 to 3.1.20
Actions #32

Updated by Vincent MEMBRÉ almost 7 years ago

  • Target version changed from 3.1.20 to 3.1.21
Actions #33

Updated by Vincent MEMBRÉ almost 7 years ago

  • Target version changed from 3.1.21 to 3.1.22
Actions #34

Updated by Benoît PECCATTE almost 7 years ago

  • Priority changed from 41 to 54
Actions #35

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 3.1.22 to 3.1.23
Actions #36

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 3.1.23 to 3.1.24
Actions #37

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 3.1.24 to 3.1.25
Actions #38

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 3.1.25 to 387
Actions #39

Updated by Vincent MEMBRÉ over 6 years ago

  • Target version changed from 387 to 4.1.10
Actions #40

Updated by Vincent MEMBRÉ about 6 years ago

  • Target version changed from 4.1.10 to 4.1.11
Actions #41

Updated by Vincent MEMBRÉ about 6 years ago

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

Updated by Vincent MEMBRÉ almost 6 years ago

  • Target version changed from 4.1.12 to 4.1.13
Actions #43

Updated by Vincent MEMBRÉ almost 6 years ago

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

Updated by Benoît PECCATTE over 5 years ago

  • Target version changed from 4.1.14 to 4.1.15
Actions #45

Updated by Vincent MEMBRÉ over 5 years ago

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

Updated by Vincent MEMBRÉ over 5 years ago

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

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 4.1.17 to 4.1.18
Actions #48

Updated by Vincent MEMBRÉ over 5 years ago

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

Updated by François ARMAND over 5 years ago

  • Assignee set to Nicolas CHARLES
Actions #50

Updated by Alexis Mousset about 5 years ago

  • Target version changed from 4.1.19 to 4.1.20
Actions #51

Updated by Nicolas CHARLES about 5 years ago

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

Updated by Nicolas CHARLES about 5 years 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

Actions #53

Updated by Nicolas CHARLES about 5 years ago

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

Updated by Nicolas CHARLES about 5 years ago

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

Updated by François ARMAND about 5 years ago

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

Updated by Vincent MEMBRÉ about 5 years ago

  • Target version changed from 4.1.21 to 4.1.22
Actions #57

Updated by Nicolas CHARLES about 5 years 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 

Actions #58

Updated by Nicolas CHARLES about 5 years 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

Actions #59

Updated by Nicolas CHARLES about 5 years 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

Actions #60

Updated by Nicolas CHARLES about 5 years ago

  • Status changed from New to In progress
Actions #61

Updated by Nicolas CHARLES about 5 years 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
Actions #62

Updated by Rudder Quality Assistant about 5 years ago

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

Updated by Nicolas CHARLES about 5 years ago

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

Updated by Nicolas CHARLES about 5 years ago

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

Updated by Nicolas CHARLES almost 5 years ago

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

Updated by Vincent MEMBRÉ almost 5 years ago

  • Priority changed from 60 to 61

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

Actions #67

Updated by Vincent MEMBRÉ almost 5 years ago

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

Updated by Vincent MEMBRÉ almost 5 years ago

  • Status changed from Pending release to Released
Actions

Also available in: Atom PDF