Desktop app gets 403 errors during directory listing

Nextcloud version (eg, 18.0.2): 20.0.4
Operating system and version (eg, Ubuntu 20.04): Kubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.1): 7.4

The issue you are facing:
The desktop app returns 403 errors when trying to perform a directory listing.

Is this the first time you’ve seen this error? (Y/N): Yes.

The output of your Nextcloud log in Admin > Logging:

{"reqId":"VGW3U2E0uCPAQru0dakK","level":2,"time":"2020-12-31T18:55:11+00:00","remoteAddr":"{ip_addr}","user":"--","app":"core","method":"GET","url":"/ocs/v2.php/apps/serverinfo/api/v1/info?format=json","message":"Login failed: 'taira' (Remote IP: '{ip_addr}')","userAgent":"python-requests/2.25.0","version":"20.0.4.0"}
{"reqId":"lVgR7KvhrItXEV1GCoUX","level":4,"time":"2020-12-31T18:55:17+00:00","remoteAddr":"{ip_addr}","user":"taira","app":"webdav","method":"PROPFIND","url":"/cloud/remote.php/dav/files/taira/hi","message":{"Exception":"OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden","Message":"No read permissions","Code":0,"Trace":[{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":204,"function":"getChildren","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":905,"function":"getChildren","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":987,"function":"generatePathNodes","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1678,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1661,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":363,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/remote.php","line":167,"args":["/var/www/html/cloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/cloud/apps/dav/lib/Connector/Sabre/Directory.php","Line":262,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)","version":"20.0.4.0"}
{"reqId":"mc6IXbbnTCNTRpDEeDdX","level":4,"time":"2020-12-31T18:55:20+00:00","remoteAddr":"{ip_addr}","user":"taira","app":"webdav","method":"PROPFIND","url":"/cloud/remote.php/dav/files/taira/Hosted%20Files","message":{"Exception":"OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden","Message":"No read permissions","Code":0,"Trace":[{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":204,"function":"getChildren","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":905,"function":"getChildren","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":987,"function":"generatePathNodes","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1678,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1661,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":363,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/cloud/remote.php","line":167,"args":["/var/www/html/cloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/cloud/apps/dav/lib/Connector/Sabre/Directory.php","Line":262,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)","version":"20.0.4.0"}


The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocpbontrs7j6',
  'passwordsalt' => 'sea crits',
  'secret' => 'sea crits',
  'trusted_domains' =>
  array (
    0 => 'cloud.mydomain.whatever',
    1 => 'mydomain.whatever',
  ),
  'datadirectory' => '/var/www/html/cloud/data',
  'dbtype' => 'mysql',
  'version' => '20.0.4.0',
  'overwrite.cli.url' => 'https://cloud.mydomain.whatever',
  'dbname' => 'cloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'dbuser',
  'dbpassword' => 'sea crits',
  'installed' => true,
  'app_install_overwrite' =>
  array (
    0 => 'passman',
  ),
);

The output of your Apache/nginx/system log in /var/log/____:
This is the output of access.log, grep'd for only 403s. I could include the entire thing, but this server does a lot more than just Nextcloud, so it’s kind of messy. I’ve omitted error.log entirely because it appeared to contain no useful information. (I.E, none that was related to Nextcloud) I can provide it if need be.

{ip_addr} - taira [31/Dec/2020:13:33:18 -0500] "PROPFIND /cloud/remote.php/dav/files/taira/hi HTTP/1.1" 403 1182 "-" "Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)"
{ip_addr} - taira [31/Dec/2020:13:34:56 -0500] "PROPFIND /cloud/remote.php/dav/files/taira/hi HTTP/1.1" 403 1182 "-" "Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)"
{ip_addr} - taira [31/Dec/2020:13:35:16 -0500] "PROPFIND /cloud/remote.php/dav/files/taira/Sync HTTP/1.1" 403 1182 "-" "Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)"
{ip_addr} - taira [31/Dec/2020:13:35:18 -0500] "PROPFIND /cloud/remote.php/dav/files/taira/Sync HTTP/1.1" 403 1182 "-" "Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)"
{ip_addr} - taira [31/Dec/2020:13:42:54 -0500] "PROPFIND /cloud/remote.php/dav/files/taira/hi HTTP/1.1" 403 1182 "-" "Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)"
{ip_addr} - taira [31/Dec/2020:13:42:56 -0500] "PROPFIND /cloud/remote.php/dav/files/taira/hi HTTP/1.1" 403 1182 "-" "Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)"
{ip_addr} - taira [31/Dec/2020:13:42:58 -0500] "PROPFIND /cloud/remote.php/dav/files/taira/hi HTTP/1.1" 403 1182 "-" "Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)"
{ip_addr} - taira [31/Dec/2020:13:43:35 -0500] "PROPFIND /cloud/remote.php/dav/files/taira/hi HTTP/1.1" 403 4850 "-" "Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)"
{ip_addr} - taira [31/Dec/2020:13:43:37 -0500] "PROPFIND /cloud/remote.php/dav/files/taira/hi HTTP/1.1" 403 1182 "-" "Mozilla/5.0 (Windows) mirall/3.1.1stable-Win64 (build 20201222) (Nextcloud)"

Summary of what I know thus far:

I’ve been happily running Nextcloud for quite some time until last night when, after a period of having the app off on my laptop, I began receiving errors. I tried to remove the sync connections and then add them again, but I got the following error when trying to list a directory:
Screenshot 2020-12-31 142021

To be clear, all of my directories do that. Even newly created ones. I did slews of searches to try to figure out what was going on with many suggestions saying that it’s possible the directory permissions were messed up. I didn’t really change anything, so I didn’t think that was likely, but I decided since I was running an older version to just reinstall the whole thing. My cloud is pretty much entirely for my own use, so it didn’t take too much trouble to just pack my bags and move.

I installed the latest version of Nextcloud, got the desktop app running, and everything seemed to be going just fine. I had around 160 GB of data to sync back to it though, so I let it go overnight. I woke up today however, and I had the exact same issue again. I decided to try reinstalling the desktop app, but to no avail. I decided to post here, but as I was writing this, it started synchronizing again, all on its own. I could see directory listings and everything…and then it died again. This seems to be isolated to the desktop app, as both my phone and browser have no issues from what I can tell.

Any help with this would be greatly appreciated, as I’m utterly stumped. Thanks in advance!

Bump. Anyone have any suggestions?