android icon indicating copy to clipboard operation
android copied to clipboard

Folder content not displayed (/Documents) getting "Server not available" seems to get unexpected server response

Open Shekesh opened this issue 2 years ago • 8 comments

⚠️ Before posting ⚠️

  • [X] This is a bug, not a question or an enhancement.
  • [X] I've searched for similar issues and didn't find a duplicate.
  • [X] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • [X] I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

  1. Open "Documents" folder in root Directory

Expected behaviour

Getting "Documents" folder contents displayed

Actual behaviour

Getting "Server not found" and no folder contents listed

Android version

14

Device brand and model

Google Pixel 7a

Stock or custom OS?

Stock

Nextcloud android app version

3.26.0

Nextcloud server version

27.1.2

Using a reverse proxy?

Yes

Android logs

10-07 08:47:43.396 28706  4370 D RefreshFolderOperation: Remote folder / changed - starting update of local data 
10-07 08:47:43.396 28706  4370 D FileDataStorageManager: getFolderContent - start
10-07 08:47:43.424 28706  4370 D FileDataStorageManager: getFolderContent - finished
10-07 08:47:43.438 28706  4370 D FileDataStorageManager: Saving folder / with 63 children and 0 files to remove
10-07 08:47:43.460 28706  4370 D FileDataStorageManager: Sending 64 operations to FileContentProvider
10-07 08:47:43.461 28706  4370 D FileContentProvider: applying batch in provider com.owncloud.android.providers.FileContentProvider@7615ac3 (temporary: false)
10-07 08:47:43.562 28706  4370 D FileContentProvider: applied batch in provider com.owncloud.android.providers.FileContentProvider@7615ac3
10-07 08:47:43.568 28706  4370 D RefreshFolderOperation: Send broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED
10-07 08:47:43.570 28706  4370 D OwnCloudClient #2: REQUEST GET /ocs/v2.php/apps/files_sharing/api/v1/shares
10-07 08:47:43.583 28706 28706 D FileDisplayActivity: Received broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED
10-07 08:47:43.587 28706 28706 D FileDisplayActivity: Setting progress visibility to true
10-07 08:47:43.899  4974 10937 D ModemODPMPoller: Current Modem ODPM (mw): 35, threshold: 800
10-07 08:47:43.957 28706  4370 D GetSharesForFileRemoteOperation: Got 0 shares
10-07 08:47:43.962 28706  4370 D FileDataStorageManager: getFolderContent - start
10-07 08:47:43.996 28706  4370 D FileDataStorageManager: getFolderContent - finished
10-07 08:47:43.997 28706  4370 D FileDataStorageManager: Sending 63 operations to FileContentProvider
10-07 08:47:43.998 28706  4370 D FileContentProvider: applying batch in provider com.owncloud.android.providers.FileContentProvider@7615ac3 (temporary: false)
10-07 08:47:44.176 28706  4370 D FileContentProvider: applied batch in provider com.owncloud.android.providers.FileContentProvider@7615ac3
10-07 08:47:44.176 28706  4370 D RefreshFolderOperation: Send broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED
10-07 08:47:44.177 28706 28706 D FileDisplayActivity: Received broadcast com.owncloud.android.operations.RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED
10-07 08:47:44.179 28706 28706 D FileDisplayActivity: Setting progress visibility to false
10-07 08:47:44.180 28706 28706 D FileDataStorageManager: getFolderContent - start
10-07 08:47:44.183 28706 28706 D FileDataStorageManager: getFolderContent - finished
10-07 08:47:44.521  1477  1511 D RILClient: [OemClient]IND: (clientId = 0, msgId = 2015, dataLength = 148, channel = 0)
10-07 08:47:44.522  1382  2204 D RILClient: [OemClient]IND: (clientId = 1, msgId = 2015, dataLength = 148, channel = 0)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: Synchronized /Documents/: Unexpected exception
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:397)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.Gson.fromJson(Gson.java:1227)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.Gson.fromJson(Gson.java:1137)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.Gson.fromJson(Gson.java:1047)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.Gson.fromJson(Gson.java:982)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.common.network.WebdavEntry.<init>(WebdavEntry.kt:406)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.resources.files.ReadFolderRemoteOperation.readData(ReadFolderRemoteOperation.java:151)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.resources.files.ReadFolderRemoteOperation.run(ReadFolderRemoteOperation.java:88)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:205)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.operations.RefreshFolderOperation.fetchAndSyncRemoteFolder(RefreshFolderOperation.java:405)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.operations.RefreshFolderOperation.run(RefreshFolderOperation.java:239)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.common.operations.RemoteOperation.run(RemoteOperation.java:399)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at java.lang.Thread.run(Thread.java:1012)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:393)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:386)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	... 12 more

Server error logs

No response

Additional information

Could not find any log files on android so I obtained these logs via adb logcat Every other folder on the server works without any problems

Shekesh avatar Oct 07 '23 00:10 Shekesh

similar issue here: https://github.com/nextcloud/android/issues/11982

ebildebil avatar Oct 07 '23 02:10 ebildebil

I also have this issue, but for me it is randomly just one of the folders inside my InstantUpload folder that isn't working. Everything else seems fine.

