Bug 50410 - univention-pkgdb initialization during system-setup fails sometime in AppCenter tests
univention-pkgdb initialization during system-setup fails sometime in AppCent...
Status: NEW
Product: UCS
Classification: Unclassified
Component: App Center
UCS 4.4
Other Linux
: P5 normal with 1 vote (vote)
: ---
Assigned To: App Center maintainers
App Center maintainers
:
Depends on: 50441
Blocks:
  Show dependency treegraph
 
Reported: 2019-10-24 13:16 CEST by Felix Botner
Modified: 2020-03-09 11:32 CET (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.069
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 Felix Botner univentionstaff 2019-10-24 13:16:11 CEST
system setup package installation:

etting up univention-pkgdb (12.0.1-1A~4.4.0.201812211058) ...
File: /etc/cron.d/univention-pkgdb-check
Multifile: /etc/postgresql/9.6/main/pg_hba.conf
File: /etc/logrotate.d/univention-pkgdb
Create pgsql/pkgdb/networks
Create pkgdb/scan
File: /etc/apt/apt.conf.d/61invoke
Multifile: /etc/postgresql/9.6/main/pg_hba.conf
psql: konnte nicht mit dem Server verbinden: Datei oder Verzeichnis nicht gefunden
	Läuft der Server lokal und akzeptiert er Verbindungen
	auf dem Unix-Domain-Socket »/var/run/postgresql/.s.PGSQL.5432«?

system setup join:
[master100] 2019-10-24T11:18:04.270884	24.10.19 11:18:04.276  LISTENER    ( WARN    ) : initializing module pkgdb
[master100] 2019-10-24T11:18:04.406434	Traceback (most recent call last):
[master100] 2019-10-24T11:18:04.406692	File "/usr/sbin/univention-pkgdb-scan", line 37, in <module>
[master100] 2019-10-24T11:18:04.406937	univention.pkgdb.main()
[master100] 2019-10-24T11:18:04.407234	File "/usr/lib/pymodules/python2.7/univention/pkgdb.py", line 576, in main
[master100] 2019-10-24T11:18:04.407464	connection = open_database_connection(config_registry, pkgdbu=True)
[master100] 2019-10-24T11:18:04.407657	File "/usr/lib/pymodules/python2.7/univention/pkgdb.py", line 554, in open_database_connection
[master100] 2019-10-24T11:18:04.408144	connection_info['password'] = open(password_file, 'rb').read().rstrip('n')
[master100] 2019-10-24T11:18:04.408390	IOError: [Errno 2] No such file or directory: '/etc/postgresql/pkgdb.secret'

after that, the join script fails too

[master100] 2019-10-24T11:19:33.653499	Configure 50univention-pkgdb.inst Thu Oct 24 11:19:33 CEST 2019
[master100] 2019-10-24T11:19:33.657361	2019-10-24 11:19:33.665203572+02:00 (in joinscript_init)
[master100] 2019-10-24T11:19:34.504092	Adding SRV record "pkgdb tcp 0 0 5432 master100.autotest100.local." to zone autotest100.local...
[master100] 2019-10-24T11:19:34.504092	done
[master100] 2019-10-24T11:20:35.109597	Traceback (most recent call last):
[master100] 2019-10-24T11:20:35.110214	File "/usr/sbin/univention-pkgdb-scan", line 37, in <module>
[master100] 2019-10-24T11:20:35.110214	univention.pkgdb.main()
[master100] 2019-10-24T11:20:35.110214	File "/usr/lib/pymodules/python2.7/univention/pkgdb.py", line 576, in main
[master100] 2019-10-24T11:20:35.110214	connection = open_database_connection(config_registry, pkgdbu=True)
[master100] 2019-10-24T11:20:35.110425	File "/usr/lib/pymodules/python2.7/univention/pkgdb.py", line 554, in open_database_connection
[master100] 2019-10-24T11:20:35.110732	connection_info['password'] = open(password_file, 'rb').read().rstrip('n')
[master100] 2019-10-24T11:20:35.111028	IOError: [Errno 2] No such file or directory: '/etc/postgresql/pkgdb.secret'
[master100] 2019-10-24T11:20:35.135371	__MSG__:Configure 79univention-printserver
[master100] 2019-10-24T11:20:35.135371	__STEP__:49

and we end up with an unconfigured system
Comment 1 Felix Botner univentionstaff 2019-10-24 13:19:35 CEST
removed univention-pkgdb from autotest-100-app-master-no-samba.cfg

once this is fixed, please re-add univention-pkgdb to autotest-100-app-master-no-samba.cfg
Comment 2 Felix Botner univentionstaff 2019-10-28 09:51:31 CET
(In reply to Felix Botner from comment #1)
> removed univention-pkgdb from autotest-100-app-master-no-samba.cfg
> 
> once this is fixed, please re-add univention-pkgdb to
> autotest-100-app-master-no-samba.cfg

also removed from autotest-120-appupdate-master-no-samba.cfg
Comment 3 Felix Botner univentionstaff 2019-11-05 10:44:31 CET
also from autotest-101-app-master-s4.cfg
Comment 5 Jürn Brodersen univentionstaff 2019-12-06 10:52:06 CET
This is caused in part by bug 50441.

Until "univention-system-setup-boot.service" had not failed due to a timeout, the service is considered starting. But this service is part of the "multi-user.target" which means the target isn't reached until the timeout marks the service as failed.

The postgresql-9.6.postinst does create a cluster and starts it with "invoke-rc.d". "invoke-rc.d" adds "--job-mode=ignore-dependencies" than starting a service before reaching the "multi-user.target". The actual postgres cluster is a dependency for the "postgres.service" and therefore isn't started because the multi-user.target isn't reached.

How to reproduce:
Start one of our appliance images and immediately install postgres-9.6
-> the postgres cluster isn't started
If you stop the "univention-system-setup-boot.service" or wait for the timeout and install postgres-9.6, the postgres cluster gets started.