Default user and group of files?

This might be a continuation of Nextcloud container doesn't start after restoring from backup. If not, the AIO label might be wrong.


When trying to access the files through the web interface, I see this:

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.

Looking through this forum, I found this thread: Internal server error when accessing files.

Given that that I had some issues with restoring the current state from a backup (see above), I went and checked that as well. It seems all files and folders are owned by www-data:root and have 750 permissions set.

Is this the default or should it be different? If that is correct, any idea why I see the error? Happy to provide any logs. This is what I see from the logging Web interface:

[core] Error: OCP\Files\NotPermittedException:  at <<closure>>

 0. /var/www/html/lib/private/Files/SimpleFS/SimpleFile.php line 114
    OC\Files\Node\File->delete()
 1. /var/www/html/lib/private/Files/SimpleFS/SimpleFile.php line 77
    OC\Files\SimpleFS\SimpleFile->checkFile()
 2. /var/www/html/lib/private/Template/JSCombiner.php line 119
    OC\Files\SimpleFS\SimpleFile->getContent()
 3. /var/www/html/lib/private/Template/JSCombiner.php line 94
    OC\Template\JSCombiner->isCached("merged-index.js.deps", ["OC\\Files\\SimpleFS\\SimpleFolder"])
 4. /var/www/html/lib/private/Template/JSResourceLocator.php line 125
    OC\Template\JSCombiner->process("/var/www/html/apps/files", "js/merged-index.json", "files")
 5. /var/www/html/lib/private/Template/JSResourceLocator.php line 112
    OC\Template\JSResourceLocator->cacheAndAppendCombineJsonIfExist("/var/www/html/apps/files", "js/merged-index.json", "files")
 6. /var/www/html/lib/private/Template/ResourceLocator.php line 78
    OC\Template\JSResourceLocator->doFind("js/merged-index")
 7. /var/www/html/lib/private/TemplateLayout.php line 379
    OC\Template\ResourceLocator->find(["core/js/common ... "])
 8. /var/www/html/lib/private/TemplateLayout.php line 211
    OC\TemplateLayout::findJavascriptFiles(["core/js/common ... "])
 9. /var/www/html/lib/private/legacy/OC_Template.php line 184
    OC\TemplateLayout->__construct("error", "")
10. /var/www/html/lib/private/Template/Base.php line 132
    OC_Template->fetchPage()
11. /var/www/html/lib/private/legacy/OC_Template.php line 333
    OC\Template\Base->printPage()
12. /var/www/html/index.php line 74
    OC_Template::printExceptionErrorPage(["OCP\\Files\\NotPermittedException"], 500)

GET /apps/files/
from 89.182.223.95 by admin at 2023-04-12T13:28:37+00:00

Typically permissions should be www-data:www-data and mode 750 folders and 640 files. See here under #12. May or may not be related to your issue, but it’s worth a try.

Thanks for the link! I’ve changed ownership and permissions but I still see the error. However, this technically answers the question of the title, so I’m going to mark it as answer and start a new thread.