Bug 52790 - pg.InternalError: FATAL: kein pg_hba.conf-Eintrag für Host »10.207.35.149«, Benutzer »master070$«, Datenbank »pkgdb«, SSL an
pg.InternalError: FATAL: kein pg_hba.conf-Eintrag für Host »10.207.35.149«, ...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: pkgdb
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Arvid Requate
Philipp Hahn
:
: 52791 (view as bug list)
Depends on: 51997
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-12 14:57 CET by Florian Best
Modified: 2021-05-25 16:01 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-02-12 14:57:38 CET
During the upgrade to UCS 5.0 the log contains the traceback:

46 times in /var/log/univention/updater.log, /var/log/univention/actualise.log:
https://jenkins.knut.univention.de:8181/job/UCS-5.0/job/UCS-5.0-0/job/AutotestUpgrade/SambaVersion=no-samba,Systemrolle=master/ws/test/updater.log
https://jenkins.knut.univention.de:8181/job/UCS-5.0/job/UCS-5.0-0/job/AutotestUpgrade/SambaVersion=no-samba,Systemrolle=master/ws/test/actualise.log

Traceback (most recent call last):
  File "/usr/sbin/univention-pkgdb-scan", line 37, in <module>
    univention.pkgdb.main()
  File "/usr/lib/python2.7/dist-packages/univention/pkgdb.py", line 582, in main
    connection = open_database_connection(config_registry, pkgdbu=False)
  File "/usr/lib/python2.7/dist-packages/univention/pkgdb.py", line 564, in open_database_connection
    connection = pgdb.connect(database=connectstring)
  File "/usr/lib/python2.7/dist-packages/pgdb.py", line 1619, in connect
    cnx = _connect(dbname, dbhost, dbport, dbopt, dbuser, dbpasswd)
pg.InternalError: FATAL:  kein pg_hba.conf-Eintrag für Host »10.207.35.149«, Benutzer »master070$«, Datenbank »pkgdb«, SSL an
Comment 1 Arvid Requate univentionstaff 2021-03-18 19:15:19 CET
After the update postgresql-9.6 (or postgresql-9.4, if the Admin didn't migrate) are installed,
but postgresql@9.6-main.service ist stopped and postgresql@11-main.service is running,
but the data has not been migrated.

The nasty thing is, that /etc/postgresql/pkgdb.secret gets overwritten during the update,
so even when I start 9.6 again, access to the pkgdb is lost:

systemctl stop postgresql@11-main.service
systemctl start postgresql@9.6-main.service

==========================
root@master10:~# univention-pkgdb-check 
Traceback (most recent call last):
  File "/usr/sbin/univention-pkgdb-scan", line 37, in <module>
    univention.pkgdb.main()
  File "/usr/lib/python2.7/dist-packages/univention/pkgdb.py", line 580, in main
    connection = open_database_connection(config_registry, pkgdbu=True)
  File "/usr/lib/python2.7/dist-packages/univention/pkgdb.py", line 564, in open_database_connection
    connection = pgdb.connect(database=connectstring)
  File "/usr/lib/python2.7/dist-packages/pgdb.py", line 1619, in connect
    cnx = _connect(dbname, dbhost, dbport, dbopt, dbuser, dbpasswd)
pg.InternalError: FATAL:  Passwort-Authentifizierung für Benutzer »pkgdbu« fehlgeschlagen

check the postgres installation, the command 'univention-pkgdb-scan --test-superuser' failed
==========================

So two things:
1. postgresql-11 should not run without migration, we could do that in postup.
2. the pkgdb.secret should either not be overwritten or properly updated in the 9.6 database

I'll further look into where/why the pkgdb.secret gets replaced.
I hope we can fix both issues at that point.
Comment 2 Arvid Requate univentionstaff 2021-03-18 19:15:38 CET
*** Bug 52791 has been marked as a duplicate of this bug. ***
Comment 3 Arvid Requate univentionstaff 2021-03-18 20:58:34 CET
658a9489c2 | Set postgresql11/autostart=no in preup.sh
    if univention-postgresql is installed to avoid conflict with
    postgresql9.6 (or 9.4) before migration of the database content

I've also written a draft for the migration guide,
which reverts the autostart setting, see Bug #51997 Comment 9
Comment 4 Arvid Requate univentionstaff 2021-03-18 21:00:34 CET
Package: univention-updater
Version: 15.0.3-29A~5.0.0.202103182057
Branch: ucs_5.0-0
Comment 5 Philipp Hahn univentionstaff 2021-04-20 15:11:56 CEST
OK: Upgrade 4.4-7 → 4.4-8 → 5.0-0
OK: no changelog, part of the Release upgrade
Comment 6 Florian Best univentionstaff 2021-05-25 16:01:10 CEST
UCS 5.0 has been released:
 https://docs.software-univention.de/release-notes-5.0-0-en.html
 https://docs.software-univention.de/release-notes-5.0-0-de.html

If this error occurs again, please use "Clone This Bug".