SyncClient (Windows): reject app password / automatic logout after few minutes

Hello,

I have a new nextcloud installation (by an webhoster, but no install package from the hoster), first I activated 2FA with the TOTP plugin. All seems to work properly, but not the sync client in windows. After a short while (about 5 to 10 minutes) it log out. Until the logout it works well, it syncs data, if there are data to sync, but then it logged out without any message. And I have to login again, with password, with TOTP-Code … it sucks a little bit.
I assumed, that the client needs an app password, but it does not accepted one, only my real account password works. Is this correct?

I have an nextcloud installation by this hoster for years, without problems. I did the login with another browser to avoid cookie problems (how does the login work?), I switched off my security suite (Kaspersky), but nothing helped.

maybe helpful information:
Nextcloud 17.0.1.1 by an webhoster (PHP 7.3, Apache
Sync Client 2.6.1 on Windows 10 (1903)

What can this be? What can I do? I’m helpless. And grateful for every advice. Thank you.

Dave

No, that’s not the case. App passwords can be used for that purpose.

Definitly not. Everytime I get the message “wrong username or password”. And I don’t know, how often I tried. Like I sayed, it’s an absolutely new installation. Can it be an bug in 17.0.1.1?

I don’t think so, because it works like a charm on my PCs and also on the devices of many other users. Have you checked the Nextcloud log file for any related messages?
You can also try to run the desktop client in debug mode to get hold of the root cause if the problem. Run “nextcloud.exe -h” to get the available command line options displayed.
Additionally it might be worse to check the list of open issues covering login problems:

https://github.com/nextcloud/desktop/search?q=login&state=open&type=Issues

BTW, you’ve ignored the issue template and didn’t provide any information about your environment, used software versions etc. which isn’t really helpful in this case.

hi

I encounter a similar problem. With desktop client, I was deconnect after 5 minutes.

In file nextcloud/lib/private/User/Session.php, there is a check of token validity each 5 minutes in ligne 676 :

 /**
     * @param IToken $dbToken
     * @param string $token
     * @return boolean
     */

    private function checkTokenCredentials(IToken $dbToken, $token) {
        // Check whether login credentials are still valid and the user was not disabled
        // This check is performed each 5 minutes
        $lastCheck = $dbToken->getLastCheck() ? : 0;
        $now = $this->timeFactory->getTime();
        //if ($lastCheck > ($now - 60 * 5)) {
        //BLODS check de la validité du token, si plus valide coupe la session => passé de 5 min à 8 heures
if ($lastCheck > ($now - 60 * 480)) {
            // Checked performed recently, nothing to do now
            return true;
        }

I change the
if ($lastCheck > ($now - 60 * 5)) {
to
if ($lastCheck > ($now - 60 * 480)) {

then i’m disconnect after 8 hours instead of 5 minutes.

cordialy

1 Like

I do not understand what’s wrong. I think, both problems (logout after few minutes and no acceptance of an app password) are dependant. Now I have reinstalled the client, with no success, same behaviour.

I can not connect my account on the another computer with this client, but I also cannot connect the other account with the client on my computer: everytime “wrong username or password”. What can this be? In the Log in Nextcloud I found only information like
[no app in context] Warning: Login failed: Chris (Remote IP: XX.XXX.XX.112)

I have a log from my client:

[OCC::Application::setupLogging 	"################## Nextcloud locale:[de_DE] ui_lang:[] version:[2.6.1stable-Win64 (build 20191105)] os:[Windows 10 (10.0)]"
[OCC::Application::setupTranslations 	Using "de_DE" translation
[OCC::SocketApi::SocketApi 	creating "//./pipe" true
[OCC::SocketApi::SocketApi 	server started, listening at  "\\\\.\\pipe\\ownCloud-Chris"
[OCC::FolderMan::FolderMan 	setting remote poll timer interval to 5000 msec
[OCC::AccountManager::loadAccountHelper 	Account for QUrl("https://cloud.XXXX.de") using auth type "webflow"
[OCC::WebFlowCredentials::createQNAM 	Get QNAM
[OCC::ownCloudGui::setupContextMenu 	Tray menu workarounds: noabouttoshow: false fakedoubleclick: false showhide: false manualvisibility: false
[OCC::AccessManager::createRequest 	6 "GET" "https://cloud.XXXX.de/ocs/v2.php/core/navigation/apps?absolute=true&format=json" has X-Request-ID "09f5a49a-6262-40f2-ba59-152f2d4dd3f3"
[OCC::AbstractNetworkJob::start 	OCC::OcsNavigationAppsJob created for "https://cloud.XXXX.de" + "ocs/v2.php/core/navigation/apps" ""
[OCC::FolderMan::setupFolders 	Setup folders from settings file
[OCC::defaultJournalMode 	Detected filesystem "NTFS" for "D:/myNextCloud/._sync_062dbd682ace.db"
[OCC::ConfigFile::setupDefaultExcludeFilePaths 	Adding user defined ignore list to csync: "C:/Users/Chris/AppData/Roaming/Nextcloud/sync-exclude.lst"
[OCC::FolderMan::addFolderInternal 	Adding folder to Folder Map  OCC::Folder(0x20a14db57e0) "1"
[OCC::FolderMan::scheduleFolder 	Schedule folder  "1"  to sync!
[OCC::FolderMan::scheduleFolder 	Folder is not ready to sync, not scheduled!
[OCC::ownCloudGui::slotSyncStateChange 	Sync state changed for folder  "https://cloud.XXXX.de/remote.php/webdav/" :  "Not yet Started"
[OCC::SyncJournalDb::checkConnect 	sqlite3 version "3.24.0"
[OCC::SyncJournalDb::checkConnect 	sqlite3 journal_mode= "wal"
[OCC::ClientProxy::setupQtProxyFromConfig 	Set proxy configuration to use the prefered system proxy for http tcp connections
[OCC::WebFlowCredentials::fetchFromKeychain 	Fetch from keychain!
[OCC::SocketApi::slotNewConnection 	New connection QLocalSocket(0x20a14f65120)
[OCC::WebFlowCredentials::slotReadClientCaCertsPEMJobDone 	Unable to read client CA cert slot  "0" "Password entry not found"
[OCC::WebFlowCredentials::slotReadClientCaCertsPEMJobDone 	Unable to read client CA cert slot  "0" "Password entry not found"
[OCC::AccountState::slotCredentialsFetched 	Fetched credentials for "https://cloud.XXXX.de" attempting to connect
[OCC::WebFlowCredentials::createQNAM 	Get QNAM
[OCC::ConnectionValidator::systemProxyLookupDone 	No system proxy set by OS
[OCC::AccessManager::createRequest 	2 "" "https://cloud.XXXX.de/status.php" has X-Request-ID "2a38e295-1d1e-4fa9-8f25-46ea0fc843aa"
[OCC::AbstractNetworkJob::start 	OCC::CheckServerJob created for "https://cloud.XXXX.de" + "status.php" "OCC::ConnectionValidator"
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::CheckServerJob::finished 	status.php returns:  QJsonDocument({"edition":"","extendedSupport":false,"installed":true,"maintenance":false,"needsDbUpgrade":false,"productname":"Nextcloud","version":"17.0.1.1","versionstring":"17.0.1"})   QNetworkReply::NoError  Reply:  QNetworkReplyHttpImpl(0x20a14e67490)
[OCC::ConnectionValidator::slotStatusFound 	** Application: ownCloud found:  QUrl("https://cloud.XXXX.de")  with version  "17.0.1" ( "17.0.1.1" )
[OCC::ConnectionValidator::setAndCheckServerVersion 	QUrl("https://cloud.XXXX.de") has server version "17.0.1.1"
[OCC::Account::setAppPassword::::operator() 	appPassword stored in keychain
[OCC::AccountState::slotConnectionValidatorResult 	AccountState connection status change:  OCC::ConnectionValidator::Undefined -> OCC::ConnectionValidator::CredentialsNotReady
[OCC::AccountState::handleInvalidCredentials 	Invalid credentials for "https://cloud.XXXX.de" asking user
[OCC::AccountState::setState 	AccountState state change:  "Getrennt" -> "Zugangsdaten werden abgefragt"
[OCC::FolderMan::slotAccountStateChanged 	Account "Chris@cloud.XXXX.de" disconnected or paused, terminating or descheduling sync folders
[OCC::AccessManager::createRequest 	4 "" "https://cloud.XXXX.de/index.php/login/v2" has X-Request-ID "91ab5d0a-3b27-495c-9865-19964c6f78ca"
[OCC::AbstractNetworkJob::start 	OCC::SimpleNetworkJob created for "https://cloud.XXXX.de" + "" "OCC::Account"
[OCC::WebFlowCredentials::askFromUser 	User needs to reauth!
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::Flow2Auth::openBrowser::::operator() 	setting remote poll timer interval to 5000 msec
[OCC::Account::setAppPassword::::operator() 	appPassword stored in keychain
[OCC::OCUpdater::backgroundCheckForUpdate 	Checking for available update
[OCC::AccessManager::createRequest 	2 "" "https://updates.nextcloud.org/client/?version=2.6.1.20191105&platform=win32&oem=Nextcloud&versionsuffix=stable-Win64" has X-Request-ID "86979527-e9f0-43a8-8bbf-c8ab18a510c4"
[OCC::NSISUpdater::versionInfoArrived 	Client is on latest version!
[OCC::AccessManager::createRequest 	4 "" "https://cloud.XXXX.de/index.php/login/v2/poll" has X-Request-ID "99cdbb0d-c5fd-473f-9687-b8339be10c4e"
[OCC::AbstractNetworkJob::start 	OCC::SimpleNetworkJob created for "https://cloud.XXXX.de" + "" "OCC::Account"
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::AbstractNetworkJob::slotFinished 	QNetworkReply::ContentNotFoundError "Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: " QVariant(int, 404)
[OCC::WebFlowCredentials::stillValid 	QNetworkReply::ContentNotFoundError
[OCC::WebFlowCredentials::stillValid 	"Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: "
[OCC::AccessManager::createRequest 	4 "" "https://cloud.XXXX.de/index.php/login/v2/poll" has X-Request-ID "38e2fa19-8d58-4ce5-92bb-e4e61c38e7e0"
[OCC::AbstractNetworkJob::start 	OCC::SimpleNetworkJob created for "https://cloud.XXXX.de" + "" "OCC::Account"
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::AbstractNetworkJob::slotFinished 	QNetworkReply::ContentNotFoundError "Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: " QVariant(int, 404)
[OCC::WebFlowCredentials::stillValid 	QNetworkReply::ContentNotFoundError
[OCC::WebFlowCredentials::stillValid 	"Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: "
[OCC::AccessManager::createRequest 	4 "" "https://cloud.XXXX.de/index.php/login/v2/poll" has X-Request-ID "a3635890-9608-4dcb-a574-edba48c31f9f"
[OCC::AbstractNetworkJob::start 	OCC::SimpleNetworkJob created for "https://cloud.XXXX.de" + "" "OCC::Account"
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::AbstractNetworkJob::slotFinished 	QNetworkReply::ContentNotFoundError "Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: " QVariant(int, 404)
[OCC::WebFlowCredentials::stillValid 	QNetworkReply::ContentNotFoundError
[OCC::WebFlowCredentials::stillValid 	"Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: "
[OCC::AccessManager::createRequest 	4 "" "https://cloud.XXXX.de/index.php/login/v2/poll" has X-Request-ID "b54f2b09-b2ca-459d-90ea-a81863f00db7"
[OCC::AbstractNetworkJob::start 	OCC::SimpleNetworkJob created for "https://cloud.XXXX.de" + "" "OCC::Account"
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::AbstractNetworkJob::slotFinished 	QNetworkReply::ContentNotFoundError "Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: " QVariant(int, 404)
[OCC::WebFlowCredentials::stillValid 	QNetworkReply::ContentNotFoundError
[OCC::WebFlowCredentials::stillValid 	"Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: "
[OCC::AccessManager::createRequest 	4 "" "https://cloud.XXXX.de/index.php/login/v2/poll" has X-Request-ID "f07d7c43-a205-476b-9513-dc72629597ac"
[OCC::AbstractNetworkJob::start 	OCC::SimpleNetworkJob created for "https://cloud.XXXX.de" + "" "OCC::Account"
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::AbstractNetworkJob::slotFinished 	QNetworkReply::ContentNotFoundError "Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: " QVariant(int, 404)
[OCC::WebFlowCredentials::stillValid 	QNetworkReply::ContentNotFoundError
[OCC::WebFlowCredentials::stillValid 	"Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: "
[OCC::AccessManager::createRequest 	4 "" "https://cloud.XXXX.de/index.php/login/v2/poll" has X-Request-ID "c4ec690d-8231-44fd-a5a4-9fade8206b8d"
[OCC::AbstractNetworkJob::start 	OCC::SimpleNetworkJob created for "https://cloud.XXXX.de" + "" "OCC::Account"
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::AbstractNetworkJob::slotFinished 	QNetworkReply::ContentNotFoundError "Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: " QVariant(int, 404)
[OCC::WebFlowCredentials::stillValid 	QNetworkReply::ContentNotFoundError
[OCC::WebFlowCredentials::stillValid 	"Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: "
[OCC::AccessManager::createRequest 	4 "" "https://cloud.XXXX.de/index.php/login/v2/poll" has X-Request-ID "e30d2f23-fba9-40c2-98b1-e7941d38302f"
[OCC::AbstractNetworkJob::start 	OCC::SimpleNetworkJob created for "https://cloud.XXXX.de" + "" "OCC::Account"
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::AbstractNetworkJob::slotFinished 	QNetworkReply::ContentNotFoundError "Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: " QVariant(int, 404)
[OCC::WebFlowCredentials::stillValid 	QNetworkReply::ContentNotFoundError
[OCC::WebFlowCredentials::stillValid 	"Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: "
[OCC::AccessManager::createRequest 	4 "" "https://cloud.XXXX.de/index.php/login/v2/poll" has X-Request-ID "eb5dff18-86d0-4c9a-8999-862c77775c78"
[OCC::AbstractNetworkJob::start 	OCC::SimpleNetworkJob created for "https://cloud.XXXX.de" + "" "OCC::Account"
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::AbstractNetworkJob::slotFinished 	QNetworkReply::ContentNotFoundError "Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: " QVariant(int, 404)
[OCC::WebFlowCredentials::stillValid 	QNetworkReply::ContentNotFoundError
[OCC::WebFlowCredentials::stillValid 	"Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: "
[OCC::AccessManager::createRequest 	4 "" "https://cloud.XXXX.de/index.php/login/v2/poll" has X-Request-ID "08dcff5d-2d9d-4f0c-9683-17dca11ef315"
[OCC::AbstractNetworkJob::start 	OCC::SimpleNetworkJob created for "https://cloud.XXXX.de" + "" "OCC::Account"
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::AbstractNetworkJob::slotFinished 	QNetworkReply::ContentNotFoundError "Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: " QVariant(int, 404)
[OCC::WebFlowCredentials::stillValid 	QNetworkReply::ContentNotFoundError
[OCC::WebFlowCredentials::stillValid 	"Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: "
[OCC::AccessManager::createRequest 	4 "" "https://cloud.XXXX.de/index.php/login/v2/poll" has X-Request-ID "ff44d880-ff32-4a58-a6e2-bf937ed5447e"
[OCC::AbstractNetworkJob::start 	OCC::SimpleNetworkJob created for "https://cloud.XXXX.de" + "" "OCC::Account"
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::AbstractNetworkJob::slotFinished 	QNetworkReply::ContentNotFoundError "Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: " QVariant(int, 404)
[OCC::WebFlowCredentials::stillValid 	QNetworkReply::ContentNotFoundError
[OCC::WebFlowCredentials::stillValid 	"Error transferring https://cloud.XXXX.de/index.php/login/v2/poll - server replied: "
[OCC::AccessManager::createRequest 	6 "GET" "https://cloud.XXXX.de/ocs/v2.php/core/navigation/apps?absolute=true&format=json" has X-Request-ID "348806bc-3667-4d30-a007-e246ceea1efd"
[OCC::AbstractNetworkJob::start 	OCC::OcsNavigationAppsJob created for "https://cloud.XXXX.de" + "ocs/v2.php/core/navigation/apps" ""
[OCC::WebFlowCredentials::slotFinished 	request finished
[OCC::WebFlowCredentials::stillValid 	QNetworkReply::AuthenticationRequiredError
[OCC::WebFlowCredentials::stillValid 	"Error transferring https://cloud.XXXX.de/ocs/v2.php/core/navigation/apps?absolute=true&format=json - server replied: "
[OCC::OcsJob::finished 	Reply to "GET" QUrl("https://cloud.XXXX.de/ocs/v2.php/core/navigation/apps") (QPair("absolute","true")) has unexpected status code: 997 "{\"ocs\":{\"meta\":{\"status\":\"failure\",\"statuscode\":997,\"message\":\"Current user is not logged in\"},\"data\":[]}}"
[OCC::AccountManager::saveAccount 	Saving account "https://cloud.XXXX.de"
[OCC::AccountManager::saveAccountHelper 	Saving  0  unknown certs.
[OCC::AccountManager::saveAccountHelper 	Saving cookies. "C:/Users/Chris/AppData/Local/Nextcloud/cookies0.db"
[OCC::AccountManager::saveAccount 	Saved account settings, status: QSettings::NoError
[OCC::AccountManager::saveAccountHelper 	Saving  0  unknown certs.
[OCC::AccountManager::saveAccountHelper 	Saving cookies. "C:/Users/Chris/AppData/Local/Nextcloud/cookies0.db"
[OCC::AccountManager::save 	Saved all account settings, status: QSettings::NoError
[OCC::SyncJournalDb::close 	Closing DB "D:/myNextCloud/._sync_062dbd682ace.db"
[OCC::SocketApi::~SocketApi 	dtor
[OCC::SocketApi::onLostConnection 	Lost connection  QLocalSocket(0x20a14f65120)

It’s a new installation, and I don’t know what I can do. Because I had this problem with my last, years old installation too I assume, a new installation again is useless.

What can I do?

Hello,

Same problem for me, it started to happen using LDAPs authentication with 2FA (I’m using Duo).
By default, it logs me out after 5 minutes (Web interface, haven’t tested the client yet).

Before this I was using Internal authentication + TOTP with no problem using the application code.

Installation is an upgrade, NextCloud 18.0.1

John

Thanks this helped me stretch the logout time upto a week.
Although I never want users to be logged out.