NC 21.02 Raspberry Wiederherstellung aus Sicherung - Datenbankproblem?

Meine NC, zuletzt in der Version 21.0.2 lief auf dem 32 Bit RaspberryPi-Betriebssysten. Die App News brauch ab sofort 64 Bit, deshalb habe ich das entsprechende Betriebssystem aufgespielt, was bedeutet, das alles neu installiert werden musste.

Meine Daten sind auf einer externen Festplatte, die natürlich unverändert blieb.
Den Ordner /var/www/nextcloud hatte ich gesichert und wieder zurückgespielt. Die Berechtigungen stimmen.

Die Datenbank wurde über webmin regelmäßig gesichert. wurde zurückgespielt. Sie ist aber irgendwie nicht erreichbar…
Bei Aufrufen der Nextcloud bekomme ich eine “Internal Server Error”.

sudo -u www-data php occ maintenance:data-fingerprint
folgende Meldung:
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user ‘nextclouduser’@‘localhost’ (using password: YES) in /var/www/nextcloud/lib/private/DB/Connection.php:85

Das Passwort stimmt. Die Einträge in der php.config scheinen sinnig zu sein - Die Datei hatte ich ja auch nicht geändert.

Hatte alternativ auch mal versucht eine frische NC Instanz zu installieren. Er scheint sich das Admin-Passwort (das man bei ersten aufrufen vergeben muss) nicht zu merken, obwohl es ein sehr einfaches war.

Scheint also eine Problem mit der Datenbank zu sein?

Was könnte ich da übersehen?

Bin für jeden Tipp schon im Voraus dankbar

Ach ja:
Raspian 64 Bit auf einen Raspberry 4
php 7.3
Auf der Platte sind knapp 150 GB NC-Daten mit Tasgs, Kalender, Kontakte, Tasks … Die Datenbank wweiter zu nutzen wäre schon cool

Ich gehe mal davon aus dass du die datenbank über die Komandozeile erreichen kannst?
sudo mysql -u Benutzer -p dann passworteinagbe dann use database name der Datenbank
wenn das geht kontrolliere die privileges des users
den du in deiner config angelegt hast
Ich weiss nix über rasbian

Wie ist denn die Ausgabe von

mysql -u root -p -e "USE mysql; SELECT User, Host, plugin FROM mysql.user;"

Zunächst hatte root kein Passwort bzw. das PW, das ich in der 32-Bit-Installation benutzt hatte, funktionierte nicht. Dann habe habe ich eins in Wemin vergeben.

Dann:
pi@raspberrypi:~ $ mysql -u root -p -e “USE mysql; SELECT User, Host, plugin FRO M mysql.user;”
Enter password:
±--------------±----------±-------+
| User | Host | plugin |
±--------------±----------±-------+
| root | localhost | |
| ncadmin | localhost | |
| nextclouduser | % | |
±--------------±----------±-------+

Dann habe ich nextclouduser localhost zugeordnet
mysql -u root -p -e “USE mysql; SELECT User, Host, plugin FRO M mysql.user;”
Enter password:
±--------------±----------±----------------------+
| User | Host | plugin |
±--------------±----------±----------------------+
| root | localhost | |
| ncadmin | localhost | |
| nextclouduser | localhost | mysql_native_password |
±--------------±----------±----------------------+

Der Internal Server Error ist immer noch da

pi@raspberrypi:~ $ sudo mysql -u nextclouduser -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 133
Server version: 10.3.29-MariaDB-0+deb10u1 Debian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> use nextwolke
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [nextwolke]>

Das scheint zu funktionieren…

sudo -u www-data php occ maintenance:repair
Nextcloud is in maintenance mode - no apps have been loaded

  • Repair MySQL collation
    • All tables already have the correct collation → nothing to do
  • Repair mime types
  • Clean tags and favorites
    • 0 tags of deleted users have been removed.
    • 0 tags for delete files have been removed.
    • 0 tag entries for deleted tags have been removed.
    • 0 tags with no entries have been removed.
  • Repair invalid shares
  • Move .step file of updater to backup location
  • Add move avatar background job
    • Repair step already executed
  • Add preview cleanup background jobs
  • Fix potential broken mount points
    • No mounts updated
  • Repair language codes
  • Install new core bundle components
  • Add log rotate job
  • Clear frontend caches
    • Image cache cleared
    • SCSS cache cleared
    • JS cache cleared
  • Clear every generated avatar on major updates
  • Add preview background cleanup job
  • Queue a one-time job to cleanup old backups of the updater
  • Cleanup invalid photocache files for carddav
  • Add background job to cleanup login flow v2 tokens
  • Remove potentially over exposing share links
    • No need to remove link shares.
  • Clear access cache of projects
  • Reset generated avatar flag
  • Keep legacy encryption enabled
  • Check encryption key format
  • Remove old dashboard app config data
  • Add job to cleanup the bruteforce entries
  • Queue a one-time job to check for user uploaded certificates
  • Repair DAV shares
  • Add background job to set the lookup server share state for users
  • Update name of the stored view
  • Fix component of birthday calendars
    • 1 birthday calendars updated.
  • Regenerating birthday calendars to use new icons and fix old birthday events without year
    • Repair step already executed
  • Fix broken values of calendar objects
    0 [->--------------------------]
  • Registering building of calendar search index as background job
    • Repair step already executed
  • Register building of social profile search index as background job
  • Registering background jobs to update cache for webcal calendars
    • Added 0 background jobs to update webcal calendars
  • Registering building of calendar reminder index as background job
    • Repair step already executed
  • Clean up orphan event and contact data
    • 0 events without a calendar have been cleaned up
    • 0 properties without an events have been cleaned up
    • 0 changes without a calendar have been cleaned up
    • 0 cached events without a calendar subscription have been cleaned up
    • 0 changes without a calendar subscription have been cleaned up
    • 0 contacts without an addressbook have been cleaned up
    • 0 properties without a contact have been cleaned up
    • 0 changes without an addressbook have been cleaned up
  • Remove activity entries of private events
    • Removed 0 activity entries
  • Fix the share type of guest shares when migrating from ownCloud
  • Copy the share password into the dedicated column
  • Set existing shares as accepted
  • Update OAuth token expiration times
  • Switches from default updater server to the customer one if a valid subscript ion is available
    • Repair step already executed
  • Send an admin notification if monthly report is disabled
  • Add background job to check for backup codes
  • Populating added database structures for workflows

