Nextcloud join script fails on a fresh install of ucs 5

I installed ucs5 freshly from iso and as first action, i wanted to install nextcloud.
This directly failed with the join script (@55%), giving these errors:

Object exists: SAMLServiceProviderIdentifier=https://server.zoo.box/nextcloud/apps/user_saml/saml/metadata,cn=saml-serviceprovider,cn=univention,dc=zoo,dc=box
Nextcloud is not installed - only a limited number of commands are available
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at “172.17.42.1”, port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections? in /var/www/html/lib/private/DB/Connection.php:140
Stack trace:
#0 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1531): OC\DB\Connection->connect()
#1 /var/www/html/3rdparty/doctrine/dbal/src/Connection.php(1029): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/html/lib/private/DB/Connection.php(262): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/html/lib/private/DB/ConnectionAdapter.php(65): OC\DB\Connection->executeQuery()
#4 /var/www/html/lib/private/legacy/OC_Util.php(743): OC\DB\ConnectionAdapter->executeQuery()
#5 /var/www/html/lib/private/legacy/OC_Util.php(719): OC_Util::checkDatabaseVersion()
#6 /var/www/html/lib/private/Console/Application.php(160): OC_Util::checkServer()
#7 /var/www/html/console.php(99): OC\Console\Application->loadCommands()
#8 /var/www/html/occ(11): require_once(’…’)
#9 {main}

I tried to uninstall and reinstall the nextcloud app, but no sucess.
What went wrong and where to check?

thank you!

Hi,

is the container running?

docker ps -a | grep nextcloud

you get some like this?

4b95testtest59fd docker.software-univention.de/nextcloud:24.0.11-0-ucs1 “/bin/sh -c /usr/sbi…” 2 months ago Up 2 months 0.0.0.0:40000->80/tcp confident_dhawan

If yes please check server and port and if, in your ,case postgress is reachable, please restart:

systemctl status postgresql
nmap -p5432 172.17.42.1
systemctl restart  postgresql

and try occ status inside the container. Just to be sure.

docker exec -it 4b95testtest59fd bash

cd /var/www/html
sudo -u www-data php occ status

I have had a error message like this with a workin nextcloud always after rebooting the system.

kind regards

Hi Sambila,

many thanks for your pointers :slight_smile:

Is docker running?
→ docker.software-univention.de/nextcloud:27.1.5-0 “/bin/sh -c /usr/sbi…” 22 hours ago Up 7 hours 0.0.0.0:40001->80/tcp determined_franklin

systemctl status postgresql:

â—Ź postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Mon 2024-01-29 12:39:56 CET; 6h ago
Process: 1220 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 1220 (code=exited, status=0/SUCCESS)

nmap -p5432 172.17.42.1:
Starting Nmap 7.70 ( https://nmap.org ) at 2024-01-29 19:39 CET
Nmap scan report for 172.17.42.1
Host is up (0.00011s latency).

PORT STATE SERVICE
5432/tcp open postgresql

Nmap done: 1 IP address (1 host up) scanned in 0.39 seconds

sudo -u www-data php occ status:
Nextcloud is not installed - only a limited number of commands are available

  • installed: false
  • version: 27.1.5.1
  • versionstring: 27.1.5
  • edition:
  • maintenance: false
  • needsDbUpgrade: false
  • productname: Nextcloud
  • extendedSupport: false

so it seems to me the install of nextcloud did not finish?
How to complete it?

I can reach the /nextcloud weburl, but also here obviously, i only get the error:

Internal Server Error

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

Technical details

  • Remote Address: 172.17.42.1
  • Request ID: hitkgfH4wDWJ5lSsK2W9

ok, a little step further

→ i bashed into the container and shifted /var/www/html/config/config.php to *.config.php.bak
→ i could then open https://server/nextcloud and got the config wizard of nextcloud
→ i populated the fields with the dbuser and passwd from the config.php.bak contents

now, i can login as admin into nextcloud
still:
→ the join script keeps failing like before
→ the ldap/ucs user accounts do not therefore exist in nextcloud
→ visiting https://server/nextcloud/* keeps redirecting the browser to http

could this be the issue also for the joinscript?

found the “force https” ucr and set this to “yes”

But i’m accessing via https://server-ip/nextcloud - this works
while access via https://server-dns-name/nextcloud - gives an untrusted domain landing page

still, joinscript fails at same point with same error

Sounds better :slight_smile:
The untrusted domain is already documented here:

Please confirm and let’s check than the last step?

Hi Sambila,

making the domain trusted worked just fine!
…but still does not make the join script running…

it fails like in this post with the same message:

There are no commands defined in the “saml:config” namespace.

Could not create LDAP Config at Nextcloud
EXITCODE=1
bedb271a-ac97-4563-b89a-97832d64c928
univention-join-hooks: looking for hook type “join/post-joinscripts”

any idea?
i tried removing some nextcloud saml service entries, but these are recreated again, until the script fails.
How to figure out, what it is exactly that fails?

Thanks!

i found this post: Nextcloud Join Script failed
also stopping at the SAML… so wondering, if SSO or some domain/DNS stuff is the reason to fail?

I looked also into:
https://docs.software-univention.de/manual/5.0/de/domain-ldap/saml.html
an added the ucs-sso cert to my browser and followed the instructions to make the browser accepting things.
I reran the join-script, but nothing changed, still fails.
I also though if running the join from ssh directly without using the browser session would do the magic, but also here, same failure…

I cannot call https://ucs-sso.domain this is not resolved from my browser/server session.

What to do? SSO is the cherry on the cake, but a bit annoying to break initial installations/first steps…

i created host entries, so usc-sso resolves and more.
by coincidence a nextcloud app update arrived, which i could upgrade to.
Also rerun all join scripts with “force” flag.
Still nextcloud join script fails with:

There are no commands defined in the “saml:config” namespace.

Could not create LDAP Config at Nextcloud
EXITCODE=1

Nextcloud does not integrate into LDAP due to this, so no ucs users.

What am I doing wrong here?
@tanatos ?

Ok,

Du kannst den Container öffnen:

univention-app shell nextcloud

Schau mal den output an:
sudo -u www-data /var/www/html/occ ldap:show-config |grep "Configuration\ "

sollte sowas sein:

| Configuration | s01

um dann den Output zu prĂĽfen:

sudo -u www-data /var/www/html/occ ldap:test-config -vvv s01

Das müsste fast einen Fehler werfen. Wäre es dann nicht besser Nextcloud sauber komplett zu deinstallieren und alle UCS Fehlermeldungen und nur bei Bedarf bestehende Nextcloudschnipsel zu beseitigen ?
Siehe:
univention-run-diagnostic-checks

und bei der nächsten Installation die install scripte von Anfang an und Schritt für Schritt zu kontrollieren? Meine 50 Cent in Anbetracht der schon geleisteten Handarbeit an der Datenbank, im Docker usw…

Siehe auch:

/var/cache/univention-appcenter/appcenter.software-univention.de/5.0/nextcloud_20231221125849.README_UNINSTALL_DE

Die Alternative wäre es sich jetzt durch bestehende Logfiles und Config zu arbeiten. Was denkst Du?

VG

gibt:
root@nextc-41600308:/# sudo -u www-data /var/www/html/occ ldap:show-config |grep "Configuration\ "

There are no commands defined in the “ldap” namespace.

→ ok ich deinstalliere den Container komplett und folge den Löschanweisungen

yess :slight_smile:

→ neuinstallation mit vorheriger Löschung ist nun durchgelaufen. Lediglich der Schritt oben “set trusted domains” musste nochmal ausgeführt werden, jetzt läufts!

Danke!!

Mastodon