nextcloud in webhosting occ findet data-Verzeichnis nicht.

  • Hallo!

    Ich bräuchte euren Rat.Ich habe nextcloud in einem webhosting Paket installiert. Nun wollte ich per ssh einen occ Befehl absetzen, um Indizes auf manchen Tabellen hinzuzufügen. Ich erhalte dabei aber folgende Fehlermeldung:

    Code
    Your data directory is invalid
    Ensure there is a file called ".ocdata" in the root of the data directory.
    
    Cannot create "data" directory
    This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/22/go.php?to=admin-dir_permissions

    Ich vermute, dass das damit zusammenhängt, dass ich per ssh ja in so einer gekapselten Umgebung auf dem Webserver lande. Denn die Datei .ocdata ist im data-Verzeichnis vorhanden. In der config.php steht:

    'datadirectory' => '/var/www/vhosts/hostingXXXXXX.afXXX.netcup.net/httpdocs/nextcloudPFad/data',

    Ich gehe davon aus, dass das der tatsächliche Pfad auf dem Dateisystem ist. Auf diesen kann ich aber halt aus meiner gekapselten Umgebung per ssh in dem Webhosting nicht zugreifen und dass da das Problem liegt.

    Nun weiß ich aber leider nicht, wie ich das Problem lösen könnte. Klar könnte ich in der config.php den Dateipfad auf /httpdocs/nextcloudPFad/data ändern und dann würde der occ Befehl vermutlich das data-Verzeichnis auch finden. Ich befürchte aber, dass der Webserver auf dem eigentlichen Wirtssystem, dann das Verzeichnis nicht mehr findet, und nextcloud dann alle Dateien für verschwunden erklärt.

    Habt ihr einen Vorschlag für mich, wie ich das risikoarm regeln könnte?

    Vielen Dank vorab!

  • Ja. KB19 hat da mal eine einfache, prima funktionierende Lösung gepostet.


    Erzeuge im config-Verzeichnis eine neue Datei, data.config.php mit folgendem Inhalt:


    PHP
    <?php
    
    $CONFIG['datadirectory'] = realpath(__dir__ . '/../data');

    Das war's dann auch schon. So ist es dann auch updatesicher.

  • Super cool. Vielen Dank. Teste ich heute Abend gleich.


    EDIT: Habe es so gemacht. Funktioniert wunderbar. Vielen Dank euch!

    Einmal editiert, zuletzt von zax () aus folgendem Grund: Getestet und funktioniert.

  • Für kleinerer OCC Sachen - verwende ich gerne OCC web.

    Wurden diese Probleme mittlerweile gelöst?


    Deprecated warning


    As nextcloudd has no native support for asynchronous operations, due to the use of php, this aplication is deprecated, and will no longer support the Nextcloud' future versions (19+). I did not find a way to implemement true support for interactive and long running occ tasks in a web terminal whitout introducing addtional dependencies (through websockets, for example), the lack of true asynchronous occ operations can lead to serious alterations of voluminous instances. This issue may give some hints on why I decided to not support this application anymore.

    "Wer nur noch Enten sieht, hat die Kontrolle über seine Server verloren." (Netzentenfund)

    3 Mal editiert, zuletzt von KB19 ()