Nextcloud version (eg, 20.0.5): 24.0.4
Operating system and version (eg, Ubuntu 20.04): Fedora 34 Server
Apache or nginx version (eg, Apache 2.4.25): nginx 1.22
PHP version (eg, 7.4): 7.4.30
The issue you are facing:
I moved some folders from backup via terminal manually. Then set user permission to nginx user for all folders and files. I can see all files and folders on dashboard but can’t access any of them with an error of permission denied. I also tried below commands but didn’t help me.
find files/ -type f -print0 | xargs -0 sudo chmod 640
find files/ -type d -print0 | xargs -0 sudo chmod 750
Is this the first time you’ve seen this error? (Y/N): Y
The output of your Nextcloud log in Admin > Logging:
Error: fopen(/var/www/html/nextcloud/data/admin/files/folder/file.pdf): failed to open stream: Permission denied at /var/www/html/nextcloud/lib/private/Files/Storage/Local.php#377
[webdav] Fatal: Sabre\DAV\Exception\ServiceUnavailable: Could not open file at <<closure>>
0. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 85
OCA\DAV\Connector\Sabre\File->get()
1. /var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
Sabre\DAV\CorePlugin->httpGet()
2. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 472
Sabre\DAV\Server->emit()
3. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 253
Sabre\DAV\Server->invokeMethod()
4. /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 321
Sabre\DAV\Server->start()
5. /var/www/html/nextcloud/apps/dav/lib/Server.php line 358
Sabre\DAV\Server->exec()
6. /var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php line 35
OCA\DAV\Server->exec()
7. /var/www/html/nextcloud/remote.php line 166
require_once("/var/www/html/n ... p")
GET /remote.php/dav/files/admin/folder/file.pdf
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'passwordsalt' => '',
'secret' => '',
'trusted_domains' =>
array (
0 => 'sub.domain.com',
),
'datadirectory' => '/var/www/html/nextcloud/data',
'dbtype' => 'mysql',
'share_folder' => '/SHARE',
'version' => '24.0.4.1',
'overwrite.cli.url' => 'https://sub.domain.com',
'overwriteprotocol' => 'https',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'default_phone_region' => 'TR',
'dbuser' => 'nextcloud',
'dbpassword' => 'password',
'installed' => true,
'instanceid' => 'ocd9uqfbh7ov',
'trashbin_retention_obligation' => '30,30',
'enable_previews' => true,
'preview_max_x' => '2048',
'preview_max_y' => '2048',
'preview_max_scale_factor' => 1,
'enabledPreviewProviders' =>
array (
0 => 'OC\\Preview\\TXT',
1 => 'OC\\Preview\\MarkDown',
2 => 'OC\\Preview\\OpenDocument',
3 => 'OC\\Preview\\PDF',
4 => 'OC\\Preview\\MSOffice2003',
5 => 'OC\\Preview\\MSOfficeDoc',
6 => 'OC\\Preview\\PDF',
7 => 'OC\\Preview\\Image',
8 => 'OC\\Preview\\Photoshop',
9 => 'OC\\Preview\\TIFF',
10 => 'OC\\Preview\\SVG',
11 => 'OC\\Preview\\Font',
12 => 'OC\\Preview\\MP3',
13 => 'OC\\Preview\\Movie',
14 => 'OC\\Preview\\MKV',
15 => 'OC\\Preview\\MP4',
16 => 'OC\\Preview\\AVI',
17 => 'OC\\Preview\\HEIC',
18 => 'OC\\Preview\\HEIF',
19 => 'OC\\Preview\\HEVC',
),
'loglevel' => 2,
'jpeg_quality' => '60',
'filelocking.enabled' => true,
'memcache.distributed' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'memcache.local' => '\\OC\\Memcache\\APCu',
'redis' =>
array (
'host' => 'localhost',
'port' => 6379,
),
'twofactor_enforced' => 'true',
'twofactor_enforced_groups' =>
array (
),
'twofactor_enforced_excluded_groups' =>
array (
),
'maintenance' => false,
'theme' => '',
);