Bug 44393 - univention-self-service-master: No such package
univention-self-service-master: No such package
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: System setup
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2-3-errata
Assigned To: Florian Best
Felix Botner
:
: 44419 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-18 12:50 CEST by Florian Best
Modified: 2017-12-06 15:40 CET (History)
3 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?: 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.103
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Ticket number: 2017040321000372, 2017043021000151, 2017050121000356, 2017051721000326, 2017082521000314
Bug group (optional): External feedback
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 2017-04-18 12:50:02 CEST
Version: 4.2-0 errata0 (Lesum)
Remark: Normal install, joining to existing Active Directory domain.

Configuring software components: univention-self-service-master: No such package
Comment 1 Erik Damrose univentionstaff 2017-04-18 12:56:13 CEST
NEEDMOREINFO: Which installation medium was used (DVD, appliance, AWS instance)?
Comment 2 Florian Best univentionstaff 2017-04-18 12:56:46 CEST
I don't know. She didn't say.
Comment 3 Florian Best univentionstaff 2017-04-18 13:31:29 CEST
Duplicate of Bug #44284 ?
Comment 4 Erik Damrose univentionstaff 2017-04-18 13:36:32 CEST
(In reply to Florian Best from comment #3)
> Duplicate of Bug #44284 ?

It could be, but there may be another issue. To be a duplicate, the installation had to be done by an appliance the user created herself - thus the inquiry for the installation medium. Our appliances and AWS instances received separate fixes.
Comment 5 Jens Thorp-Hansen univentionstaff 2017-04-20 09:02:04 CEST
I got this error yesterday while creating a 4.2 instance via "ucs-kt-get" on spoka. I wanted to install S4 and Self Service right at the installation and had to uncheck Self Service eventually because of the error.

Afterwards, the Self Service UMC module was installed but not the server. I was able to "re"install the Self Service via the app-center. After that everything worked fine AFAIS.

machine: 10.200.6.150
Comment 6 Erik Damrose univentionstaff 2017-04-20 09:25:41 CEST
@comment 5: That instance was not set up with the fix from bug 44284, so the error is expected.
Comment 7 Daniel Tröder univentionstaff 2017-04-20 13:00:59 CEST
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.

Closing this bug, as it's fixed with Bug #44284.
Cloning a new one for the setup problem.
Comment 8 Florian Best univentionstaff 2017-05-05 15:22:06 CEST
4.2-0 errata0 (Lesum)
Comment 9 Florian Best univentionstaff 2017-05-05 15:29:45 CEST
Version: 4.2-0 errata0 (Lesum)
Comment 10 Florian Best univentionstaff 2017-05-17 16:14:33 CEST
Version: 4.2-0 errata15 (Lesum)

Remark: Konfiguration eines DC Masters im Appliance Mode mit Auswahl des Self Service, basierend auf unserer internen Test-Appliance (ucs-kt-get auf krus)

→ Please at least fix our test instance if it is no product error.
Comment 11 Florian Best univentionstaff 2017-08-29 14:09:35 CEST
Version: 4.2-1 errata144 (Lesum)

Remark: Self-Service bei der Installation ausgewaehlt, im Folgenden trat dieser Fehler auf.
Comment 12 Florian Best univentionstaff 2017-11-27 20:24:45 CET
(In reply to Daniel Tröder from comment #7)
> 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.

1. What happens if postgres is down during the postinst? I think one of the commands causes an error. After another package upgrade -z "$2" will not fit anymore and the DB creation is never called again.

2. Why are these commands not part of the joinscript? Can't we move them to the joinscript?
Comment 13 Daniel Tröder univentionstaff 2017-11-28 08:09:35 CET
(In reply to Florian Best from comment #12)
> 2. Why are these commands not part of the joinscript? Can't we move them to
> the joinscript?
Yes - absolutely.
In the join script for the ucs-school-import-http-api is the code to handle for setting up a postgresql user, that can be called repeatedly.
Comment 14 Florian Best univentionstaff 2017-11-29 13:46:33 CET
(In reply to Florian Best from comment #12)
> (In reply to Daniel Tröder from comment #7)
> > 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.
> 
> 1. What happens if postgres is down during the postinst? I think one of the
> commands causes an error. After another package upgrade -z "$2" will not fit
> anymore and the DB creation is never called again.
The error is the following:
The package univention-self-service-master depends on univention-postgresql, but the other self-service packages don't. unfortunately univention-self-service-master is only installed by the appcenter. If you install univention-self-service univention-self-service-umc-passwordreset manually then no postgresql is installed and the database creation of course fails.
Comment 15 Daniel Tröder univentionstaff 2017-11-29 14:03:46 CET
(In reply to Florian Best from comment #14)
> The error is the following:
> The package univention-self-service-master depends on univention-postgresql,
> but the other self-service packages don't. unfortunately
> univention-self-service-master is only installed by the appcenter. If you
> install univention-self-service univention-self-service-umc-passwordreset
> manually then no postgresql is installed and the database creation of course
> fails.
Ah well - that's IMHO a user error. There is an App that should be installed.
The only thing I can think of to do against that is to print a big fat warning in univention-self-service.postinst if server/role==dc_master.
(And still move the pgsql code from postinst to join script.)
Comment 16 Florian Best univentionstaff 2017-11-29 14:16:17 CET
OK. the code has been moved from postinst to the joinscript.

univention-self-service.yaml
43e1f9770c09 | YAML Bug #44393

univention-self-service (2.0.16-10)
64e03f1cc15c | Bug #44393: move database creation into the joinscript
Comment 17 Florian Best univentionstaff 2017-11-29 14:50:17 CET
univention-self-service (2.0.16-11)
b10bd6b02fd1 | Bug #44393: don't check if any joinscript version was executed prior
Comment 18 Florian Best univentionstaff 2017-11-30 10:58:00 CET
*** Bug 44419 has been marked as a duplicate of this bug. ***
Comment 19 Felix Botner univentionstaff 2017-11-30 11:59:51 CET
OK - univention-self-service
OK - YAML
Comment 20 Arvid Requate univentionstaff 2017-12-06 15:40:16 CET
<http://errata.software-univention.de/ucs/4.2/237.html>