jdaviescoates avatar Nov 07 '23 10:11 jdaviescoates

Same here than OP, on /e/OS (murena). Solved by downgrading to 3.25.

kirmaha avatar Nov 27 '23 15:11 kirmaha

Same for me on a Pixel 5a running CalyxOS. Will try downgrading to 3.25.

If it helps troubleshoot, when I click Activities in the hamburger menu I can still see my recent changes, and can (sometimes) retrieve the file I'm looking for. So the app is connected to the server, just not showing it in the main folder view.

Darklesss avatar Nov 28 '23 01:11 Darklesss

10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: Synchronized /Documents/: Unexpected exception
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:397)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.Gson.fromJson(Gson.java:1227)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.Gson.fromJson(Gson.java:1137)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.Gson.fromJson(Gson.java:1047)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.Gson.fromJson(Gson.java:982)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.common.network.WebdavEntry.<init>(WebdavEntry.kt:406)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.resources.files.ReadFolderRemoteOperation.readData(ReadFolderRemoteOperation.java:151)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.resources.files.ReadFolderRemoteOperation.run(ReadFolderRemoteOperation.java:88)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:205)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.operations.RefreshFolderOperation.fetchAndSyncRemoteFolder(RefreshFolderOperation.java:405)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.operations.RefreshFolderOperation.run(RefreshFolderOperation.java:239)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.common.operations.RemoteOperation.run(RemoteOperation.java:399)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at java.lang.Thread.run(Thread.java:1012)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:393)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:386)
10-07 08:47:44.530 28706  4394 E ReadFolderRemoteOperation: 	... 12 more

Seems to be caused by the above crash. Possibly fixed in v3.27.0 by nextcloud/android-library#1242 (and, potentially by running the latest 27.1.x server-side since the metadata has been adjusted a bit).

joshtrichards avatar Dec 19 '23 16:12 joshtrichards

This problem just showed up on my Pixel 6a device with version 3.27 where only certain folders gave this error. I have a OnePlus 7 Pro that doesn't have the same issue it would seem. Tried to recreate with both 3.26 and 3.27 on the OnePlus and couldn't get the problem to surface. Downgrading to 3.25 on the Pixel fixed the issue. Server side I'm on 28.0.1.

Dare I say it's Pixel related?

chandlben avatar Jan 05 '24 16:01 chandlben

I'm having the same issue(s) with the exact same output in the logcat above. And indeed, it only affects certain folders. However, I can use another account without issue. Version 3.25 just works.

panachoi avatar Jan 15 '24 11:01 panachoi

Experiencing the same issues on 3.27.0 on Android 14, but with a different log output:

2-15 12:28:56.734  7263  9889 D RefreshFolderOperation: Checking changes in ***REDACTED***
02-15 12:28:56.736  7263  9889 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/***REDACTED***
02-15 12:28:56.935  7263  9889 I RefreshFolderOperation: Checked ***REDACTED***: changed
02-15 12:28:56.937  7263  9889 D OwnCloudClient #0: REQUEST PROPFIND /remote.php/dav/files/***REDACTED***
02-15 12:29:02.241  7263  9889 E ReadFolderRemoteOperation: Synchronized /***REDACTED***/: Unexpected exception
02-15 12:29:02.241  7263  9889 E ReadFolderRemoteOperation: java.lang.ClassCastException: org.apache.harmony.xml.dom.ElementImpl cannot be cast to java.util.ArrayList
02-15 12:29:02.241  7263  9889 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.common.network.WebdavEntry.<init>(WebdavEntry.kt:453)
02-15 12:29:02.241  7263  9889 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.resources.files.ReadFolderRemoteOperation.readData(ReadFolderRemoteOperation.java:151)
02-15 12:29:02.241  7263  9889 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.resources.files.ReadFolderRemoteOperation.run(ReadFolderRemoteOperation.java:88)
02-15 12:29:02.241  7263  9889 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:205)
02-15 12:29:02.241  7263  9889 E ReadFolderRemoteOperation: 	at com.owncloud.android.operations.RefreshFolderOperation.fetchAndSyncRemoteFolder(RefreshFolderOperation.java:405)
02-15 12:29:02.241  7263  9889 E ReadFolderRemoteOperation: 	at com.owncloud.android.operations.RefreshFolderOperation.run(RefreshFolderOperation.java:239)
02-15 12:29:02.241  7263  9889 E ReadFolderRemoteOperation: 	at com.owncloud.android.lib.common.operations.RemoteOperation.run(RemoteOperation.java:399)
02-15 12:29:02.241  7263  9889 E ReadFolderRemoteOperation: 	at java.lang.Thread.run(Thread.java:1012)

The issue does occur on iOS/iPadOS.

Reverting back to 3.26.0 from F-Droid fixes the issue.

nimra98 avatar Feb 15 '24 11:02 nimra98

In hindsight, this seems to be the same as #12379 (which is good because we know what is causing that).

joshtrichards avatar Feb 26 '24 21:02 joshtrichards

Fixed in nextcloud/android-library#1349

joshtrichards avatar Jul 05 '24 21:07 joshtrichards