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.
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.
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)
This issue respects the following points:
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
Stacktrace