Es scheint so, als wäre die Datenbannk jetzt erreichbar…

Trotzdem noch internal server error…

Auf jeden Fall herzlichen Dank!

Was sagt das Webserver (Error-)Log?

Die nextcloud.log? keine Einträge im entsprechenden Zeitraum.

Nein, das Log des Webservers (Apache, nginx oder welchen Webserver du benutzt).

OK dann deaktiviere doch einfach mal alle aps in der Datenbank
mit occ

Wirklich alle?
Enabled:

  • accessibility: 1.7.0
  • activity: 2.14.3
  • calendar: 2.3.0
  • cloud_federation_api: 1.4.0
  • comments: 1.11.0
  • contacts: 4.0.0
  • contactsinteraction: 1.2.0
  • dashboard: 7.1.0
  • dav: 1.17.1
  • federatedfilesharing: 1.11.0
  • federation: 1.11.0
  • files: 1.16.0
  • files_pdfviewer: 2.1.0
  • files_rightclick: 1.0.0
  • files_sharing: 1.13.1
  • files_trashbin: 1.11.0
  • files_versions: 1.14.0
  • files_videoplayer: 1.10.0
  • firstrunwizard: 2.10.0
  • logreader: 2.6.0
  • lookup_server_connector: 1.9.0
  • nextcloud_announcements: 1.10.0
  • notifications: 2.9.0
  • oauth2: 1.9.0
  • password_policy: 1.11.0
  • photos: 1.3.0
  • privacy: 1.5.0
  • provisioning_api: 1.11.0
  • recommendations: 1.0.0
  • serverinfo: 1.11.0
  • settings: 1.3.0
  • sharebymail: 1.11.0
  • support: 1.4.0
  • survey_client: 1.9.0
  • systemtags: 1.11.0
  • tasks: 0.13.6
  • text: 3.2.0
  • theming: 1.12.0
  • twofactor_backupcodes: 1.10.0
  • updatenotification: 1.11.0
  • user_status: 1.1.1
  • viewer: 1.5.0
  • weather_status: 1.1.0
  • workflowengine: 2.3.0

