android icon indicating copy to clipboard operation
android copied to clipboard

[BUG] 500 error when trying to share files via the app

Open mizapf opened this issue 4 years ago • 14 comments

Actual behaviour

When clicking on the "share" icon, an error message is shown on the android app, indicating a bad server configuration. This only occurs when using the app, not when using the browser on the PC.

Server log line (access via android app): 79.218.242.141 - michael [28/May/2021:22:18:32 +0200] "GET /owncl/ocs/v2.php/apps/files_sharing/api/v1/shares?path=%2FownCloud%20Manual.pdf&reshares=true&subfiles=false HTTP/1.1" 500 1151 "-" "Mozilla/5.0 (Android) ownCloud-android/2.18"

Server log line (access via Firefox browser): 79.218.242.141 - - [28/May/2021:22:19:04 +0200] "GET /owncl/ocs/v2.php/apps/files_sharing/api/v1/shares?format=json&path=%2FownCloud%20Manual.pdf&reshares=true HTTP/1.1" 200 896 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0"

Expected behaviour

The Android app should behave like the Firefox browser.

Unfortunately, the server error 500 code does not indicate the cause of the error.

mizapf avatar May 28 '21 20:05 mizapf

What is the server version you're running?

michaelstingl avatar May 28 '21 21:05 michaelstingl

It is 10.7.0 (2021-03-26).

mizapf avatar May 28 '21 21:05 mizapf

Hi ! I have the same issue. It is possible to share with other users using the web page, however the Android app says there is a bad server configuration. Did you find a solution for that @mizapf @michaelstingl ?

Running ownCloud 10.8.0 (stable) on raspbian

Not sure where to look, but I'm happy to provide all the details you need.

AubinF avatar Jan 25 '22 02:01 AubinF

I did not try again; will do in a couple of days.

mizapf avatar Feb 01 '22 11:02 mizapf

Hi Michael, have you any news regarding this issue? Thanks Just found this similar issue (closed). Will let you know if this solved my problem.

AubinF avatar Feb 08 '22 19:02 AubinF

upgrading owncloud to 10.9.1 did not solve the problem. The issue I mentioned above suggests downgrading files_sharing to version 0.13.0 as a solution. How can I do that ? Thanks

AubinF avatar Feb 13 '22 18:02 AubinF

This is a piece of the android app log, with what I identify as the response to my trying to share a file with another user

E: 2022-02-17 19:25:00:273(GetRemoteSharesForFileOperation.kt:101) .onResultUnsuccessful()Failed response while while getting remote shares for file operation E: 2022-02-17 19:25:00:274(GetRemoteSharesForFileOperation.kt:103) .onResultUnsuccessful()*** status code: 500; response message: {"ocs":{"meta":{"status":"failure","statuscode":500,"message":"CSRF check failed","totalitems":"","itemsperpage":""},"data":[]}} D: 2022-02-17 19:25:00:274(ViewModelExt.kt:98) $runUseCaseWithResultAndUseCachedData.invokeSuspend()Use case executed: RefreshSharesFromServerAsyncUseCase with result: Error(throwable=com.owncloud.android.domain.exceptions.InstanceNotConfiguredException)

AubinF avatar Feb 17 '22 19:02 AubinF

Could you check this -> https://central.owncloud.org/t/csrf-check-failed-when-trying-to-share-files/29991/24

Tell us if it helps to fix.

jesmrec avatar Jun 30 '22 10:06 jesmrec

Could you check this -> https://central.owncloud.org/t/csrf-check-failed-when-trying-to-share-files/29991/24

Tell us if it helps to fix.

I had also this error and was waiting for a bugfix. Tried this, didn't work. But after more searching I found this: https://github.com/owncloud/core/issues/38287#issuecomment-1012520522 It solved the problem for me, so it is possible to share with the android app again.

My owncloud server runs on Debian 11, ownCloud 10.10.0 (stable), ssl enabled.

gtxe avatar Jul 02 '22 16:07 gtxe

That means, the root problem is not in Android client. Then we could close this one

jesmrec avatar Jul 04 '22 10:07 jesmrec

In the official documentation to configure ownCloud with Apache, there is described something similar: Configure Apache for Manual Installation on Linux I tried this too: and it is still working :-) It might be there are some tutorials in the web with missing of this part or it was not required earlier. I installed my ownCloud instance back in 2014 version 7 And sharing with the android client was always possible... until... I don't know exactly... last year or so

gtxe avatar Jul 06 '22 17:07 gtxe

Hi there. Thanks for the replies. I found a solution in the end although that was ~6 months ago, so I do not remember the details. Judging by my apache2 virtualhost config, it was similar to what @gtxe suggested 👍

AubinF avatar Jul 08 '22 15:07 AubinF

That means, the root problem is not in Android client. Then we could close this one

I think the name of the issue is clear. The bug may be due to server configuration, but it manifests via the app, not because of the app. In any case, there seems to be a viable workaround now, so I guess this issue could indeed be closed?

AubinF avatar Jul 08 '22 15:07 AubinF

I had also this error and was waiting for a bugfix. Tried this, didn't work. But after more searching I found this: owncloud/core#38287 (comment) It solved the problem for me, so it is possible to share with the android app again.

Adding the AllowOverride and RewriteEngine has solved the issue for me as well. Thanks!

mizapf avatar Jul 08 '22 18:07 mizapf

Verified that this is fixed via: https://github.com/owncloud/core/issues/38287#issuecomment-1012520522

IljaN avatar Jun 20 '23 07:06 IljaN