Repository navigation
Sync fails on duplicated http headers after upgrading to version 4.5.0 #2848
Copy link
Copy link
Closed
Labels
Description
This issue respects the following points:
- I have read the FAQ
- I have searched for existing issues
- The issue affects the Notes Android app, neither the Notes server app nor the Nextcloud Android app.
Describe the bug
After I updated the Notes app from version 4.4.2 to 4.5.0, the synchronization is failing with an error. It turns out that it can no longer handle duplicated HTTP headers. But in the Nginx configuration from the documentation the header "X-Robots-Tag" is added twice. As a workaround, the header can be removed from the PHP response and readded just once. See my comment below.
Expected behavior
The app should properly handle duplicate headers, especially if they have the same value. And even if it does not, the App should not care about it at all.
Notes Android version
4.5.0
Notes server version
4.12.3
Nextcloud Android version
3.34.0
Nextcloud version
31.0.9
Device
Xiaomi Poco F3 (alioth)
Android Version
16
App Store
- Google Play Store
- F-Droid
- Huawei App Gallery
Stacktrace
09-28 00:06:37.678 E/InputStreamBinder(31862): Error during Nextcloud request
09-28 00:06:37.678 E/InputStreamBinder(31862): java.lang.IllegalStateException: CE_5
09-28 00:06:37.678 E/InputStreamBinder(31862): at com.nextcloud.android.sso.InputStreamBinder.processRequestV2(InputStreamBinder.java:440)
09-28 00:06:37.678 E/InputStreamBinder(31862): at com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestAndBodyStreamV2(InputStreamBinder.java:113)
09-28 00:06:37.678 E/InputStreamBinder(31862): at com.nextcloud.android.sso.InputStreamBinder.performNextcloudRequestV2(InputStreamBinder.java:96)
09-28 00:06:37.678 E/InputStreamBinder(31862): at com.nextcloud.android.sso.aidl.IInputStreamService$Stub.onTransact(IInputStreamService.java:108)
09-28 00:06:37.678 E/InputStreamBinder(31862): at android.os.Binder.execTransactInternal(Binder.java:1421)
09-28 00:06:37.678 E/InputStreamBinder(31862): at android.os.Binder.execTransact(Binder.java:1365)
09-28 00:06:37.678 E/InputStreamBinder(31862): Caused by: java.lang.IllegalStateException: 304
09-28 00:06:37.678 E/InputStreamBinder(31862): ... 6 more
09-28 00:06:37.678 E/InputStreamBinder(31862): Caused by: java.lang.IllegalStateException: No response body
09-28 00:06:37.678 E/InputStreamBinder(31862): ... 6 more
09-28 00:06:37.684 D/NotesServerSyncTask(28041): Server returned HTTP Status Code 304 - Notes not modified.
09-28 00:06:37.684 I/NotesServerSyncTask(28041): SYNCHRONIZATION FINISHED
09-28 00:06:37.684 E/com.nextcloud.android.sso.aidl.ParcelFileDescriptorUtil.TransferThread(31862): writing failed: write failed: EPIPE (Broken pipe)
09-28 00:06:37.684 D/InputStreamBinder(31862): Done sending result
09-28 00:06:37.684 E/NotesRepository(28041): Duplicate key X-Robots-Tag (attempted merging values noindex, nofollow and noindex, nofollow)[java.util.stream.Collectors.duplicateKeyException(Collectors.java:135), java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182), java.util.stream.Collectors$$ExternalSyntheticLambda1.accept(D8$$SyntheticClass:0), java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169), java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1725), java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513), java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:503), java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921), java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:236), java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:705), com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$execute$0(Retrofit2Helper.java:57), com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda2.apply(D8$$SyntheticClass:0), java.util.Optional.map(Optional.java:260), com.nextcloud.android.sso.helper.Retrofit2Helper$1.execute(Retrofit2Helper.java:55), it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pushLocalChanges(NotesServerSyncTask.java:130), it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:99), java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:524), java.util.concurrent.FutureTask.run(FutureTask.java:317), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:651), java.lang.Thread.run(Thread.java:1119)]
09-28 00:06:37.684 E/NotesRepository(28041): java.lang.Exception: Duplicate key X-Robots-Tag (attempted merging values noindex, nofollow and noindex, nofollow)[java.util.stream.Collectors.duplicateKeyException(Collectors.java:135), java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182), java.util.stream.Collectors$$ExternalSyntheticLambda1.accept(D8$$SyntheticClass:0), java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169), java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1725), java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513), java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:503), java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921), java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:236), java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:705), com.nextcloud.android.sso.helper.Retrofit2Helper$1.lambda$execute$0(Retrofit2Helper.java:57), com.nextcloud.android.sso.helper.Retrofit2Helper$1$$ExternalSyntheticLambda2.apply(D8$$SyntheticClass:0), java.util.Optional.map(Optional.java:260), com.nextcloud.android.sso.helper.Retrofit2Helper$1.execute(Retrofit2Helper.java:55), it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pushLocalChanges(NotesServerSyncTask.java:130), it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:99), java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:524), java.util.concurrent.FutureTask.run(FutureTask.java:317), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:651), java.lang.Thread.run(Thread.java:1119)]
09-28 00:06:37.684 E/NotesRepository(28041): at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pushLocalChanges(NotesServerSyncTask.java:150)
09-28 00:06:37.684 E/NotesRepository(28041): at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:99)
09-28 00:06:37.684 E/NotesRepository(28041): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:524)
09-28 00:06:37.684 E/NotesRepository(28041): at java.util.concurrent.FutureTask.run(FutureTask.java:317)
09-28 00:06:37.684 E/NotesRepository(28041): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
09-28 00:06:37.684 E/NotesRepository(28041): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:651)
09-28 00:06:37.684 E/NotesRepository(28041): at java.lang.Thread.run(Thread.java:1119)
Reactions are currently unavailable
Activity
xTGHHx commentedon Sep 28, 2025
Same here!
[-]Sync error on Android 16[/-][+][Regression 4.5.0] Sync failing[/+]andrewille commentedon Sep 29, 2025
Issue is not present on Notes release 4.4.2. Just download the older APK file from here, install it and do NOT update it until a fix is implemented.
[-][Regression 4.5.0] Sync failing[/-][+]Sync fails with "sync failed" error after upgrading to version 4.5.0[/+]realquink commentedon Sep 30, 2025
I also get the same issue with the new version.
fdauti commentedon Sep 30, 2025
Yep, same, going to the previous apk now
[-]Sync fails with "sync failed" error after upgrading to version 4.5.0[/-][+]Sync fails on duplicated http headers after upgrading to version 4.5.0[/+]andrewille commentedon Sep 30, 2025
Quick update:
As you could see in my stacktrace, it is caused by the duplicated HTTP header "X-Robots-Tag". I think this only affects nginx configurations since the default apache config (.htaccess) would drop these headers and then readd it just once. Obviously this is something that the notes app should be able to handle, but in the meantime you can also use this workaround if you host a Nextcloud instance that is used by others than you so they can keep using the newest App. We can just make nginx behave the same way and drop the multiple headers.
Add the following one line to your nginx configuration:
rodrigoaguilera commentedon Oct 1, 2025
Great, removing the header made the sync work again.
What is the other part in which the header is added? The PHP code?
In that case the docs for nginx should be updated
https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html
skleber commentedon Oct 2, 2025
Same here too
tm-107 commentedon Oct 5, 2025
Just did a fresh install with apache & nextcloud (both with default configs) ...
-> "NoteDoesNotExistException Controller failed with OCA\Notes\Service\NoteDoesNotExistException Controller failed with OCA\Notes\Service\NoteDoesNotExistException"
With the Notes app v4.4.2 on Android, everything is fine...
1 remaining item
hpvb commentedon Oct 7, 2025
Same problem and same solution here. I'm installing from f-droid if that matters.
Rolling back to 4.4.2 solves the problem for me also.
Croydon commentedon Oct 8, 2025
Same for me.
Seems like Notes has multiple problems with HTTP headers. I can't find the related issues anymore, but there is one, that Notes is case-sensitive when it comes to HTTP headers, which according to spec they should be treated case insensitive. Which causes that Notes is downloading all notes again, if the timestamp (?) HTTP headers are in another casing then the expected one.
So, Notes needs probably in general a more robust HTTP header handling.
Edit: Found it: #2531
nixos/nextcloud: avoid duplicate X-Robots-Tag header
Schneehexe commentedon Oct 10, 2025
Same problem and solution here. Install from f-droid.
I made a Rollback to 4.4.2, so it do well again.
nixos/nextcloud: avoid duplicate X-Robots-Tag header
alperozturk96 commentedon Oct 13, 2025
@andrewille
Hello.
It appears that the issue originates from the
SingleSignOnlibrary version used in the Notes app v4.5.0.I’ve submitted a pull request to address the problem, and the change is included in this QA version.
Could you please test it and let us know if the issue is resolved?
Thank you.
korelstar commentedon Oct 13, 2025
@alperozturk96 : I've tested your fix nextcloud/Android-SingleSignOn#907 and it works for me! Thank you very much!