"Token does not exist"-Error after Upgrade to 20.0.2

[/details]

Nextcloud version (eg, 18.0.2): 20.0.2
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.38-3+deb10u4
PHP version (eg, 7.1): 2:7.3+69

The issue you are facing:

Since the update to version 20.0.2 i see repeated errors while accessing nextcloud through davfs:

However, functionality seems not to be affected

Is this the first time you’ve seen this error? Occured with the upgrade to 20.0.2

Steps to replicate it: don’t know

The output of your Nextcloud log in Admin > Logging:

{"reqId":"KbXPUces3V5Rq4wj8RVg","level":0,"time":"2020-12-01T08:32:01+00:00","remoteAddr":"10.64.65.1","user":"--","app":"no app in context","method":"PROPFIND","url":"/remote.php/dav/files/9E71B8A7-154D-4E55-B691-CE75DB3B8B23/example_dir/","message":"{\"Exception\":\"OC\\\\Authentication\\\\Exceptions\\\\InvalidTokenException\",\"Message\":\"Token does not exist\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/html/nextcloud/lib/private/Authentication/Token/Manager.php\",\"line\":147,\"function\":\"getToken\",\"class\":\"OC\\\\Authentication\\\\Token\\\\DefaultTokenProvider\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},
    {\"file\":\"/var/www/html/nextcloud/lib/private/User/Session.php\",\"line\":532,\"function\":\"getToken\",\"class\":\"OC\\\\Authentication\\\\Token\\\\Manager\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},
    {\"file\":\"/var/www/html/nextcloud/lib/private/User/Session.php\",\"line\":448,\"function\":\"isTokenPassword\",\"class\":\"OC\\\\User\\\\Session\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},
    {\"file\":\"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php\",\"line\":131,\"function\":\"logClientIn\",\"class\":\"OC\\\\User\\\\Session\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php\",\"line\":106,\"function\":\"validateUserPass\",\"class\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Auth\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},
    {\"file\":\"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php\",\"line\":254,\"function\":\"check\",\"class\":\"Sabre\\\\DAV\\\\Auth\\\\Backend\\\\AbstractBasic\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php\",\"line\":156,\"function\":\"auth\",\"class\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Auth\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php\",\"line\":192,\"function\":\"check\",\"class\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Auth\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php\",\"line\":144,\"function\":\"check\",\"class\":\"Sabre\\\\DAV\\\\Auth\\\\Plugin\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php\",\"line\":89,\"function\":\"beforeMethod\",\"class\":\"Sabre\\\\DAV\\\\Auth\\\\Plugin\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\"line\":458,\"function\":\"emit\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[\"beforeMethod:PROPFIND\",[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\"line\":251,\"function\":\"invokeMethod\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\"line\":319,\"function\":\"start\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[]},
    {\"file\":\"/var/www/html/nextcloud/apps/dav/lib/Server.php\",\"line\":332,\"function\":\"exec\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[]},
    {\"file\":\"/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php\",\"line\":35,\"function\":\"exec\",\"class\":\"OCA\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[]},
    {\"file\":\"/var/www/html/nextcloud/remote.php\",\"line\":167,\"args\":[\"/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php\"],\"function\":\"require_once\"}],\"File\":\"/var/www/html/nextcloud/lib/private/Authentication/Token/DefaultTokenProvider.php\",\"Line\":160,\"Previous\":{\"Exception\":\"OCP\\\\AppFramework\\\\Db\\\\DoesNotExistException\",\"Message\":\"token does not exist\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/html/nextcloud/lib/private/Authentication/Token/DefaultTokenProvider.php\",\"line\":158,\"function\":\"getToken\",\"class\":\"OC\\\\Authentication\\\\Token\\\\DefaultTokenMapper\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},
    {\"file\":\"/var/www/html/nextcloud/lib/private/Authentication/Token/Manager.php\",\"line\":147,\"function\":\"getToken\",\"class\":\"OC\\\\Authentication\\\\Token\\\\DefaultTokenProvider\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},
    {\"file\":\"/var/www/html/nextcloud/lib/private/User/Session.php\",\"line\":532,\"function\":\"getToken\",\"class\":\"OC\\\\Authentication\\\\Token\\\\Manager\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},
    {\"file\":\"/var/www/html/nextcloud/lib/private/User/Session.php\",\"line\":448,\"function\":\"isTokenPassword\",\"class\":\"OC\\\\User\\\\Session\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},
    {\"file\":\"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php\",\"line\":131,\"function\":\"logClientIn\",\"class\":\"OC\\\\User\\\\Session\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php\",\"line\":106,\"function\":\"validateUserPass\",\"class\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Auth\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},
    {\"file\":\"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php\",\"line\":254,\"function\":\"check\",\"class\":\"Sabre\\\\DAV\\\\Auth\\\\Backend\\\\AbstractBasic\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php\",\"line\":156,\"function\":\"auth\",\"class\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Auth\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php\",\"line\":192,\"function\":\"check\",\"class\":\"OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Auth\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php\",\"line\":144,\"function\":\"check\",\"class\":\"Sabre\\\\DAV\\\\Auth\\\\Plugin\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php\",\"line\":89,\"function\":\"beforeMethod\",\"class\":\"Sabre\\\\DAV\\\\Auth\\\\Plugin\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\"line\":458,\"function\":\"emit\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[\"beforeMethod:PROPFIND\",[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]]},
    {\"file\":\"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php\",\"line\":251,\"function\":\"invokeMethod\",\"class\":\"Sabre\\\\DAV\\\\Server\",\"type\":\"->\",\"args\":[{\"__class__\":\"Sabre\\\\HTTP\\\\Request\"},
    {\"__class__\":\"Sabre\\\\HTTP\\\\Response\"}]},
    {\"file\":\"/var/www/html/n

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

$CONFIG = array (
  'instanceid' => 'xxxx',
  'passwordsalt' => 'xxxxx',
  'secret' => 'xxxxxx',
  'trusted_domains' => 
  array (
    0 => 'servername',
    1 => '10.64.65.31',
  ),
  'datadirectory' => '/var/www/nextcloud_data',
  'dbtype' => 'pgsql',
  'version' => '20.0.2.2',
  'overwrite.cli.url' => 'https://servername',
  'dbname' => 'nextclouddb',
  'dbhost' => 'localhost:5432',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxxxxxxxxxxxxx',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'loglevel' => 0,
  'log_type' => 'syslog',
  'maintenance' => false,
  'theme' => '',
  'app_install_overwrite' => 
  array (
    0 => 'calendar',
  ),
);

The output of your Apache/nginx/system log in /var/log/____:

10.64.65.1 - techuser.edicloud [01/Dec/2020:08:32:01 +0100] "PROPFIND /remote.php/dav/files/9E71B8A7-154D-4E55-B691-CE75DB3B8B23/example_dir/ HTTP/1.1" 207 34585 "-" "davfs2/1.5.5 neon/0.30.2"

Same problem and same log output on my side on a newly built Nextcloud (docker) instance.

Hi @Kinimod! Since in my case functionality is affected (currently I am not able to sync my calendar and addressbooks and so all this data is missing on my phone), I am thinking about to downgrade my installation. Can you tell me from which version you were coming (I assume that you did not have this behaviour there)? Thank you very much in advance!

I have the same probelm with caldav. Full log error below: Anyone got an idea for how this can be fixed? Using 2fa.

{“reqId”:“Fh6nleh6dkc3wVs9B0zj”,“level”:0,“time”:“2021-01-19T07:25:45+00:00”,“remoteAddr”:“174.59.116.3”,“user”:"–",“app”:“no app in context”,“method”:“PROPFIND”,“url”:"/remote.php/dav/calendars/peter/work/",“message”:"{“Exception”:“OC\\Authentication\\Exceptions\\InvalidTokenException”,“Message”:“Token does not exist”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/lib/private/Authentication/Token/Manager.php",“line”:147,“function”:“getToken”,“class”:“OC\\Authentication\\Token\\DefaultTokenProvider”,“type”:"->",“args”:["*** sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/User/Session.php",“line”:532,“function”:“getToken”,“class”:“OC\\Authentication\\Token\\Manager”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/User/Session.php",“line”:448,“function”:“isTokenPassword”,“class”:“OC\\User\\Session”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",“line”:131,“function”:“logClientIn”,“class”:“OC\\User\\Session”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php",“line”:106,“function”:“validateUserPass”,“class”:“OCA\\DAV\\Connector\\Sabre\\Auth”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",“line”:254,“function”:“check”,“class”:“Sabre\\DAV\\Auth\\Backend\\AbstractBasic”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",“line”:156,“function”:“auth”,“class”:“OCA\\DAV\\Connector\\Sabre\\Auth”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",“line”:192,“function”:“check”,“class”:“OCA\\DAV\\Connector\\Sabre\\Auth”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",“line”:144,“function”:“check”,“class”:“Sabre\\DAV\\Auth\\Plugin”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",“line”:89,“function”:“beforeMethod”,“class”:“Sabre\\DAV\\Auth\\Plugin”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:458,“function”:“emit”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:251,“function”:“invokeMethod”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:319,“function”:“start”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/dav/lib/Server.php",“line”:332,“function”:“exec”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",“line”:35,“function”:“exec”,“class”:“OCA\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/remote.php",“line”:167,“args”:["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],“function”:“require_once”}],“File”:"/var/www/nextcloud/lib/private/Authentication/Token/DefaultTokenProvider.php",“Line”:160,“Previous”:{“Exception”:“OCP\\AppFramework\\Db\\DoesNotExistException”,“Message”:“token does not exist”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/lib/private/Authentication/Token/DefaultTokenProvider.php",“line”:158,“function”:“getToken”,“class”:“OC\\Authentication\\Token\\DefaultTokenMapper”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/Authentication/Token/Manager.php",“line”:147,“function”:“getToken”,“class”:“OC\\Authentication\\Token\\DefaultTokenProvider”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/User/Session.php",“line”:532,“function”:“getToken”,“class”:“OC\\Authentication\\Token\\Manager”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/User/Session.php",“line”:448,“function”:“isTokenPassword”,“class”:“OC\\User\\Session”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",“line”:131,“function”:“logClientIn”,“class”:“OC\\User\\Session”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php",“line”:106,“function”:“validateUserPass”,“class”:“OCA\\DAV\\Connector\\Sabre\\Auth”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",“line”:254,“function”:“check”,“class”:“Sabre\\DAV\\Auth\\Backend\\AbstractBasic”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",“line”:156,“function”:“auth”,“class”:“OCA\\DAV\\Connector\\Sabre\\Auth”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",“line”:192,“function”:“check”,“class”:“OCA\\DAV\\Connector\\Sabre\\Auth”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",“line”:144,“function”:“check”,“class”:“Sabre\\DAV\\Auth\\Plugin”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",“line”:89,“function”:“beforeMethod”,“class”:“Sabre\\DAV\\Auth\\Plugin”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:458,“function”:“emit”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:251,“function”:“invokeMethod”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:319,“function”:“start”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/dav/lib/Server.php",“line”:332,“function”:“exec”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",“line”:35,“function”:“exec”,“class”:“OCA\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/remote.php",“line”:167,“args”:["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],“function”:“require_once”}],“File”:"/var/www/nextcloud/lib/private/Authentication/Token/DefaultTokenMapper.php",“Line”:91},“CustomMessage”:“Token is not valid: Token does not exist”}",“userAgent”:“Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Lightning/68.9.0”,“version”:“20.0.5.2”}
Jan 19 09:25:45 web06 Nextcloud[50335]: {“reqId”:“Fh6nleh6dkc3wVs9B0zj”,“level”:0,“time”:“2021-01-19T07:25:45+00:00”,“remoteAddr”:“172.69.114.7”,“user”:"–",“app”:“webdav”,“method”:“PROPFIND”,“url”:"/remote.php/dav/calendars/mark/work/",“message”:"{“Exception”:“OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden”,“Message”:"",“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php",“line”:106,“function”:“validateUserPass”,“class”:“OCA\\DAV\\Connector\\Sabre\\Auth”,“type”:"->",“args”:["
sensitive parameters replaced ***"]},{“file”:"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",“line”:254,“function”:“check”,“class”:“Sabre\\DAV\\Auth\\Backend\\AbstractBasic”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",“line”:156,“function”:“auth”,“class”:“OCA\\DAV\\Connector\\Sabre\\Auth”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",“line”:192,“function”:“check”,“class”:“OCA\\DAV\\Connector\\Sabre\\Auth”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",“line”:144,“function”:“check”,“class”:“Sabre\\DAV\\Auth\\Plugin”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",“line”:89,“function”:“beforeMethod”,“class”:“Sabre\\DAV\\Auth\\Plugin”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:458,“function”:“emit”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:251,“function”:“invokeMethod”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",“line”:319,“function”:“start”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/dav/lib/Server.php",“line”:332,“function”:“exec”,“class”:“Sabre\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",“line”:35,“function”:“exec”,“class”:“OCA\\DAV\\Server”,“type”:"->"},{“file”:"/var/www/nextcloud/remote.php",“line”:167,“args”:["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],“function”:“require_once”}],“File”:"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php",“Line”:142,“CustomMessage”:"–"}",“userAgent”:“Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Lightning/68.9.0”,“version”:“20.0.5.2”}

Same here on current 20.0.5. Please provide assistance.

Same problem here. Can not upload files using dav.

I have the same problem and tried already much possible solutions. A bugreport is also currently open from my side for the problem but no one answered since a week. Dont know what I can do.
I can successfully login in browser but not with devices / apps etc.

What’s the URL to your bug report, @xwarman ?

I am experiencing similar issues with two different Nextcloud instances (version 21.0.0 and 20.0.8), where users using app password and two-factor authentication (with notifications) on iOS are being disconnected and has to re-enter the app password to log back in. The inability to log in happens after 24h.

Server log when the user is disconnected and prompted to log in:

Debug    no app in context  OC\Authentication\Exceptions\InvalidTokenException: Token does not exist at .../Authentication/Token/DefaultTokenProvider.php line 160                      2021-10-10T18:03:42+00:00 
                                                                                                                                                                                                                    
                               0. lib/private/Authentication/Token/Manager.php line 147                                                                                                                             
                                  OC\Authentication\Token\DefaultTokenProvider->getToken("*** sensitive parameters replaced ***")                                                                                   
                               1. lib/private/User/Session.php line 532                                                                                                                                             
                                  OC\Authentication\Token\Manager->getToken("*** sensitive parameters replaced ***")                                                                                                
                               2. lib/private/User/Session.php line 448                                                                                                                                             
                                  OC\User\Session->isTokenPassword("*** sensitive parameters replaced ***")                                                                                                         
                               3. apps/dav/lib/Connector/Sabre/Auth.php line 131                                                                                                                                    
                                  OC\User\Session->logClientIn("*** sensitive parameters replaced ***")                                                                                                             
                               4. 3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php line 103                                                                                                                
                                  OCA\DAV\Connector\Sabre\Auth->validateUserPass("*** sensitive parameters replaced ***")                                                                                           
                               5. apps/dav/lib/Connector/Sabre/Auth.php line 254                                                                                                                                    
                                  Sabre\DAV\Auth\Backend\AbstractBasic->check(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                        
                               6. apps/dav/lib/Connector/Sabre/Auth.php line 156                                                                                                                                    
                                  OCA\DAV\Connector\Sabre\Auth->auth(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                                 
                               7. 3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php line 182                                                                                                                               
                                  OCA\DAV\Connector\Sabre\Auth->check(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                                
                               8. 3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php line 137                                                                                                                               
                                  Sabre\DAV\Auth\Plugin->check(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                                       
                               9. 3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89                                                                                                                         
                                  Sabre\DAV\Auth\Plugin->beforeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                                
                              10. 3rdparty/sabre/dav/lib/DAV/Server.php line 456                                                                                                                                    
                                  Sabre\DAV\Server->emit("beforeMethod:PUT", [Sabre\HTTP\Request {},Sabre\HTTP\Response {}])                                                                                        
                              11. 3rdparty/sabre/dav/lib/DAV/Server.php line 253                                                                                                                                    
                                  Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                                     
                              12. 3rdparty/sabre/dav/lib/DAV/Server.php line 321                                                                                                                                    
                                  Sabre\DAV\Server->start(                                                                                                                                                          
                                                                                                                                                                                                                    
                                  )                                                                                                                                                                                 
                              13. apps/dav/appinfo/v1/webdav.php line 84                                                                                                                                            
                                  Sabre\DAV\Server->exec(                                                                                                                                                           
                                                                                                                                                                                                                    
                                  )                                                                                                                                                                                 
                              14. remote.php line 167                                                                                                                                                               
                                  require_once("\/var\/www\/nextcloud\/apps\/dav\/appinfo\/v1\/webdav.php")                                                                                                         
                                                                                                                                                                                                                    
                              Caused by OCP\AppFramework\Db\DoesNotExistException: token does not exist at .../private/Authentication/Token/DefaultTokenMapper.php line 94                                          
                                                                                                                                                                                                                    
                               0. lib/private/Authentication/Token/DefaultTokenProvider.php line 158                                                                                                                
                                  OC\Authentication\Token\DefaultTokenMapper->getToken("*** sensitive parameters replaced ***")                                                                                     
                               1. lib/private/Authentication/Token/Manager.php line 147                                                                                                                             
                                  OC\Authentication\Token\DefaultTokenProvider->getToken("*** sensitive parameters replaced ***")                                                                                   
                               2. lib/private/User/Session.php line 532                                                                                                                                             
                                  OC\Authentication\Token\Manager->getToken("*** sensitive parameters replaced ***")                                                                                                
                               3. lib/private/User/Session.php line 448                                                                                                                                             
                                  OC\User\Session->isTokenPassword("*** sensitive parameters replaced ***")                                                                                                         
                               4. apps/dav/lib/Connector/Sabre/Auth.php line 131                                                                                                                                    
                                  OC\User\Session->logClientIn("*** sensitive parameters replaced ***")                                                                                                             
                               5. 3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php line 103                                                                                                                
                                  OCA\DAV\Connector\Sabre\Auth->validateUserPass("*** sensitive parameters replaced ***")                                                                                           
                               6. apps/dav/lib/Connector/Sabre/Auth.php line 254                                                                                                                                    
                                  Sabre\DAV\Auth\Backend\AbstractBasic->check(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                        
                               7. apps/dav/lib/Connector/Sabre/Auth.php line 156                                                                                                                                    
                                  OCA\DAV\Connector\Sabre\Auth->auth(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                                 
                               8. 3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php line 182                                                                                                                               
                                  OCA\DAV\Connector\Sabre\Auth->check(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                                
                               9. 3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php line 137                                                                                                                               
                                  Sabre\DAV\Auth\Plugin->check(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                                       
                              10. 3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89                                                                                                                         
                                  Sabre\DAV\Auth\Plugin->beforeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                                
                              11. 3rdparty/sabre/dav/lib/DAV/Server.php line 456                                                                                                                                    
                                  Sabre\DAV\Server->emit("beforeMethod:PUT", [Sabre\HTTP\Request {},Sabre\HTTP\Response {}])                                                                                        
                              12. 3rdparty/sabre/dav/lib/DAV/Server.php line 253                                                                                                                                    
                                  Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})                                                                                                     
                              13. 3rdparty/sabre/dav/lib/DAV/Server.php line 321                                                                                                                                    
                                  Sabre\DAV\Server->start(                                                                                                                                                          
                                                                                                                                                                                                                    
                                  )                                                                                                                                                                                 
                              14. apps/dav/appinfo/v1/webdav.php line 84                                                                                                                                            
                                  Sabre\DAV\Server->exec(                                                                                                                                                           
                                                                                                                                                                                                                    
                                  )                                                                                                                                                                                 
                              15. remote.php line 167                                                                                                                                                               
                                  require_once("\/var\/www\/nextcloud\/apps\/dav\/appinfo\/v1\/webdav.php")                                                                                                         

  Debug    files_sharing      /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.                                                2021-10-10T18:03:42+00:00 

  Debug    files_external     /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.                                                2021-10-10T18:03:42+00:00 

  Debug    no app in context  OC\Authentication\Exceptions\InvalidTokenException: Token does not exist at .../Authentication/Token/DefaultTokenProvider.php line 160                      2021-10-10T18:03:43+00:00 
...

Logs are much more verbose but I am not allowed to post more.