SURFnet / rd-sram-integration

Research Drive / SURF Research Access Management Integration
2 stars 3 forks source link

error when trying to open shared file #169

Closed navid-shokri closed 1 year ago

navid-shokri commented 1 year ago

this error is shown when the receiver (Marie) tries to open OCM-group shared file:

{"reqId":"FKgRBAipmDCe7v0wYIc7","level":3,"time":"2023-05-26T05:42:55+00:00","remoteAddr":"172.18.0.1","user":"einstein","app":"PHP","method":"GET","url":"\/remote.php\/dav\/files\/einstein\/images.jpg?x=538&y=303&a=1&mode=cover&c=5280271b175d63dce6cd380847a2f94a&forceIcon=0&preview=1","message":"Trying to access array offset on value of type bool at \/var\/www\/html\/lib\/private\/Files\/Storage\/Wrapper\/Encryption.php#475"} {"reqId":"FKgRBAipmDCe7v0wYIc7","level":3,"time":"2023-05-26T05:42:55+00:00","remoteAddr":"172.18.0.1","user":"einstein","app":"PHP","method":"GET","url":"\/remote.php\/dav\/files\/einstein\/images.jpg?x=538&y=303&a=1&mode=cover&c=5280271b175d63dce6cd380847a2f94a&forceIcon=0&preview=1","message":"fopen(\/var\/www\/html\/data\/einstein\/thumbnails\/11\/183-275-max-cover.png): failed to open stream: No such file or directory at \/var\/www\/html\/lib\/private\/Files\/Storage\/Local.php#298"}

thepeak99 commented 1 year ago

Blocked by https://github.com/owncloud/core/issues/40594

yasharpm commented 1 year ago

This happens for shared files and folders. No matter if it is a remote user share or a remote group share.

In case of shared folders, the size column writes "pending" and in case of shared files, the preview doesn't appear and the file can not be downloaded and the size always says <1k.

yasharpm commented 1 year ago

I put logs on the point the provider receives the request for the file. Which is on lib/composer/sabre/dav/lib/DAV/Server.php:253 that calls invokeMethod function on the same class and finally on line 488 the response is sent which is a successful 200 response.

On the receiver side the error says "connection refused" by the provider. Here are the logs that the receiver produces:

{"reqId":"VYEQTjhKO06n43YaRbQ5","level":4,"time":"2023-06-15T23:32:02+00:00","remoteAddr":"172.19.0.6","user":"marie","app":"webdav","method":"GET","url":"\/remote.php\/webdav\/goodbye.txt","message":"Exception: Connection refused for URI https:\/\/oc1.docker\/public.php\/webdav\/: {\"Exception\":\"GuzzleHttp\\\\Exception\\\\ConnectException\",\"Message\":\"Connection refused for URI https:\\\/\\\/oc1.docker\\\/public.php\\\/webdav\\\/\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Handler\\\/Proxy.php(48): GuzzleHttp\\\\Handler\\\\StreamHandler->__invoke()\\n#1 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/PrepareBodyMiddleware.php(35): GuzzleHttp\\\\Handler\\\\Proxy::GuzzleHttp\\\\Handler\\\\{closure}(*** sensitive parameters replaced ***)\\n#2 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Middleware.php(31): GuzzleHttp\\\\PrepareBodyMiddleware->__invoke()\\n#3 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/RedirectMiddleware.php(71): GuzzleHttp\\\\Middleware::GuzzleHttp\\\\{closure}(*** sensitive parameters replaced ***)\\n#4 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Middleware.php(63): GuzzleHttp\\\\RedirectMiddleware->__invoke()\\n#5 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/HandlerStack.php(75): GuzzleHttp\\\\Middleware::GuzzleHttp\\\\{closure}(*** sensitive parameters replaced ***)\\n#6 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Client.php(331): GuzzleHttp\\\\HandlerStack->__invoke()\\n#7 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Client.php(168): GuzzleHttp\\\\Client->transfer()\\n#8 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Client.php(187): GuzzleHttp\\\\Client->requestAsync()\\n#9 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/ClientTrait.php(44): GuzzleHttp\\\\Client->request()\\n#10 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Http\\\/Client\\\/Client.php(184): GuzzleHttp\\\\Client->get()\\n#11 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/DAV.php(361): OC\\\\Http\\\\Client\\\\Client->get()\\n#12 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(302): OC\\\\Files\\\\Storage\\\\DAV->fopen()\\n#13 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Availability.php(317): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->fopen()\\n#14 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Checksum.php(58): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Availability->fopen()\\n#15 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(302): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Checksum->fopen()\\n#16 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/View.php(1223): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->fopen()\\n#17 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/View.php(1070): OC\\\\Files\\\\View->basicOperation()\\n#18 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(431): OC\\\\Files\\\\View->fopen()\\n#19 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(85): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->get()\\n#20 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpGet()\\n#21 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(472): Sabre\\\\DAV\\\\Server->emit()\\n#22 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(253): Sabre\\\\DAV\\\\Server->invokeMethod()\\n#23 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(321): Sabre\\\\DAV\\\\Server->start()\\n#24 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(67): Sabre\\\\DAV\\\\Server->exec()\\n#25 \\\/var\\\/www\\\/html\\\/remote.php(165): require_once('\\\/var\\\/www\\\/html\\\/a...')\\n#26 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Handler\\\/StreamHandler.php\",\"Line\":72}"}
{"reqId":"VYEQTjhKO06n43YaRbQ5","level":4,"time":"2023-06-15T23:32:02+00:00","remoteAddr":"172.19.0.6","user":"marie","app":"webdav","method":"GET","url":"\/remote.php\/webdav\/goodbye.txt","message":"Caused by: {\"Exception\":\"GuzzleHttp\\\\Exception\\\\ConnectException\",\"Message\":\"Connection refused for URI https:\\\/\\\/oc1.docker\\\/public.php\\\/webdav\\\/\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Handler\\\/StreamHandler.php(241): GuzzleHttp\\\\Handler\\\\StreamHandler->GuzzleHttp\\\\Handler\\\\{closure}(*** sensitive parameters replaced ***)\\n#1 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Handler\\\/StreamHandler.php(339): GuzzleHttp\\\\Handler\\\\StreamHandler->createResource()\\n#2 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Handler\\\/StreamHandler.php(58): GuzzleHttp\\\\Handler\\\\StreamHandler->createStream()\\n#3 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Handler\\\/Proxy.php(48): GuzzleHttp\\\\Handler\\\\StreamHandler->__invoke()\\n#4 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/PrepareBodyMiddleware.php(35): GuzzleHttp\\\\Handler\\\\Proxy::GuzzleHttp\\\\Handler\\\\{closure}(*** sensitive parameters replaced ***)\\n#5 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Middleware.php(31): GuzzleHttp\\\\PrepareBodyMiddleware->__invoke()\\n#6 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/RedirectMiddleware.php(71): GuzzleHttp\\\\Middleware::GuzzleHttp\\\\{closure}(*** sensitive parameters replaced ***)\\n#7 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Middleware.php(63): GuzzleHttp\\\\RedirectMiddleware->__invoke()\\n#8 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/HandlerStack.php(75): GuzzleHttp\\\\Middleware::GuzzleHttp\\\\{closure}(*** sensitive parameters replaced ***)\\n#9 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Client.php(331): GuzzleHttp\\\\HandlerStack->__invoke()\\n#10 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Client.php(168): GuzzleHttp\\\\Client->transfer()\\n#11 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Client.php(187): GuzzleHttp\\\\Client->requestAsync()\\n#12 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/ClientTrait.php(44): GuzzleHttp\\\\Client->request()\\n#13 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Http\\\/Client\\\/Client.php(184): GuzzleHttp\\\\Client->get()\\n#14 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/DAV.php(361): OC\\\\Http\\\\Client\\\\Client->get()\\n#15 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(302): OC\\\\Files\\\\Storage\\\\DAV->fopen()\\n#16 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Availability.php(317): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->fopen()\\n#17 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Checksum.php(58): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Availability->fopen()\\n#18 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(302): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Checksum->fopen()\\n#19 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/View.php(1223): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->fopen()\\n#20 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Files\\\/View.php(1070): OC\\\\Files\\\\View->basicOperation()\\n#21 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(431): OC\\\\Files\\\\View->fopen()\\n#22 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(85): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->get()\\n#23 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpGet()\\n#24 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(472): Sabre\\\\DAV\\\\Server->emit()\\n#25 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(253): Sabre\\\\DAV\\\\Server->invokeMethod()\\n#26 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(321): Sabre\\\\DAV\\\\Server->start()\\n#27 \\\/var\\\/www\\\/html\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(67): Sabre\\\\DAV\\\\Server->exec()\\n#28 \\\/var\\\/www\\\/html\\\/remote.php(165): require_once('\\\/var\\\/www\\\/html\\\/a...')\\n#29 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/guzzlehttp\\\/guzzle\\\/src\\\/Handler\\\/StreamHandler.php\",\"Line\":328}"}

The trace leads to core/lib/private/Files/Storage/DAV.php:361 in which a GET request is sent to the provider. I tried to put a log on it (directly through docker exec) but the logs don't show up as if I am putting the logs in the wrong place but I have double checked everything.

My goal is to make the same call that the receiver makes and see if the connection actually gets refused. If it doesn't, the problem must be on the receiver side otherwise on the provider side.

In any case I am thinking that this might be due to the apache setup in our dev environment somehow.

michielbdejong commented 1 year ago

Unlike #189, this is fixed in dev-stock main branch, at least for folders, look:

Image

MahdiBaghbani commented 1 year ago

fixed by https://github.com/SURFnet/rd-sram-integration/issues/189#issuecomment-1629321246