SURFnet / rd-sram-integration

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

Error when I automatically trust a federated share #205

Closed navid-shokri closed 1 year ago

navid-shokri commented 1 year ago

{"reqId":"ZJFq1_pKsGEbTswmgF7VgAAAAAo","level":3,"time":"20\/Jun\/2023:11:01:11","remoteAddr":"10.234.2.58","user":"--","app":"index","method":"POST","url":"\/index.php\/apps\/federatedfilesharing\/shares","message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Call to a member function file_exists() on null\",\"Code\":0,\"Trace\":\"#0 \\/var\\/www\\/owncloud\\/apps\\/opencloudmesh\\/lib\\/Files_Sharing\\/External\\/AbstractManager.php(187): OCA\\Files_Sharing\\Helper::getShareFolder()\n#1 \\/var\\/www\\/owncloud\\/apps\\/opencloudmesh\\/lib\\/FederatedFileSharing\\/AbstractFederatedShareProvider.php(1179): OCA\\OpenCloudMesh\\Files_Sharing\\External\\AbstractManager->addShare()\n#2 \\/var\\/www\\/owncloud\\/apps\\/opencloudmesh\\/lib\\/FederatedFileSharing\\/AbstractFedShareManager.php(155): OCA\\OpenCloudMesh\\FederatedFileSharing\\AbstractFederatedShareProvider->addShare()\n#3 \\/var\\/www\\/owncloud\\/apps\\/opencloudmesh\\/lib\\/Controller\\/OcmController.php(233): OCA\\OpenCloudMesh\\FederatedFileSharing\\AbstractFedShareManager->createShare()\n#4 \\/var\\/www\\/owncloud\\/apps\\/federatedfilesharing\\/lib\\/Controller\\/OcmController.php(193): OCA\\OpenCloudMesh\\Controller\\OcmController->createShare()\n#5 \\/var\\/www\\/owncloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php(169): OCA\\FederatedFileSharing\\Controller\\OcmController->createShare()\n#6 \\/var\\/www\\/owncloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php(89): OC\\AppFramework\\Http\\Dispatcher->executeController()\n#7 \\/var\\/www\\/owncloud\\/lib\\/private\\/AppFramework\\/App.php(99): OC\\AppFramework\\Http\\Dispatcher->dispatch()\n#8 \\/var\\/www\\/owncloud\\/lib\\/private\\/AppFramework\\/Routing\\/RouteActionHandler.php(47): OC\\AppFramework\\App::main()\n#9 \\/var\\/www\\/owncloud\\/lib\\/private\\/Route\\/Router.php(344): OC\\AppFramework\\Routing\\RouteActionHandler->__invoke()\n#10 \\/var\\/www\\/owncloud\\/lib\\/base.php(916): OC\\Route\\Router->match()\n#11 \\/var\\/www\\/owncloud\\/index.php(54): OC::handleRequest()\n#12 {main}\",\"File\":\"\\/var\\/www\\/owncloud\\/apps\\/files_sharing\\/lib\\/Helper.php\",\"Line\":287}"}

michielbdejong commented 1 year ago

First thing I notice here is that the line numbers don't line up, e.g.: https://github.com/pondersource/oc-opencloudmesh/blob/main/opencloudmesh/lib/Controller/OcmController.php#L193 is a term in an if-statement expression https://github.com/pondersource/oc-opencloudmesh/blame/main/opencloudmesh/lib/FederatedFileSharing/AbstractFederatedShareProvider.php#L1179 is an argument in a function call.

I'll try to reproduce this problem in dev-stock.

michielbdejong commented 1 year ago

Related to https://github.com/SURFnet/rd-sram-integration/issues/53

navid-shokri commented 1 year ago

I test the Issue in our Environment: SO, it is my OC2.DOCKER configuration:

Image

and when I share a file from OC1.DOCKER using federatedgroups App I am still seeing this dialog.

Image

and when I accept the share there is this error log inside OC@.DOCKER logs:

{"reqId":"VDM6EJCx5DvjHU2uAbGS","level":3,"time":"2023-06-22T06:23:00+00:00","remoteAddr":"172.18.0.6","user":"marie","app":"PHP","method":"POST","url":"\/index.php\/apps\/files_sharing\/api\/externalShares","message":"Undefined index: password at \/var\/www\/html\/apps\/files_sharing\/lib\/External\/Storage.php#92"}
{"reqId":"VDM6EJCx5DvjHU2uAbGS","level":3,"time":"2023-06-22T06:23:01+00:00","remoteAddr":"172.18.0.6","user":"marie","app":"PHP","method":"POST","url":"\/index.php\/apps\/files_sharing\/api\/externalShares","message":"Undefined index: password at \/var\/www\/html\/apps\/files_sharing\/lib\/External\/Storage.php#92"}
[Thu Jun 22 06:23:01.436988 2023] [php7:notice] [pid 11] [client 172.18.0.6:59970] Site: 

but finally, the file is accepted and listed in OC2.DOCKER file explorer application:

Image

navid-shokri commented 1 year ago

So, I will add the BLOCKED label due to unable to reproduce the issue on the testing environment.

michielbdejong commented 1 year ago

@navid-shokri thanks for looking into this, I'll have a look too!

michielbdejong commented 1 year ago

More info from the OP in Slack thread:

When I have to manually accept the share, I got the error in my browser; An error occurred while updating share state: wrong share ID, share doesn't exist. Nothing is in the log, the requests which are made;

{"reqId":"ZJFyBAMEwcSVkY7OOWVQ0wAAAAs","level":0,"time":"20\/Jun\/2023:11:31:49","remoteAddr":"10.234.0.3","user":"13d408f8-5a42-4632-a9d7-987658e673f0@surfguest.nl","app":"OC\\User\\Session::validateToken","method":"POST","url":"\/ocs\/v1.php\/apps\/files_sharing\/api\/v1\/remote_shares\/pending\/6?format=json","message":"token 54934a947f1620d7d179960347ac84e21c49dfa2c19b1b84e87a3955470e4c4ad32d92d709e0b77a1589ae2ebc9e15f7fd28c3114a7d146efa78a6b61b6d5f7e with token id 1085334 found, validating"}
{"reqId":"ZJFyBAMEwcSVkY7OOWVQ0wAAAAs","level":0,"time":"20\/Jun\/2023:11:31:49","remoteAddr":"10.234.0.3","user":"13d408f8-5a42-4632-a9d7-987658e673f0@surfguest.nl","app":"OC\\User\\Session::validateToken","method":"POST","url":"\/ocs\/v1.php\/apps\/files_sharing\/api\/v1\/remote_shares\/pending\/6?format=json","message":"token 54934a947f1620d7d179960347ac84e21c49dfa2c19b1b84e87a3955470e4c4ad32d92d709e0b77a1589ae2ebc9e15f7fd28c3114a7d146efa78a6b61b6d5f7e with token id 1085334 found, validating"}

Share keeps Pending

Will see if I can reproduce this.

michielbdejong commented 1 year ago

I was unable to reproduce this with the latest version of our opencloudmesh app, will reopen if we do see this show up again.