Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync is sometimes not working with oCIS and working again after restart #8538

Closed
wkloucek opened this issue Apr 7, 2021 · 11 comments · Fixed by owncloud/ocis#2188
Closed
Labels
Linux Needs info oCIS ownCloud Infinite Scale related p3-medium Normal priority Server Involved type:bug

Comments

@wkloucek
Copy link

wkloucek commented Apr 7, 2021

Expected behaviour

Client should recover itself.

Actual behaviour

client stops sync because of following error (also see logs).
image

After a restart of the client the sync works again.

Steps to reproduce

Happens only sporadically

Server configuration

Web server: oCIS 1.3.0

Client configuration

Client version: 2.7.6

Operating system: Manjaro / Linux

OS language: English

Qt version used by client package (Linux only, see also Settings dialog): 5.15.2

Client package (From ownCloud or distro) (Linux only): distro

Installation path of client:

Logs

Please use Gist (https://gist.github.com/) or a similar code paster for longer
logs.

04-07 11:57:46:152 [ debug sync.account ]	[ OCC::Account::resetNetworkAccessManager ]:	Resetting QNAM
04-07 11:57:46:152 [ debug sync.connectionvalidator ]	[ OCC::ConnectionValidator::checkServerAndAuth ]:	Checking server and authentication
04-07 11:57:46:152 [ debug sync.connectionvalidator ]	[ OCC::ConnectionValidator::checkServerAndAuth ]:	Trying to look up system proxy
04-07 11:57:46:153 [ info sync.connectionvalidator ]:	No system proxy set by OS
04-07 11:57:46:154 [ info sync.accessmanager ]:	2 "" "https://ocis.team.owncloud.works/status.php" has X-Request-ID "00937635-f035-4957-ad6a-6854d2cc23a3"
04-07 11:57:46:154 [ debug sync.cookiejar ]	[ OCC::CookieJar::cookiesForUrl ]:	QUrl("https://ocis.team.owncloud.works/status.php") requests: ()
04-07 11:57:46:154 [ info sync.httplogger ]:	"00937635-f035-4957-ad6a-6854d2cc23a3: Request: GET https://ocis.team.owncloud.works/status.php Header: { Authorization: Bearer [redacted], User-Agent: Mozilla/5.0 (Linux) mirall/2.7.6 (ownCloud, manjaro-5.11.6-1-MANJARO ClientArchitecture: x86_64 OsArchitecture: x86_64), Accept: */*, X-Request-ID: 00937635-f035-4957-ad6a-6854d2cc23a3, } Data: []"
04-07 11:57:46:154 [ info sync.networkjob ]:	OCC::CheckServerJob created for "https://ocis.team.owncloud.works" + "status.php" "OCC::ConnectionValidator"
04-07 11:57:46:339 [ info sync.httplogger ]:	"00937635-f035-4957-ad6a-6854d2cc23a3: Response: GET 401 https://ocis.team.owncloud.works/status.php Header: { Content-Length: 0, Date: Wed, 07 Apr 2021 09:57:46 GMT, } Data: []"
04-07 11:57:46:339 [ warning sync.networkjob.checkserver ]:	error: status.php replied  401 ""
04-07 11:57:46:339 [ warning sync.connectionvalidator ]:	QNetworkReply::AuthenticationRequiredError "Host requires authentication" ""
04-07 11:57:46:339 [ debug gui.account.settings ]	[ OCC::AccountSettings::showConnectionLabel ]:	"No connection to ownCloud at <a href=\"https://ocis.team.owncloud.works\">https://ocis.team.owncloud.works</a>.\nAuthentication error: Either username or password are wrong."
04-07 11:57:46:340 [ debug sync.database.sql ]	[ OCC::SqlQuery::bindValue ]:	SQL bind 1 3
04-07 11:57:46:340 [ debug sync.database.sql ]	[ OCC::SqlQuery::exec ]:	SQL exec "SELECT path FROM selectivesync WHERE type=?1"
04-07 11:57:46:340 [ info gui.folder.manager ]:	Account "[email protected]" disconnected or paused, terminating or descheduling sync folders
04-07 11:57:46:340 [ debug sync.networkjob ]	[ OCC::AbstractNetworkJob::slotFinished ]:	Network job OCC::CheckServerJob finished for "status.php"
  1. Client logfile: Output of owncloud --logwindow or owncloud --logfile log.txt
    (On Windows using cmd.exe, you might need to first cd into the ownCloud directory)
    (See also https://doc.owncloud.org/desktop/troubleshooting.html#log-files )

  2. Server logfile: oCIS log:

ocis_1      | {"level":"error","service":"proxy","error":"401 Unauthorized: {\"error\":\"invalid_token\",\"error_description\":\"Token verification failed\"}","time":"2021-04-07T12:14:41.460691943Z","message":"Failed to get userinfo"}
@fmoc fmoc added Linux oCIS ownCloud Infinite Scale related labels Apr 14, 2021
@github-actions
Copy link

This issue was marked stale because it has been open for 30 days with no activity. Remove the stale label or comment or this will be closed in 7 days.

@micbar
Copy link
Contributor

micbar commented Jun 10, 2021

same issue here. A simple restart of the desktop client fixes the problem.

@michaelstingl michaelstingl added the p3-medium Normal priority label Jun 10, 2021
@michaelstingl
Copy link
Contributor

status.php replied 401

This sounds very 🐟 -y. status.php is always unauthenticated. I'd recommend to add the X-Request-ID to the logs and to Jaeger.

@wkloucek
Copy link
Author

status.php replied 401

This sounds very -y. status.php is always unauthenticated. I'd recommend to add the X-Request-ID to the logs and to Jaeger.

It is unauthenticated, but if you send an authorization header, it will be checked and returns 401 if it is not valid. I will investigate if its easily possible to change that and ignore it completely on that route.

@michaelstingl
Copy link
Contributor

michaelstingl commented Jun 16, 2021

but if you send an authorization header

@TheOneRing Could you check why we send bearer auth to the status.php? Do we support setups behind basic auth protection?

@wkloucek client was initially setup with OIDC?

@TheOneRing Another case of unwanted fallback to basic auth?

@wkloucek
Copy link
Author

but if you send an authorization header

@TheOneRing Could you check why we send basic auth to the status.php? Do we support setups behind basic auth protection?

@wkloucek client was initially setup with OIDC?

@TheOneRing Another case of unwanted fallback to basic auth?

I tested it with OIDC, where you have the token in the authentication header like eg. Bearer eyJhbGciOiJQUzI1NiIsImtpZCI6IiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ3ZWIiLCJleHAiOjE2Mj....
I did not test with basic auth.

@michaelstingl
Copy link
Contributor

@wkloucek See me modified comment

@wkloucek
Copy link
Author

@michaelstingl I added a PR to oCIS so that you can send whatever authorization header you like to oCIS and it will ignore it on the /status.php endpoint. Should we try this first or do you want to investigate in the client first?

@michaelstingl
Copy link
Contributor

No need to wait. I can always check with mitmproxy or the builtin http logger. Thanks 👍

@wkloucek
Copy link
Author

wkloucek commented Jul 1, 2021

Did not happen to me in the last 3 days (since we deployed oCIS 1.8.0). @micbar Did you have it again?

@micbar
Copy link
Contributor

micbar commented Jul 1, 2021

Seems fixed. Connection is stable since the upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux Needs info oCIS ownCloud Infinite Scale related p3-medium Normal priority Server Involved type:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants