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

Creating folders on remote shares fails #46

Closed
glpatcern opened this issue Sep 1, 2023 · 5 comments
Closed

Creating folders on remote shares fails #46

glpatcern opened this issue Sep 1, 2023 · 5 comments

Comments

@glpatcern
Copy link
Member

The remote EFSS logs the following:

{"reqId":"3kZ5Clt8Bkc5md8AJI57","level":3,"time":"2023-09-01T13:33:26+00:00","remoteAddr":"192.168.16.3","user":"marie","app":"no app in context","method":"MKCOL","url":"\/remote.php\/dav\/files\/marie\/Marie2\/folder","message":"Exception: {\"Exception\":\"Sabre\\\\HTTP\\\\ClientHttpException\",\"Message\":\"Unsupported Media Type\",\"Code\":415,\"Trace\":\"#
0 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Client.php(367): Sabre\\\\HTTP\\\\Client->send()\\n#1 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/DAV.php(683): Sabre\\\\DAV\\\\Client->request()\\n#2 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/DAV.php(175): OC\\\\Files\\\\Storage\\\\DAV->simpl
eResponse()\\n#3 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(85): OC\\\\Files\\\\Storage\\\\DAV->mkdir()\\n#4 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Availability.php(83): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->mkdir()\\n#5 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/
Storage\\\/Wrapper\\\/Wrapper.php(85): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Availability->mkdir()\\n#6 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(85): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->mkdir()\\n#7 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/View.php(1225): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wr
apper->mkdir()\\n#8 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/View.php(280): OC\\\\Files\\\\View->basicOperation()\\n#9 \\\/var\\\/www\\\/html\\\/lib\\\/public\\\/Events\\\/EventEmitterTrait.php(50): OC\\\\Files\\\\View->OC\\\\Files\\\\{closure}(*** sensitive parameters replaced ***)\\n#10 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/View.ph
p(282): OC\\\\Files\\\\View->emittingCall()\\n#11 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Directory.php(230): OC\\\\Files\\\\View->mkdir()\\n#12 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1210): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory->createDirectory()\\n#13 \\\/var\\\/www\\\/html\
\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(560): Sabre\\\\DAV\\\\Server->createCollection()\\n#14 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpMkcol()\\n#15 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(472): Sa
bre\\\\DAV\\\\Server->emit()\\n#16 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(253): Sabre\\\\DAV\\\\Server->invokeMethod()\\n#17 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/lib\\\/Server.php(348): Sabre\\\\DAV\\\\Server->start()\\n#18 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\
\Server->exec()\\n#19 \\\/var\\\/www\\\/html\\\/remote.php(165): require_once('\\\/var\\\/www\\\/html\\\/a...')\\n#20 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/http\\\/lib\\\/Client.php\",\"Line\":163}"}
{"reqId":"3kZ5Clt8Bkc5md8AJI57","level":3,"time":"2023-09-01T13:33:26+00:00","remoteAddr":"192.168.16.3","user":"marie","app":"files_external","method":"MKCOL","url":"\/remote.php\/dav\/files\/marie\/Marie2\/folder","message":"Unsupported Media Type"}
@glpatcern
Copy link
Member Author

This was fixed once ListFolders returns the proper structure.

@MahdiBaghbani
Copy link
Member

This issue still exists on ownCloud to ownCloud scenario.

logs of oc2 when creating a folder inside another folder shared by oc1.

172.19.0.3 - - [06/Sep/2023:09:25:02 +0000] "MKCOL /remote.php/dav/files/marie/Test/create-remote HTTP/1.1" 503 1116 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0"

{
  "reqId": "hZcsz2WdVqadjXol0Nws",
  "level": 3,
  "time": "2023-09-06T09:25:03+00:00",
  "remoteAddr": "172.19.0.3",
  "user": "marie",
  "app": "no app in context",
  "method": "MKCOL",
  "url": "/remote.php/dav/files/marie/Test/create-remote",
  "message": "Exception: {\"Exception\":\"Sabre\\\\HTTP\\\\ClientHttpException\",\"Message\":\"Unsupported Media Type\",\"Code\":415,\"Trace\":\"#0 \\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Client.php(367): Sabre\\\\HTTP\\\\Client->send()\\n#1 \\/var\\/www\\/html\\/lib\\/private\\/Files\\/Storage\\/DAV.php(694): Sabre\\\\DAV\\\\Client->request()\\n#2 \\/var\\/www\\/html\\/lib\\/private\\/Files\\/Storage\\/DAV.php(173): OC\\\\Files\\\\Storage\\\\DAV->simpleResponse()\\n#3 \\/var\\/www\\/html\\/lib\\/private\\/Files\\/Storage\\/Wrapper\\/Wrapper.php(85): OC\\\\Files\\\\Storage\\\\DAV->mkdir()\\n#4 \\/var\\/www\\/html\\/lib\\/private\\/Files\\/Storage\\/Wrapper\\/Availability.php(83): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->mkdir()\\n#5 \\/var\\/www\\/html\\/lib\\/private\\/Files\\/Storage\\/Wrapper\\/Wrapper.php(85): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Availability->mkdir()\\n#6 \\/var\\/www\\/html\\/lib\\/private\\/Files\\/Storage\\/Wrapper\\/Wrapper.php(85): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->mkdir()\\n#7 \\/var\\/www\\/html\\/lib\\/private\\/Files\\/View.php(1225): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->mkdir()\\n#8 \\/var\\/www\\/html\\/lib\\/private\\/Files\\/View.php(280): OC\\\\Files\\\\View->basicOperation()\\n#9 \\/var\\/www\\/html\\/lib\\/public\\/Events\\/EventEmitterTrait.php(50): OC\\\\Files\\\\View->OC\\\\Files\\\\{closure}(*** sensitive parameters replaced ***)\\n#10 \\/var\\/www\\/html\\/lib\\/private\\/Files\\/View.php(282): OC\\\\Files\\\\View->emittingCall()\\n#11 \\/var\\/www\\/html\\/apps\\/dav\\/lib\\/Connector\\/Sabre\\/Directory.php(230): OC\\\\Files\\\\View->mkdir()\\n#12 \\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(1210): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory->createDirectory()\\n#13 \\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/CorePlugin.php(560): Sabre\\\\DAV\\\\Server->createCollection()\\n#14 \\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/event\\/lib\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpMkcol()\\n#15 \\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(472): Sabre\\\\DAV\\\\Server->emit()\\n#16 \\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(253): Sabre\\\\DAV\\\\Server->invokeMethod()\\n#17 \\/var\\/www\\/html\\/apps\\/dav\\/lib\\/Server.php(348): Sabre\\\\DAV\\\\Server->start()\\n#18 \\/var\\/www\\/html\\/apps\\/dav\\/appinfo\\/v2\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#19 \\/var\\/www\\/html\\/remote.php(165): require_once('\\/var\\/www\\/html\\/a...')\\n#20 {main}\",\"File\":\"\\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/http\\/lib\\/Client.php\",\"Line\":163}"
}
{
  "reqId": "hZcsz2WdVqadjXol0Nws",
  "level": 3,
  "time": "2023-09-06T09:25:03+00:00",
  "remoteAddr": "172.19.0.3",
  "user": "marie",
  "app": "files_external",
  "method": "MKCOL",
  "url": "/remote.php/dav/files/marie/Test/create-remote",
  "message": "Unsupported Media Type"
}
{
  "reqId": "hZcsz2WdVqadjXol0Nws",
  "level": 4,
  "time": "2023-09-06T09:25:03+00:00",
  "remoteAddr": "172.19.0.3",
  "user": "marie",
  "app": "webdav",
  "method": "MKCOL",
  "url": "/remote.php/dav/files/marie/Test/create-remote",
  "message": "Exception: HTTP/1.1 503 Sabre\\HTTP\\ClientHttpException: Unsupported Media Type: {\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\ServiceUnavailable\",\"Message\":\"Sabre\\\\HTTP\\\\ClientHttpException: Unsupported Media Type\",\"Code\":0,\"Trace\":\"#0 \\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(1210): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory->createDirectory()\\n#1 \\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/CorePlugin.php(560): Sabre\\\\DAV\\\\Server->createCollection()\\n#2 \\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/event\\/lib\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpMkcol()\\n#3 \\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(472): Sabre\\\\DAV\\\\Server->emit()\\n#4 \\/var\\/www\\/html\\/lib\\/composer\\/sabre\\/dav\\/lib\\/DAV\\/Server.php(253): Sabre\\\\DAV\\\\Server->invokeMethod()\\n#5 \\/var\\/www\\/html\\/apps\\/dav\\/lib\\/Server.php(348): Sabre\\\\DAV\\\\Server->start()\\n#6 \\/var\\/www\\/html\\/apps\\/dav\\/appinfo\\/v2\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#7 \\/var\\/www\\/html\\/remote.php(165): require_once('\\/var\\/www\\/html\\/a...')\\n#8 {main}\",\"File\":\"\\/var\\/www\\/html\\/apps\\/dav\\/lib\\/Connector\\/Sabre\\/Directory.php\",\"Line\":234}"
}

The 503 error is misleading, real error is 415 when ownCloud 2 is doing the MKCOL call. (ownCloud does 3 PROPFINDs prior to MKCOL)

Reva for oc1 logs shows:

2023-09-06 09:25:03.941 WRN ../../reva/internal/http/interceptors/log/log.go:101 > processed http request host=172.19.0.10 method=MKCOL pid=1251 pkg=http status=415 traceid=9a759ccfa1bf9fe85f10e15714693da0 uri=/remote.php/dav/ocm/create-remote
2023-09-06 09:25:03.941 TRC ../../reva/internal/http/interceptors/log/log.go:108 > http end="06/Sep/2023:09:25:03 +0000" host=172.19.0.10 method=MKCOL pid=1251 pkg=http proto=HTTP/2.0 req_headers={"Accept":["*/*"],"Authorization":["Basic d2NzZTZmQ0R6Y09EVmlaNTFBVlZXb0ZDM0Z2ZXNXalk6"],"Content-Length":["0"],"Content-Type":["application/x-www-form-urlencoded"],"Traceparent":["00-9a759ccfa1bf9fe85f10e15714693da0-4c1f78f5c02f83bd-01"],"User-Agent":["sabre-dav/4.4.0 (http://sabre.io/)"]} res_headers={"Access-Control-Allow-Origin":["*"],"Content-Security-Policy":["default-src 'none';"],"Strict-Transport-Security":["max-age=63072000"],"Vary":["Origin"],"X-Content-Type-Options":["nosniff"],"X-Download-Options":["noopen"],"X-Frame-Options":["SAMEORIGIN"],"X-Permitted-Cross-Domain-Policies":["none"],"X-Robots-Tag":["none"],"X-Xss-Protection":["1; mode=block"]} size=0 start="06/Sep/2023:09:25:03 +0000" status=415 time_ns=79041431 traceid=9a759ccfa1bf9fe85f10e15714693da0 uri=/remote.php/dav/ocm/create-remote

No additional call is being made to Sciencemesh App, it just returns 415 immediately after receiving MKCOL call.

Does "Unsupported Media Type" mean it has a problem with "Content-Type":["application/x-www-form-urlencoded"]

@michielbdejong
Copy link
Collaborator

see how it works for a regular OCM share

@MahdiBaghbani
Copy link
Member

Vanilla ownCloud to ownCloud logs

  1. oc1 shared a folder to oc2
  2. oc2 is creating a new folder named created-new-folder

oc2 creating folder logs:

172.18.0.3 - - [06/Sep/2023:12:36:13 +0000] "GET /core/img/actions/upload.svg HTTP/1.1" 200 961 "https://owncloud2.docker/core/css/icons.css?v=7ce9e7316dbe3c4e8b3e2950f5faac47" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0"
172.18.0.3 - - [06/Sep/2023:12:36:27 +0000] "MKCOL /remote.php/dav/files/marie/Test/created-new-folder HTTP/1.1" 201 910 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0"
172.18.0.3 - - [06/Sep/2023:12:36:28 +0000] "PROPFIND /remote.php/dav/files/marie/Test/created-new-folder HTTP/1.1" 207 1489 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0"

oc1 logs

172.18.0.10 - - [06/Sep/2023:12:36:27 +0000] "GET /ocm-provider/ HTTP/1.1" 200 2829 "-" "ownCloud Server Crawler"
172.18.0.10 - eNSUU9TIP0egfN1 [06/Sep/2023:12:36:27 +0000] "PROPFIND /public.php/webdav/created-new-folder HTTP/1.1" 404 2866 "-" "sabre-dav/4.4.0 (http://sabre.io/)"
172.18.0.10 - eNSUU9TIP0egfN1 [06/Sep/2023:12:36:27 +0000] "PROPFIND /public.php/webdav/ HTTP/1.1" 207 1790 "-" "sabre-dav/4.4.0 (http://sabre.io/)"
172.18.0.10 - eNSUU9TIP0egfN1 [06/Sep/2023:12:36:27 +0000] "PROPFIND /public.php/webdav/ HTTP/1.1" 207 1409 "-" "sabre-dav/4.4.0 (http://sabre.io/)"
172.18.0.10 - eNSUU9TIP0egfN1 [06/Sep/2023:12:36:27 +0000] "MKCOL /public.php/webdav/created-new-folder HTTP/1.1" 201 1047 "-" "sabre-dav/4.4.0 (http://sabre.io/)"
172.18.0.10 - eNSUU9TIP0egfN1 [06/Sep/2023:12:36:27 +0000] "PROPFIND /public.php/webdav/created-new-folder HTTP/1.1" 207 1801 "-" "sabre-dav/4.4.0 (http://sabre.io/)"
172.18.0.10 - eNSUU9TIP0egfN1 [06/Sep/2023:12:36:27 +0000] "PROPFIND /public.php/webdav/created-new-folder HTTP/1.1" 207 1638 "-" "sabre-dav/4.4.0 (http://sabre.io/)"
172.18.0.10 - eNSUU9TIP0egfN1 [06/Sep/2023:12:36:28 +0000] "PROPFIND /public.php/webdav/ HTTP/1.1" 207 1786 "-" "sabre-dav/4.4.0 (http://sabre.io/)"
172.18.0.10 - - [06/Sep/2023:12:36:28 +0000] "GET /ocm-provider/ HTTP/1.1" 200 2829 "-" "ownCloud Server Crawler"
172.18.0.10 - eNSUU9TIP0egfN1 [06/Sep/2023:12:36:28 +0000] "PROPFIND /public.php/webdav/ HTTP/1.1" 207 3378 "-" "sabre-dav/4.4.0 (http://sabre.io/)"
172.18.0.10 - eNSUU9TIP0egfN1 [06/Sep/2023:12:36:28 +0000] "PROPFIND /public.php/webdav/created-new-folder HTTP/1.1" 207 1803 "-" "sabre-dav/4.4.0 (http://sabre.io/)"
172.18.0.10 - eNSUU9TIP0egfN1 [06/Sep/2023:12:36:28 +0000] "PROPFIND /public.php/webdav/created-new-folder HTTP/1.1" 207 1634 "-" "sabre-dav/4.4.0 (http://sabre.io/)"

@MahdiBaghbani
Copy link
Member

This seems to fix cs3org/reva@4620143 the issue

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

3 participants