nextcloud / nextcloud/notes-android

`HTTP 401` (reauthenticate by Nextcloud Android app was possible): `NextcloudHttpRequestFailedException`

Open
#1,528 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
Java
Stars
1.1k
Forks
168
Avg merge
1d 17h
Merged PRs (30d)
31

Description

Describe the bug

After using notes for a time, it began failing to synchronize. The error is something about auth and CORS, but I do not see a way to re-authenticate without erasing the account and starting over (which I don't want to do because notes aren't syncronized).

To Reproduce

I am unsure how to reproduce the issue.

Expected behavior

Notes sync.

Smartphone (please complete the following information):

  • Nextcloud Notes-Version (android app): 3.5.00
  • F-Droid or Play Store: F-droid
  • Android-Version: LineageOS Nightly (May 27th)
  • Device: Asus Zenphone 8

Server

  • Nextcloud version: Unknown
  • Nextcloud Notes version (server app): Unknown

(I am not the administrator of the instance and see no way to get this information from the app; if there's an easy way to find this please advise)

Stacktrace

App Version: 3.5.00
App Version Code: 3005000
App Flavor: fdroid

Files App Version Code: 30200190

---

OS Version: 5.4.161-qgki-perf-gc654c7a3ab52(408cf67e3f)
OS API Level: 32
Device: ASUS_I006D
Manufacturer: asus
Model (and Product): ASUS_I006D (WW_I006D)

---

java.lang.Exception: {"message":"CORS requires basic auth"}

at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pushLocalChanges(NotesServerSyncTask.java:174)
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:94)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)


java.lang.RuntimeException: com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException: HTTP request failed with HTTP status-code: 401
at io.reactivex.internal.util.ExceptionHelper.wrapOrThrow(ExceptionHelper.java:46)
at io.reactivex.internal.observers.BlockingMultiObserver.blockingGet(BlockingMultiObserver.java:93)
at io.reactivex.Maybe.blockingGet(Maybe.java:2321)
at io.reactivex.Observable.blockingSingle(Observable.java:5381)
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pullRemoteChanges(NotesServerSyncTask.java:219)
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:96)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)
Caused by: com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException: HTTP request failed with HTTP status-code: 401
at com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:188)
at com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:199)
at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$com-nextcloud-android-sso-api-NextcloudAPI(NextcloudAPI.java:129)
at com.nextcloud.android.sso.api.NextcloudAPI$$ExternalSyntheticLambda2.subscribe(Unknown Source:6)
at io.reactivex.internal.operators.observable.ObservableFromPublisher.subscribeActual(ObservableFromPublisher.java:31)
at io.reactivex.Observable.subscribe(Observable.java:12284)
at io.reactivex.internal.operators.observable.ObservableSingleMaybe.subscribeActual(ObservableSingleMaybe.java:31)
at io.reactivex.Maybe.subscribe(Maybe.java:4290)
at io.reactivex.Maybe.blockingGet(Maybe.java:2320)
... 8 more
Caused by: java.lang.IllegalStateException: {"message":"CORS requires basic auth"}

at com.nextcloud.android.sso.InputStreamBinder.processRequestV2(InputStreamBinder.java:455)
at com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestAndBodyStreamV2(InputStreamBinder.java:128)
at com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestV2(InputStreamBinder.java:111)
at com.nextcloud.android.sso.aidl.IInputStreamService$Stub.onTransact(IInputStreamService.java:158)
at android.os.Binder.execTransactInternal(Binder.java:1179)
at android.os.Binder.execTransact(Binder.java:1143)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with NotesServerSyncTask.java at pushLocalChanges (line 174) and pullRemoteChanges (line 219), then trace the reported NextcloudHttpRequestFailedException and CORS 401 stacktrace. Establish a reproducible authentication failure and verify that notes synchronize again without erasing the account.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
authentication, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.