Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on connecting account #1387

Closed
1 of 4 tasks
gpopesc opened this issue Nov 22, 2022 · 8 comments
Closed
1 of 4 tasks

Error on connecting account #1387

gpopesc opened this issue Nov 22, 2022 · 8 comments

Comments

@gpopesc
Copy link

gpopesc commented Nov 22, 2022

Describe the bug
I get an Error while trying to connect nextcloud account .
I have 2 android devices, I get the same error

Steps to reproduce the behavior:

  1. Open app
  2. Select an existing account
  3. Click connect
  4. See error
App Version: 1.20.1
App Version Code: 1020001
Server App Version: 1.7.3
App Flavor: fdroid

Files App Version Code: 30220390

---

OS Version: 4.14.116(102.0.0.255C432)
OS API Level: 29
Device: HWMRX
Manufacturer: HUAWEI
Model (and Product): MRX-W09 (MRX-W09NM)

---

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Not a JSON Object: 105
	at com.google.gson.Gson.fromJson(Gson.java:1003)
	at com.google.gson.Gson.fromJson(Gson.java:956)
	at com.nextcloud.android.sso.api.NextcloudAPI.convertStreamToTargetEntity(NextcloudAPI.java:159)
	at com.nextcloud.android.sso.api.NextcloudAPI.lambda$performRequestObservableV2$1$com-nextcloud-android-sso-api-NextcloudAPI(NextcloudAPI.java:130)
	at com.nextcloud.android.sso.api.NextcloudAPI$$ExternalSyntheticLambda2.subscribe(Unknown Source:6)
	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.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
	at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:38)
	at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:26)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:929)
Caused by: java.lang.IllegalStateException: Not a JSON Object: 105
	at com.google.gson.JsonElement.getAsJsonObject(JsonElement.java:91)
	at it.niedermann.nextcloud.deck.api.NextcloudArrayDeserializer.deserialize(NextcloudArrayDeserializer.java:35)
	at it.niedermann.nextcloud.deck.api.NextcloudArrayDeserializer.deserialize(NextcloudArrayDeserializer.java:18)
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
	at com.google.gson.Gson.fromJson(Gson.java:991)
	... 13 more

Expected behavior

Screenshots

Versions

  • Nextcloud: 24.0.6
  • Nextcloud Deck: 1.7.3
  • Nextcloud Android: 3.22.3
  • Nextcloud Android Deck: 1.20.1

Smartphone (please complete the following information):

  • Device: Huawei matepad pro and Huawei p40 oro
  • Android-Version: 10
  • App-Store:
    • Google Play Store
    • Google Play Store (Beta channel)
    • F-Droid
    • Huawei AppGallery

Stacktrace

@stefan-niedermann
Copy link
Owner

Thank you for the report. This seems not to be an issue of the Deck Android app but maybe something more generic of the Nextcloud server itself. Please check out https://help.nextcloud.com/t/all-3rd-party-android-apps-stopped-working/150892 for staying up to date - unfortunately there is not much we can do on our side when the server replies an unexpected response.

Please also try opening the Deck app in the web browser and clear the storage of the Deck Android app as described in our FAQ - at least a Notes Android app user reported this to work.

@gpopesc
Copy link
Author

gpopesc commented Dec 6, 2022

Thank you. It the meantime I found the error: it should be full server access path under RewriteRule (s) in .htaccess file

@koug44
Copy link

koug44 commented Dec 6, 2022

@gpopesc Could you elaborate a little on your fix ?

@Aquariu
Copy link

Aquariu commented Dec 9, 2022

Thank you. It the meantime I found the error: it should be full server access path under RewriteRule (s) in .htaccess file

Can you please explain what you did in more details ? It looks weird to me that there would be a bug in the .htaccess file while I didn't even upgrade the NC version.

@Aquariu
Copy link

Aquariu commented Dec 13, 2022

Dear all,
Pardon my ignorance, but I don't see the fix here and do not understand why the issue is closed. The workaround (modify .htaccess) is not described in full and if there's an explanation on why this suddenly popped up, then I failed to see it (and I apologise).

@stefan-niedermann
Copy link
Owner

stefan-niedermann commented Dec 13, 2022

This issue is closed because it is not caused by the Notes app: It can't be fixed here and it is not limited to the Notes Android app (as you can see in the linked forum thread on Nextcloud Help).

Edit: I mean Deck of course.

@gpopesc
Copy link
Author

gpopesc commented Dec 13, 2022

@koug44 and @Aquariu

add in .htaccess file from you nextcloud root your full server address.
as example in original file I have:


RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} DavClnt
RewriteRule ^$ /remote.php/webdav/ [L,R=302]
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^.well-known/carddav /remote.php/dav/ [R=301,L]
RewriteRule ^.well-known/caldav /remote.php/dav/ [R=301,L]
RewriteRule ^remote/(.) remote.php [QSA,L]
RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.
- [R=404,L]
RewriteRule ^.well-known/(?!acme-challenge|pki-validation) /index.php [QSA,L]
RewriteRule ^(?:.(?!well-known)|autotest|occ|issue|indie|db
|console).* - [R=404,L]
_

then modify with your full server path:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} DavClnt
RewriteRule ^$ https://your.server.address/remote.php/webdav/ [L,R=302]
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^.well-known/carddav https://your.server.address/remote.php/dav/ [R=301,L]
RewriteRule ^.well-known/caldav https://your.server.address/remote.php/dav/ [R=301,L]
RewriteRule ^remote/(.) remote.php [QSA,L]
RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.
- [R=404,L]
RewriteRule ^.well-known/(?!acme-challenge|pki-validation) /index.php [QSA,L]
RewriteRule ^(?:.(?!well-known)|autotest|occ|issue|indie|db
|console).* - [R=404,L]
_

I hope it helps. This was the solution in my case

@Aquariu
Copy link

Aquariu commented Dec 14, 2022

Thank you for your answer.
This didn't work for me. I also have a second nextcloud 24.0.8 running without this issue and with the normal .htaccess. I can access Deck, News, etc... data with the same android phone & same apps on this second instance without issue.

Also, I couln't find if the server people had created an issue for this. This is still very mysterious to me (why it started in the first place, the non-reproducibility, ....)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants