Benutzerverwaltung: No app in context RuntimeException: nc_admin does not exist

Hallo,
seit kurzem kann ich keine Benutzer mehr in Nextcloud 25.0.8 auf meinem Univention Server 5.0-4 anzeigen.
Nextcloud lÀuft dort in einer Docker-Instanz.

Statt dessen erscheint nach Aufruf “Benutzer” die Meldung “Es ist ein Fehler bei der Anfrage aufgetreten. Es kann nicht fortgefahren werden.”

Im Nextcloud Log steht folgendes:

[no app in context] Fehler: RuntimeException: nc_admin does not exist at <<closure>>

0. /var/www/html/lib/private/User/Manager.php line 206
   OC\User\Database->getRealUID()
1. /var/www/html/lib/private/User/Manager.php line 308
   OC\User\Manager->getUserObject()
2. /var/www/html/apps/provisioning_api/lib/Controller/UsersController.php line 187
   OC\User\Manager->search()
3. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 225
   OCA\Provisioning_API\Controller\UsersController->getUsersDetails()
4. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 133
   OC\AppFramework\Http\Dispatcher->executeController()
5. /var/www/html/lib/private/AppFramework/App.php line 172
   OC\AppFramework\Http\Dispatcher->dispatch()
6. /var/www/html/lib/private/Route/Router.php line 298
   OC\AppFramework\App::main()
7. /var/www/html/ocs/v1.php line 64
   OC\Route\Router->match()
8. /var/www/html/ocs/v2.php line 23
   require_once("/var/www/html/ocs/v1.php")

GET /nextcloud/ocs/v2.php/cloud/users/details?offset=0&limit=25&search=
from xxx.yyy.zzz.aaa  by benutzername at 2023-07-17T09:45:53+00:00

Der User “nc_admin” existiert nicht auf dem Univention-Server (ich vermute LDAP), löschen des Datensatzes in der psql-Nextcloud-Datenbank “oc_accounts” half nicht weiter.

Die config.php:

<?php
$CONFIG = array (
  'passwordsalt' => '********secret*********',
  'secret' => '************secret***********',
  'trusted_domains' =>
  array (
    0 => 'ucs.mydomain.de',
    1 => '192.168.xx.yy',
  ),
  'datadirectory' => '/var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data',
  'dbtype' => 'pgsql',
  'version' => '25.0.8.2',
  'overwrite.cli.url' => 'https://ucs.mydomain.de/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => '172.aa.bb.1',
  'dbport' => '5432',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '*******secret******',
  'installed' => true,
  'instanceid' => 'ocrdv1wakrog',
  'updatechecker' => 'false',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'overwriteprotocol' => 'https',
  'overwritewbroot' => '/nextcloud',
  'htaccess.RewriteBase' => '/nextcloud',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'trusted_proxies' =>
  array (
    0 => '172.aa.bb.1',
  ),
  'mail_smtpdebug' => true,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'meinemail',
  'mail_domain' => 'maildomain.net',
  'mail_smtphost' => 'mail.maildomain.net',
  'mail_smtpport' => '465',
  'maintenance' => false,
  'loglevel' => 3,
  'theme' => '',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'meinemail@domain.net',
  'mail_smtppassword' => 'meinSMTPPasswort',
  'trashbin_retention_obligation' => '10, 30',
  'versions_retention_obligation' => '10, 30',
  'memcache.distributed' => '\\OC\\Memcache\\APCu',
  'default_phone_region' => 'DE',
  'mail_smtpsecure' => 'ssl',
  'allow_local_remote_servers' => true,
  'one-click-instance' => true,
  'one-click-instance.user-limit' => 500,
  'one-click-instance.link' => 'https://nextcloud.com/univention/',
);

Nachtrag:
Ich meine, vor lĂ€ngerer Zeit den Benutzer “nc_admin” auf dem Univention-Server angelegt und Monate spĂ€ter gelöscht zu haben.
Es existieren zudem noch die Konten “ncadmin” und “Administrator” als Administratorkonten, wobei ich bei “ncadmin” ebenfalls ein “User does not exist” erhalte, wenn ich das Konto mit occ aktivieren will.

Der occ-Befehl ergibt folgende Meldung:

root@nextc-29272196:/var/www/html# sudo -u www-data ./occ user:list

In Database.php line 515:

  nc_admin does not exist

Hat jemand eine Idee, wie ich das Problem lösen kann?

Wie kann ich den Fehler beheben? - Muss man in der SQL-Datenbank (Postgres) Manipulationen vornehmen?

-wieder Push-

Vielleicht kannst du ja auch mal noch in deren Forum fragen, falls dir hier nemand weiterhelfen kann: https://help.univention.com/

Ich nutze Univention nicht und kann daher nur raten: Könnte es allenfalls sein dass dieser nc_admin user irgendwie von Univention angelegt wurde, weil Univention irgendeine LDAP Implementation nutzt, ĂŒber welche die Nutzer zentral fĂŒr alle Univention Apps verwaltet werden


Von deren Website:

https://www.univention.com/products/univention-app-center/app-catalog/nextcloud/

Nextcloud is well integrated in UCS, offering easy installation. The automatic configuration includes:

  • Administrator is automatically Nextcloud admin*
  • Users are enabled to access Nextcloud by default*
  • Users and Groups can be enabled/disabled in User & Group Settings*
  • User quota can be configured in User settings*
  • All User and Group benefits by Nextcloud LDAP Schema*

Danke fĂŒr den Hinweis, aber dort habe ich genauso viele Antworten erhalten, wie hier :sleepy:

Wie oben geschrieben, hatte ich den User nc_admin selbst angelegt, lediglich ncadmin wird seitens des UCS automatisch erzeugt.

UnabhÀngig von Univention hÀtte ich daher gerne gewusst, wie ich in der Nextcloud Datenbank die Reste des nc_admin löschen kann, damit die Benutzerverwaltung von Nextcloud wieder funktioniert.

Das Problem konnte inzwischen gelöst werden:

Hier noch einmal die Ausgangslage:

root@ucs:~# univention-app shell nextcloud sudo -u www-data php /var/www/html/occ user:list

In Database.php line 515:

nc_admin does not exist

user:list [-l|–limit [LIMIT]] [-o|–offset [OFFSET]] [–output [OUTPUT]] [-i|–info]

In Nextcloud wurde auf der Seite “Benutzer” unter “Aktive Benutzer” die Fehlermeldung

Es ist ein Fehler bei der Anfrage aufgetreten. Es kann nicht fortgefahren werden.
und dazu eine leere Liste angezeigt.

In der psql-Nextcloud-Datenbank “oc_accounts” existierten drei EintrĂ€ge den User nc_admin betreffend.

Im Nextcloud.log stand:

[no app in context] Fehler: RuntimeException: nc_admin does not exist at <>

(mehr Details im Startbeitrag)

Ein User empfahl mir, mit occ den benutzer nc_admin erneut anzulegen.

root@ucs:~# univention-app shell nextcloud
root@nextc-29272196:/# sudo -u www-data php /var/www/html/occ user:add nc_admin -g admin
Enter password:
Confirm password:
The user “nc_admin” was created successfully

In ExceptionConverter.php line 55:

An exception occurred while executing a query: SQLSTATE[23505]: Unique violation: 7
FEHLER: doppelter SchlĂŒsselwert verletzt Unique-Constraint »oc_group_user_pkey«
DETAIL: SchlĂŒssel »(gid, uid)=(admin, nc_admin)« existiert bereits.

In Exception.php line 26:

SQLSTATE[23505]: Unique violation: 7 FEHLER: doppelter SchlĂŒsselwert verletzt Unique
-Constraint »oc_group_user_pkey«
DETAIL: SchlĂŒssel »(gid, uid)=(admin, nc_admin)« existiert bereits.

In Statement.php line 92:

SQLSTATE[23505]: Unique violation: 7 FEHLER: doppelter SchlĂŒsselwert verletzt Unique
-Constraint »oc_group_user_pkey«
DETAIL: SchlĂŒssel »(gid, uid)=(admin, nc_admin)« existiert bereits.

user:add [–password-from-env] [–display-name [DISPLAY-NAME]] [-g|–group [GROUP]] [–]

Trotz der Fehlermeldungen funktionierte die Anweisung:

univention-app shell nextcloud sudo -u www-data php /var/www/html/occ user:list
  - Administrator: Administrator
  - k***i: K***i
  - m**i: M********r
  - nc_admin: nc_admin
  - ncadmin: ncadmin
  - ucs-sso: SSO
  - w**r: V*********r

Und ich kann jetzt wieder mir die aktiven und deaktivierten Benutzer in Nextcloud anzeigen lassen, ohne, dass die Fehlermeldung erscheint.

Auch das Nextcloud Log bleibt wieder ohne neue EintrÀge.

1 Like