Bug 44419 - univention-self-service: database setup broken when installed from DVD
univention-self-service: database setup broken when installed from DVD
Status: RESOLVED DUPLICATE of bug 44393
Product: UCS
Classification: Unclassified
Component: System setup
UCS 4.2
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-20 13:06 CEST by Daniel Tröder
Modified: 2018-04-14 13:37 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.206
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2017040321000372
Bug group (optional):
Max CVSS v3 score:


Attachments
setup.log (26.29 KB, application/x-xz)
2017-08-30 16:57 CEST, Sönke Schwardt-Krummrich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2017-04-20 13:06:42 CEST
+++ This bug was initially created as a clone of Bug #44393 +++

I just installed from a 4.2 DVD (/mnt/omar/vmwares/iso-images/ucs/4.2-0/UCS_4.2-0-amd64.iso) and univention-self-service-master was installed. So the fix is on the DVD.

But when using it, I got an exception:

=============================================================================

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/modserver.py", line 178, in _recv
    self.handle(msg)
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/modserver.py", line 178, in _recv
    self.handle(msg)
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/modserver.py", line 290, in handle
    self.__handler.init()
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/passwordreset/__init__.py", line 212, in init
    self.db = TokenDB(MODULE)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/passwordreset/tokendb.py", line 53, in __init__
    self.conn = self.open_db()
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/passwordreset/tokendb.py", line 120, in open_db
    db_name=DB_NAME, db_user=DB_USER, db_pw=password))
  File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: The initialization of the module failed: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/modserver.py", line 178, in _recv
    self.handle(msg)
  File "/usr/lib/pymodules/python2.7/univention/management/console/protocol/modserver.py", line 290, in handle
    self.__handler.init()
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/passwordreset/__init__.py", line 212, in init
    self.db = TokenDB(MODULE)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/passwordreset/tokendb.py", line 53, in __init__
    self.conn = self.open_db()
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/passwordreset/tokendb.py", line 120, in open_db
    db_name=DB_NAME, db_user=DB_USER, db_pw=password))
  File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: FATAL:  Passwort-Authentifizierung für Benutzer »selfservice« fehlgeschlagen
FATAL:  Passwort-Authentifizierung für Benutzer »selfservice« fehlgeschlagen

=============================================================================

The problem is, that the DB creation code in univention-self-service-passwordreset-umc.postinst didn't run:

if [ "$1" = "configure" -a -z "$2" ] ; then
	echo "Fresh installation..."
	su - postgres -c "echo \"CREATE ROLE selfservice WITH LOGIN;\" | psql"
	su - postgres -c "createdb selfservice -E UTF8 -O selfservice -T template0"
fi

So no database was created in PostgreSQL.
The code after that did run however, creating the password file.

I can only assume it has to do with the way system-setup works.
Comment 1 Erik Damrose univentionstaff 2017-04-20 13:37:59 CEST
Please attach the setup.log.

univention-self-service-master only has a 'Depends' on univention-postgresql. There may be a dependency loop, so that postgresql is not correctly configured compared to a later installation of only the self-service app. Maybe a pre-depends will work, but one has to look at the setup.log before a decision
Comment 2 Daniel Tröder univentionstaff 2017-04-20 14:30:24 CEST
I already deleted the VM :/
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2017-08-30 16:46:56 CEST
I had this problem, too.
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2017-08-30 16:57:04 CEST
Created attachment 9157 [details]
setup.log
Comment 5 Florian Best univentionstaff 2017-11-30 10:58:00 CET
Code has been moved from postinst into joinscript in Bug #44393.

*** This bug has been marked as a duplicate of bug 44393 ***