6 nextcloud
vlab edited this page 4 years ago

Tasks

occ command access

If the docker container is already running, you can use occ directly:

compose exec -u www-data nextcloud /var/www/html/occ --help

In some cases, a bug in docker will prevent this last command from running, returning

unable to find user www-data: no matching entries in passwd file

if this is the case, you can use:

compose exec -u 33 nextcloud /var/www/html/occ --help

Access to configuration

With occ command

All parameters from the configuration can be set via command line through the occ command. You can use the occ command on myc hosts as described here, for general information on the occ command on the nextcloud documentation you can check there.

access to config.php

All parameters are available in the config.php file located in /srv/datastore/config/nextcloud/var/www/html/config/config.php.

Getting logs

There are 2 location worth checking

Stdout/stderr of docker container

Issuing this command via SSH on the host will give you a live access to the stdout/stderr of the nextcloud container.

compose logs -f --tail=200 nextcloud

Exit with Ctrl-C

JSON logs

To read them easily, you might need to install jq before:

apt-get install -y --force-yes jq

Then you can

tail -f /srv/datastore/data/nextcloud/var/lib/nextcloud/data/nextcloud.log | jq

Troubleshooting

Internal Server Error

Upon connection with a browser on the url served by nextcloud, if you received

Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

You'll need to get more info in the server logs:

This can be:

Disk Full

Symptoms

  • probable Internal Server Error message upon access with a browser on the url server by nextcloud. (Internal Server Error section)

  • in the docker container logs (see Getting log section) you'll notice this message

    Sabre/DAV/Exception/InsufficientStorage: Insufficient space in [directory path], xxxxxx required, YYYYYYY availaible
    
  • a simple df -h / should confirm you that you are running quite low on disk space

  • if you run other services on the same host, they might have already crashed also (check your odoo service for instance, by using your browser to check the availability of the served URL).

Resolution

You must find where the disk space is used:

  • it is global on the nextcloud database ?
  • is it due to a specific user ?

User files disk usage:

du -sh /srv/datastore/data/nextcloud/var/lib/nextcloud/data/* | sort -h

More precisely, their trashbin disk usage:

du -sh /srv/datastore/data/nextcloud/var/lib/nextcloud/data/*/files_trashbin | sort -h

Trashbin issue

Nextcloud has a specific way to manage the deletion of files and repositories, explained here: https://docs.nextcloud.com/server/stable/user_manual/files/deleted_file_management.html?highlight=trash

If the disk space issue is due to the trashbin folder full of old deleted file, you can start by deleteing them to free the memory and make the application available again for the users.

You can also modify the trashbin configuration, in the config.php file, with the parameter `trashbin_retention_obligation'.

Example:

'trashbin_retention_obligation' => 1,3,

Here the deleted files are kept at least 1 day, and up to 3 days, if the quota of deleted files is not exceeded (if exceeded, they will be deleted sooner).