Troubleshooting Nextcloud

  • Hi Everyone,


    I'm running into some difficulties with Nextcloud and need some assistance troubleshooting this.


    The apps (like agenda and contacts) are working as expected.

    Reading and downloading via the webui also works as expected => uploading files is not allowed.


    Working with files via the nextcloud client is not working at all - not even downloading.


    There are a few errors which I'm not able to fix.


    The first one is about "security & setup warnings":

    =====

    It was not possible to execute the cron job via CLI. The following technical errors have appeared:

    Your data directory is invalid

    Ensure there is a file called “.ocdata” in the root of the data directory.

    Last background job execution ran 5 days ago. Something seems wrong. Check the background job settings

    =====


    The data directory specified in the nextcloud config is:

    /var/www/vhosts/hosting<id>.<host-type>.netcup.net/httpdocs/nc.it-visibility.net/data


    The file called ".ocdata" is actually in there.


    Another error is about running the updater:

    =====

    Check for expected files

    The following extra files have been found:

    httpdocs

    =====


    I tried a few things to make this work; part of which having rwx access at all levels and recursive.


    Is somebody in a position to provide some directions.



    Thank you - Will

    With warm greetings,

    - Will | IT visibility

  • Do you know how that could/would like for the CLI?

    I've already mentioned the relevant changes, see my last link. :)


    Just create a new file data.config.php in the config directory and paste this code into the file:

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

    Now the datadirectory-path will be computed at runtime. (As long as your datadirectory is still the default data directory.)

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

    Einmal editiert, zuletzt von KB19 ()

  • I've already mentioned the relevant changes, see my last link. :)


    Just create a new file data.config.php in the config directory and paste this code into the file:

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

    Now the datadirectory-path will be calculated at runtime. (As long as your datadirectory is still the default data directory.)


    Whoeps... didn't read it very carefully => just added this file... :thumbup::)


    Would/should this also fix the problems with up/downloading files and updating Nextcloud?

    Just found out that my initial message wasn't correct => both, up- and downloading are not working.


    The error-log in /httpdocs/logs/nc.it-visibility.net/ is still showing the error message below:

    [Sat Sep 25 00:01:38.153310 2021] [core:crit] [pid 18175] (13)Permission denied: [client 77.169.79.145:38618] AH00529: /var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/var/www/vhosts/hosting160002.a2f36.netcup.net/httpdocs/nc.it-visibility.net/data/' is executable

    With warm greetings,

    - Will | IT visibility

  • What are the permissions of the file /httpdocs/nc.it-visibility.net/data/.htaccess and the data directory?

    • Default permissions for files: 0644 (rw-r--r--)
    • Default permissions for directories: 0755 (rwxr-xr-x)

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

  • What are the permissions of the file /httpdocs/nc.it-visibility.net/data/.htaccess and the data directory?

    • Default permissions for files: 0644 (rw-r--r--)
    • Default permissions for directories: 0755 (rwxr-xr-x)


    First: thank you for your prompt response, time and patience - really appreciated.


    It is 0755 for both - all files and folders in /httpdocs - including /httpdocs itself.

    However, the data directory keeps returning to "rwx rwx ---"


    To summarize: I checked and made some changes as suggested. But no noticable improvements.

    With warm greetings,

    - Will | IT visibility


  • It looks like I (or somebody else?) was able to fix most of the things by deleting all folders and files from the webUI and then restored them via the Nextcloud client of a Windows device.


    Regarding the phrase "somebody else?": a few changes where made to the config.php file... and it wasn't me... ;)

    To whoever made these: thank you!


    There are a few leftovers in the section called "Security & setup warnings".

    Will make an attempt fixing these using the RTFM and RTFMT approach... ;)

    With warm greetings,

    - Will | IT visibility

  • If this wasn't your Windows device who "restored" things via the Nextcloud client and you also don't know whose Windows device it is, it might be wise to start over from scratch.

    Yes - it was my Windows device and me doing a manual restore of a backup to the sync-folder of the Nextcloud client.

    With warm greetings,

    - Will | IT visibility

  • What is your crontab for www-data? Does ist exist?

    It should look like this, with other pathnames of course.

    # The command to edit that crontab:

    crontab -eu www-data

    # The content to be put in there. The file should have an empty line at its end!

    */5 * * * * /usr/bin/php /home/clown/www/clown/cron.php --define apc.enable_cli=1