not syncing: `TokenMismatchException`
This issue respects the following points:
- [x] I have read the FAQ
- [x] I have searched for existing issues
- [x] The issue affects the Notes Android app, neither the Notes server app nor the Nextcloud Android app.
Describe the bug
App Version: 4.3.1
App Version Code: 40030192
App Flavor: play
Files App Version Code: 30300890 (PROD)
---
OS Version: 5.15.153-android14-11-g1ea07643b6ac-ab12324537(12701944)
OS API Level: 35
Device: husky
Manufacturer: Google
Model (and Product): Pixel 8 Pro (husky)
---
java.lang.Exception: com.nextcloud.android.sso.exceptions.TokenMismatchException: Provided authentication token does not match or package name is not permitted to perform this action
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pushLocalChanges(NotesServerSyncTask.java:164)
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:100)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
java.lang.Exception: com.nextcloud.android.sso.exceptions.TokenMismatchException: Provided authentication token does not match or package name is not permitted to perform this action
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pushLocalChanges(NotesServerSyncTask.java:164)
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:100)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
java.lang.Exception: com.nextcloud.android.sso.exceptions.TokenMismatchException: Provided authentication token does not match or package name is not permitted to perform this action
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pushLocalChanges(NotesServerSyncTask.java:164)
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:100)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
java.lang.Exception: com.nextcloud.android.sso.exceptions.TokenMismatchException: Provided authentication token does not match or package name is not permitted to perform this action
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pushLocalChanges(NotesServerSyncTask.java:164)
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:100)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
java.lang.Exception: com.nextcloud.android.sso.exceptions.TokenMismatchException: Provided authentication token does not match or package name is not permitted to perform this action
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pushLocalChanges(NotesServerSyncTask.java:164)
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:100)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
java.lang.RuntimeException: com.nextcloud.android.sso.exceptions.TokenMismatchException: Provided authentication token does not match or package name is not permitted to perform this action
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:225)
at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:102)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: com.nextcloud.android.sso.exceptions.TokenMismatchException: Provided authentication token does not match or package name is not permitted to perform this action
at com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:179)
at com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:159)
at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$0(NextcloudAPI.java:97)
at com.nextcloud.android.sso.api.NextcloudAPI.$r8$lambda$af7W9mq2B0ZrhVJwZd-ibFp8T3Y(Unknown Source:0)
at com.nextcloud.android.sso.api.NextcloudAPI$$ExternalSyntheticLambda1.subscribe(D8$$SyntheticClass:0)
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
Expected behavior
The app works fine, but it says it isn't syncing and I haven't checked
Notes Android version
4.3.1
Notes server version
notes app40030192
Nextcloud Android version
nextcloud Android version 2
Nextcloud version
3.30.8
Device
Google Pixel 8
Android Version
5.15.153-android14-11-g1ea07643b6ac-ab12324537(12701944)
App Store
- [x] Google Play Store
- [ ] F-Droid
- [ ] Huawei App Gallery
Stacktrace
No response
What happend after performing the steps recommended for your error in the FAQ?
It said to force close and reopen And it continues to have the error
On Mon, Feb 3, 2025, 13:57 Niedermann IT-Dienstleistungen < @.***> wrote:
What happend after performing the steps recommended for your error in the FAQ?
— Reply to this email directly, view it on GitHub https://github.com/nextcloud/notes-android/issues/2569#issuecomment-2631942526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVOG2AQJWSWQPCGWIJ6JXBL2N7C3JAVCNFSM6AAAAABWM47LFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZRHE2DENJSGY . You are receiving this because you authored the thread.Message ID: @.***>
It also said to clear everything out I did that and lost all the un-synced notes. But it began to sync again now thanks
On Mon, Feb 3, 2025, 14:26 Jared Warner @.***> wrote:
It said to force close and reopen And it continues to have the error
On Mon, Feb 3, 2025, 13:57 Niedermann IT-Dienstleistungen < @.***> wrote:
What happend after performing the steps recommended for your error in the FAQ?
— Reply to this email directly, view it on GitHub https://github.com/nextcloud/notes-android/issues/2569#issuecomment-2631942526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVOG2AQJWSWQPCGWIJ6JXBL2N7C3JAVCNFSM6AAAAABWM47LFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZRHE2DENJSGY . You are receiving this because you authored the thread.Message ID: @.***>
Did you make and apply a backup? for example: did you change to a new phone and migrated all your data directly? Or didn't you do anything and it stopped working suddenly?
It seems I have the same version and the same problems, this happened after changing phones (from android 12 to 14, samsung brand). I transferred all the apps using the smart switch tooling. The notes app came via the f-droid store, as well as the nextcloud app and davx.
I have a related problem following the fact that only about 2/3 of my notes and tags were syncing. I had not noticed until I wanted to tag a note and noticed the tag in question did not come up. Then checked and noticed the missing notes and tags. Attempting to sync for the rest would simply achieve nothing. Either ending in no feedback, or some sync error. After trying to do the usual, delete cache, etc, I ended deleting it, and reinstalled.
I am on latest Note App on the server, on latest Stable Nextcloud Version, so 30.0.5. Have tried all of the last three Android Note App versions from F-Droid, so from 4.2.1+ if I recall, on top of latest DEV version from Github. All provide the same issue. Login screen pops up, asks to log on via the App, contact permission, just in case, is already allowed and it just hangs, with an endless loading bar, but no progress bar.
Sometimes going back to the login screen or sometimes I get an error. In fairness, I noticed a trend of getting errors while syncing after 4.2.X., and 4.3+ has been getting constant errors, ever since. Currently on Android 15. But I had an second phone on Android 7.0 and got the same.
On the newer phone, all apps are from Github of F-Droid. I run the latest Nextcloud Dev app from Github, and as of yesterday, that works fine. However, the Android NC apps has had some issues too, but that is outside of scope, here.
Below is a copy of the error I get on the notes app. Other apps, like the Password Android app seem to work and connect fine. Apologies for formatting, doing this on my phone on the go.
com.nextcloud.android.sso.exceptions.UnknownErrorException: Read timed out
at com.nextcloud.android.sso.api.AidlNetworkRequest.performNetworkRequestV2(AidlNetworkRequest.java:179)
at com.nextcloud.android.sso.api.NextcloudAPI.performNetworkRequestV2(NextcloudAPI.java:159)
at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$0(NextcloudAPI.java:97)
at com.nextcloud.android.sso.api.NextcloudAPI.$r8$lambda$af7W9mq2B0ZrhVJwZd-ibFp8T3Y(Unknown Source:0)
at com.nextcloud.android.sso.api.NextcloudAPI$$ExternalSyntheticLambda2.subscribe(D8$$SyntheticClass:0)
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.ObservableMap.subscribeActual(ObservableMap.java:32)
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)
at io.reactivex.Observable.blockingSingle(Observable.java:5381)
at it.niedermann.owncloud.notes.persistence.NotesImportTask.lambda$importNotes$1(NotesImportTask.java:62)
at it.niedermann.owncloud.notes.persistence.NotesImportTask.$r8$lambda$ktGqygXHhsMfgtLKNj-H6dy2ZiE(Unknown Source:0)
at it.niedermann.owncloud.notes.persistence.NotesImportTask$$ExternalSyntheticLambda2.run(D8$$SyntheticClass:0) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012) ```
As an update: I randomly tried to sync again tonight. As I need access to the notes on the cloud, and not having changed anything, it suddenly, just worked. I was able to update and sync all notes on the latest Note Dev build from the server. No errors. Go figure.
No idea as to why all of the sudden, it worked. But it did.
Just had this as well on Android. Notes didn't sync, the Nextcloud app itself did. I didn't want to delete my Notes data and lose my changes notes, so I tried adding the same Nextcloud account again to Notes. It complained the account already existed, but after a bit of spinning, it then synced again. So apparently this also refreshes the auth token and fixed the sync issues for me.