"create shared link" does not work

First of all, sorry for the English, but this post is translated by Google.

I have the problem that I can’t share files from the Android app. When I try to share a file, I get the following error message:

“It was not possible to share this file or folder because of incorrect server configuration”

In the Owncloud log I find the following entries:

oc.test.de:443 149.133.155.171 - tmueller [27/Jun/2024:14:21:19 +0200] "GET /ocs/v2.php/cloud/capabilities?format=json HTTP/1.1" 200 9611 "-" "Mozilla/5.0 (Android) ownCloud-android/4.2.2"

oc.test.de:443 149.133.155.171 - tmueller [27/Jun/2024:14:21:19 +0200] "GET /ocs/v2.php/apps/files_sharing/api/v1/shares?format=json&path=%2F2021-05-28%2011.03.56.mp4&reshares=true&subfiles=false HTTP/1.1" 200 2344 "-" "Mozilla/5.0 (Android) ownCloud-android/4.2.2"
oc.test.de:443 149.133.155.171 - tmueller [27/Jun/2024:14:21:19 +0200] "GET /index.php/app/list HTTP/1.1" 200 1807 "-" "Mozilla/5.0 (Android) ownCloud-android/4.2.2"
oc.test.de:443 149.133.155.171 - tmueller[27/Jun/2024:14:21:20 +0200] "POST /ocs/v2.php/apps/files_sharing/api/v1/shares?format=json HTTP/1.1" 500 2347 "-" "Mozilla/5.0 (Android) ownCloud-android/4.2.2"

Can anyone tell me how to get this to work? It works perfectly via the web interface.

Thanks and greetings from Hamburg

Hi @dslthomas! Thanks for opening a new thread! :100:

Ok, so following those logs, it seems that the app is retrieving correctly the capabilities and the file list from the server, but then doing a POST to share the file returns a 500. In any case, those logs are not from the Android app, which can be useful for us to see the cause of the problem here. So I can’t conclude anything yet.

If you want, please provide us with those app logs. Also, be careful what you post here since this is a public site (your IP is being shown in the logs :smiley:). I created a private folder for your logs in our internal cloud:

Link: https://infinite.owncloud.com/s/duJblcMcZCQUWWn
Password: SharedLink-1

No worries, no one will be able to see what you upload here.

I will wait for your response!

Greetings :beers:

Thanks for the help. If I understood correctly, you need a log from the app. I just uploaded it.

Thanks and greetings from Hamburg

Hi @dslthomas! Thanks for the logs :smiley:

I was checking a bit and seems that the server is returning a 500 error due to CSRF check failed, so my initial guess is that the request is being rejected for security reasons (maybe because of the origin of the request, that the server considers as suspicious). Do you have any middleware in-between or any security setting in your server that could collide with this? For further research, logs from the server would be needed now that we know it’s the backend the one which returns the error and the reason… But that would be for the backend team, which you can ask in this same forum as well. In any case, check any middleware, proxy or security settings you have now in your server and let’s see if you find something useful.

Let me know if you find any problem that I can help you with! :beers:

Good morning,

yes, the security settings are one thing… :slight_smile:

yes, I have them in the system. I have attached a list. Can you possibly see which entry could be causing this?

Thanks and greetings from Hamburg


Hi @dslthomas! It seems server logs are going to be needed to take a deeper look and figure out why the 500 response. Could you upload them to the same link as the other day? I also add @jvillafanez to the thread, he will be able to help you with server logs better than me :cowboy_hat_face:

@jvillafanez
Sorry for the late reply, but unfortunately owncloud is only one of many areas of responsibility :slight_smile: I have uploaded the log

It might be a hard crash… could you also check the apache error logs?

There is a 500 in the apache access logs, but I don’t see anything weird in the ownCloud logs. If there isn’t enough memory for PHP it might make sense for the request to crash. This case might explain the “sudden” stop of ownCloud log messages for the request, as well as the abnormal 500 error code in apache.

There are also some other tests you could do in order to narrow down the options:

  • Check if you can create shares from different clients using the same account (iOS, desktop or web)
  • Since you’re login with a token (app password maybe), try to login with the usual username and password for the account and retry.
  • Try with a different LDAP account.
  • Try with a different regular (local) account.

If the problem is somehow related to LDAP, we’d probably need the LDAP configuration. You can use occ ldap:show-config (make sure there is no security info visible)

2 Likes