notes-android icon indicating copy to clipboard operation
notes-android copied to clipboard

Exception -> IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY

Open pawlosck opened this issue 1 year ago • 3 comments

This issue respects the following points:

Describe the bug

  1. Touch widget (single note) to open app.
  2. App should open specified note, but open new note -> It's first bug, but its related bug
  3. Press twice Back button (first close keyboard, second switch app to list of notes) - Exception sometimes is not visible. You should close all app and start again
  4. If you can't reproduce it, try remove note from android app
  5. App show exception when trying to sync

If I remember well, it happen when I copied some text from website to notes app (web app). Copied text was converted to table. After that, notes app (android) show exception and specified note from widget can't be opened.

I tried to fix it, but it doesn't work. I removed app from server, renamed Notes dir and cleared storage for notes app (android). I installed app on the server and logged in on the android (notes app) After installation was ok, but there wasn't any note. When I copied old notes to new dir, app started show the same exception.

I suppose, problem is located on the server. Probably some text was incorrectly stored into database. How to clear all settings related to notes app? Maybe it fix it. I am using sqlite database.

Expected behavior

App should open specified note and sync without errors

Notes Android version

4.2.1

Notes server version

4.10

Nextcloud Android version

3.29

Nextcloud version

28.0.3

Device

Samsung Galaxy S24

Android Version

14

App Store

  • [ ] Google Play Store
  • [X] F-Droid
  • [ ] Huawei App Gallery

Stacktrace

App Version: 4.2.1
App Version Code: 40020190
App Flavor: fdroid

Files App Version Code: 30290090 (PROD)

---

OS Version: 6.1.25-android14-11-28243294-abS928BXXS2AXD6(S928BXXS2AXD6)
OS API Level: 34
Device: e3q
Manufacturer: samsung
Model (and Product): SM-S928B (e3qxeea)

---

java.lang.Exception: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
	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: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)

pawlosck avatar Jun 12 '24 12:06 pawlosck

Given the stacktrace seems to be similar, maybe this might help?

stefan-niedermann avatar Jun 12 '24 12:06 stefan-niedermann

It's different problem. I disabled mail app (it's official app probably), restarted phone and restarted apache. Exception don't want to go away :(.

EDIT: I don't use Rainloop, Snappymail and other mail app with nextcloud

pawlosck avatar Jun 12 '24 13:06 pawlosck

Looks like I'm getting the same error on my phone and tablet:

App Version: 4.2.1
App Version Code: 40020190
App Flavor: fdroid

Files App Version Code: 30290090 (PROD)

---

OS Version: 4.19.113-27114284(T878USQS8DXE1)
OS API Level: 33
Device: gts7l
Manufacturer: samsung
Model (and Product): SM-T878U (gts7lsqwnc)

---

java.lang.Exception: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
	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: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)
App Version: 4.2.1
App Version Code: 40020190
App Flavor: fdroid

Files App Version Code: 30290090 (PROD)

---

OS Version: 4.14.340-perf-g065a3bb48b97(138)
OS API Level: 34
Device: OnePlus7Pro
Manufacturer: OnePlus
Model (and Product): GM1911 (OnePlus7Pro)

---

java.lang.Exception: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
	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: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)

bigrjsuto avatar Jun 24 '24 23:06 bigrjsuto

I suppose, problem is located on the server. Probably some text was incorrectly stored into database.

Can you check your Nextcloud Server log for clues during these events?

joshtrichards avatar Apr 17 '25 19:04 joshtrichards

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

github-actions[bot] avatar May 16 '25 01:05 github-actions[bot]