Aus /var/log/apache2/error.log
PHP Warning: PHP Startup: Unable to load dynamic library ‘imagick.so’ (tried: /usr/lib/php/20180731/imagick.so (/lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block), /usr/lib/php/20180731/imagick.so.so (/usr/lib/php/20180731/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[Tue Jul 13 19:36:03.581225 2021] [mpm_prefork:notice] [pid 675] AH00163: Apache/2.4.38 (Debian) configured – resuming normal operations
[Tue Jul 13 19:36:03.581312 2021] [core:notice] [pid 675] AH00094: Command line: ‘/usr/sbin/apache2’

Das imagick PHP-Modul ist installiert:
sudo php -m | grep imagick
imagick

in welcher version?

php-imagick Provides a wrapper to the ImageMagick library
php-imagick-all-dev Provides a wrapper to the ImageMagick library
php5.6-imagick Provides a wrapper to the ImageMagick library
php7.0-imagick Provides a wrapper to the ImageMagick library
php7.1-imagick Provides a wrapper to the ImageMagick library
php7.2-imagick Provides a wrapper to the ImageMagick library
php7.3-imagick Provides a wrapper to the ImageMagick library
php7.4-imagick Provides a wrapper to the ImageMagick library
php8.0-imagick Provides a wrapper to the ImageMagick library
ruby-activestorage Local and cloud file storage framework (part of Rails)
ruby-mini-magick wrapper for ImageMagick with a small memory footprint
es sollte deiner php version entsprechen

Ich würde es probieren da es mir auch schon mal geholfen hat.
NAcheinander deaktivieren bis du den schuldigen gefunden hast

Das Deaktivieren der Apps hat leider nichts gebracht.

In der Zwischenzeit habe ich eine neue Instanz unter /var/www/nexcloud1 installiert, dazu eine neue Datenbank und einen neuen Datenbank-Benutzer. Nur das Datenverzeichnis blieb das selbe.

Als Benutzername habe ich meinen Namen genommen. Nextcloud meckerte, dass es einen entprechenden Benutzer schon gibt. Woher weiß NC das? Der Benutzername kann nur in der Datenbank stehen und die ist neu.

Also einen neuen Namen mit einem sehr simplen Passwort versicht. Jetzt kam ich bis zu anmeldung weiter, die aber nicht funktioneirte. Der Benutzer/Passwort seien unbekannt.
Verhext.

An diesem Punkt gebe ich jetzt auf. Am Wochenende werde ich eine frische Raspian-Installation versuchen und dann NC frische aufsetzen. Erst wenn das funktioniert werde ich die alten Daten importieren…

DANKE an alle! Als Anfänger (ich beschäftige mich seit etwa 6 Monaten mit Linux und dem Raspberry) habe ich einiges dazu gelernt.

Beim Anlegen eines Benutzers legt Nextcloud auch einen Ordner BENUTZERNAME im Datenverzeichnis an. Vermutlich prüft Nextcloud vor dem Anlegen dieses Ordners, ob es schon einen Ordner mit diesem Benutzernamen gibt.

In der Zwischenzeit habe ich mysql komplett als Anwendung und mit allen Datenbanken gelöscht und neuinstalliert. 2 neue Datenbanken und 2 neue Nutzer angelegt. 2 Nectcloud-Instanzen instralliert (in 2 Verzeichnissen- Apache mal auf das eine oder andere Verzeichnis gelenkt).
Eine Instanz habe ich neu initialisiert und bei der anderen habe ich das Backup der alten Datenbank benutzt.
Bei beiden funktioniert das Login mit den angelegten Benutzern nicht!

Von der Kommandozeile kann ich auf die jeweilige Daten zugreifen. Auch das Passwort für meinen “alten” Benutzernamen konnte über den ooc-Befehl ändern und auch einen neuen Nutzer anlegen - Über die Browser-Login-Seite funktioniert nichts.

Schaut aus, als ob nur über Apache kein Zugriff möglich ist.

PHP auf 8.0 augedatet (hatte ich bei meiner 32Bit-Installation auch). Die Konfigurationsdateien sehen so aus wie bei meine 32-Bit-Installaton…

Scheint so, als obirgedwo eine Berechtigung fehlt - Als ob Apache irgendwo hängen bleibt - aber wo kann ich da noch einen Hinweis finden?

Apache2 access.log:

192.168.0.2 - - [17/Jul/2021:15:47:50 +0200] “GET /nextcloud/index.php/apps/theming/icon?v=0 HTTP/1.1” 200 28786 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0”
192.168.0.2 - - [17/Jul/2021:15:47:50 +0200] “GET /nextcloud/index.php/apps/theming/favicon?v=0 HTTP/1.1” 200 91310 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0”
192.168.0.2 - - [17/Jul/2021:15:47:58 +0200] “POST /nextcloud/index.php/login HTTP/1.1” 303 1228 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0”
192.168.0.2 - - [17/Jul/2021:15:47:58 +0200] “GET /nextcloud/index.php/apps/dashboard/ HTTP/1.1” 303 1248 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0”
192.168.0.2 - - [17/Jul/2021:15:47:58 +0200] “GET /nextcloud/index.php/login?redirect_url=/nextcloud/index.php/apps/dashboard/ HTTP/1.1” 200 6588 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0”
192.168.0.2 - - [17/Jul/2021:15:48:05 +0200] “POST /nextcloud/index.php/login HTTP/1.1” 303 1222 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0”
192.168.0.2 - - [17/Jul/2021:15:48:05 +0200] “GET /nextcloud/index.php/apps/dashboard/ HTTP/1.1” 303 1242 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0”
192.168.0.2 - - [17/Jul/2021:15:48:05 +0200] “GET /nextcloud/index.php/login?redirect_url=/nextcloud/index.php/apps/dashboard/ HTTP/1.1” 200 6585 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0”

Und

Apache2 error.log:

[Sat Jul 17 15:43:31.946939 2021] [mpm_prefork:notice] [pid 687] AH00163: Apache/2.4.38 (Debian) configured – resuming normal operations
[Sat Jul 17 15:43:31.947182 2021] [core:notice] [pid 687] AH00094: Command line: ‘/usr/sbin/apache2’

Das Problemm scheint gelöst. Von meinem Handy-Browser kann ich mich einloggen. Von meinem Rechner aus nicht, auch wenn ich den Edge-Browser statt den Standrad-Firefox nutze.

Das hat wohl nichts mehr mit Nextcloud zu tun…

Nochmal herzlichen Dank!