SURFnet / rd-sram-integration

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

Share failed with group containing federated users #194

Closed T0mWz closed 1 year ago

T0mWz commented 1 year ago

Creating a group share Receiving party - Aperture:

{"reqId":"ZIa@@KzPpvVAbue9QLMxLAAAAAg","level":3,"time":"12\/Jun\/2023:08:45:12","remoteAddr":"10.234.0.3","user":"--","app":"index","method":"POST","url":"\/index.php\/apps\/federatedfilesharing\/shares","message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Call to undefined method OCA\\\\FederatedGroups\\\\AppInfo\\\\Application::getOcmController()\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(169): OCA\\\\FederatedFileSharing\\\\Controller\\\\OcmController->createShare()\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController()\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(99): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch()\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main()\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(344): OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke()\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(916): OC\\\\Route\\\\Router->match()\\n#6 \\\/var\\\/www\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n#7 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/federatedfilesharing\\\/lib\\\/Controller\\\/OcmController.php\",\"Line\":185}"}

Sended party - Miskatonic;

{"reqId":"ZIa@9FiCdEbw-XyQp5gCkAAAAAI","level":0,"time":"12\/Jun\/2023:08:45:09","remoteAddr":"10.234.0.3","user":"surfsara","app":"OC\\User\\Session::validateToken","method":"GET","url":"\/ocs\/v1.php\/apps\/files_sharing\/api\/v1\/sharees?format=json&search=Demo+c&perPage=200&itemType=folder","message":"token 360760dc5cbf6c30361330306d7eae1b6c2025cf0b6447a2bf39c28b0f6190bf2ce941d103e9d08642f286fc7504029aadb0b80cadd28dcf2c4ab58131322ccc with token id 2552232 found, validating"}
{"reqId":"ZIa@9xk2-kDZ8nnVIEngbwAAAAA","level":0,"time":"12\/Jun\/2023:08:45:11","remoteAddr":"10.234.2.58","user":"surfsara","app":"OC\\User\\Session::validateToken","method":"POST","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json","message":"token 360760dc5cbf6c30361330306d7eae1b6c2025cf0b6447a2bf39c28b0f6190bf2ce941d103e9d08642f286fc7504029aadb0b80cadd28dcf2c4ab58131322ccc with token id 2552232 found, validating"}
{"reqId":"ZIa@9xk2-kDZ8nnVIEngbwAAAAA","level":0,"time":"12\/Jun\/2023:08:45:11","remoteAddr":"10.234.2.58","user":"surfsara","app":"OC\\User\\Session::validateToken","method":"POST","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json","message":"token 360760dc5cbf6c30361330306d7eae1b6c2025cf0b6447a2bf39c28b0f6190bf2ce941d103e9d08642f286fc7504029aadb0b80cadd28dcf2c4ab58131322ccc with token id 2552232 found, validating"}
{"reqId":"ZIa@9xk2-kDZ8nnVIEngbwAAAAA","level":3,"time":"12\/Jun\/2023:08:45:12","remoteAddr":"10.234.2.58","user":"surfsara","app":"no app in context","method":"POST","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json","message":"Failed to notify remote server of mixed group share, panic (Server error: `POST https:\/\/tst-aperture.data.surfsara.nl\/index.php\/apps\/federatedfilesharing\/shares` resulted in a `500 Internal Server Error` response:\n<!DOCTYPE html>\n<html class=\"ng-csp\" data-placeholder-focus=\"false\" lang=\"en\" >\n\t<head data-requesttoken=\"\">\n\t\t<meta cha (truncated...)\n)"}
{"reqId":"ZIa@@Rk2-kDZ8nnVIEngcAAAAAA","level":0,"time":"12\/Jun\/2023:08:45:13","remoteAddr":"10.234.2.58","user":"surfsara","app":"OC\\User\\Session::validateToken","method":"GET","url":"\/ocs\/v1.php\/apps\/files_sharing\/api\/v1\/sharees?format=json&search=Demo+collaboration+(uniharderwijk_democollab)+(SRAM+CO)&perPage=200&itemType=folder","message":"token 360760dc5cbf6c30361330306d7eae1b6c2025cf0b6447a2bf39c28b0f6190bf2ce941d103e9d08642f286fc7504029aadb0b80cadd28dcf2c4ab58131322ccc with token id 2552232 found, validating"}
{"reqId":"ZIa@@Rk2-kDZ8nnVIEngcAAAAAA","level":0,"time":"12\/Jun\/2023:08:45:13","remoteAddr":"10.234.2.58","user":"surfsara","app":"OC\\User\\Session::validateToken","method":"GET","url":"\/ocs\/v1.php\/apps\/files_sharing\/api\/v1\/sharees?format=json&search=Demo+collaboration+(uniharderwijk_democollab)+(SRAM+CO)&perPage=200&itemType=folder","message":"token 360760dc5cbf6c30361330306d7eae1b6c2025cf0b6447a2bf39c28b0f6190bf2ce941d103e9d08642f286fc7504029aadb0b80cadd28dcf2c4ab58131322ccc with token id 2552232 found, validating"}

Screenshot 2023-06-12 at 08 45 17

Removing a group share Receiving party - Aperture

{"reqId":"ZIa@kXp7DdzbcaK01gIINwAAAA8","level":3,"time":"12\/Jun\/2023:08:43:29","remoteAddr":"10.234.0.3","user":"--","app":"index","method":"POST","url":"\/index.php\/apps\/federatedfilesharing\/notifications","message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Call to undefined method OCA\\\\FederatedGroups\\\\AppInfo\\\\Application::getOcmController()\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(169): OCA\\\\FederatedFileSharing\\\\Controller\\\\OcmController->processNotification()\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController()\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(99): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch()\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main()\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(344): OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke()\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(916): OC\\\\Route\\\\Router->match()\\n#6 \\\/var\\\/www\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n#7 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/federatedfilesharing\\\/lib\\\/Controller\\\/OcmController.php\",\"Line\":312}"}

Sended party - Miskatonic

{"reqId":"ZIa@kKbSHuLMj208HoZo2QAAAAs","level":3,"time":"12\/Jun\/2023:08:43:29","remoteAddr":"10.234.0.3","user":"surfsara","app":"no app in context","method":"DELETE","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares\/2385?format=json","message":"Failed to notify remote server of mixed group share, panic (Server error: `POST https:\/\/tst-aperture.data.surfsara.nl\/index.php\/apps\/federatedfilesharing\/notifications` resulted in a `500 Internal Server Error` response:\n<!DOCTYPE html>\n<html class=\"ng-csp\" data-placeholder-focus=\"false\" lang=\"en\" >\n\t<head data-requesttoken=\"\">\n\t\t<meta cha (truncated...)\n)"}
{"reqId":"ZIa@kKbSHuLMj208HoZo2QAAAAs","level":1,"time":"12\/Jun\/2023:08:43:29","remoteAddr":"10.234.0.3","user":"surfsara","app":"core","method":"DELETE","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares\/2385?format=json","message":"cleaning 1 stray shared locks for files\/0f915fe586c99727cb9dd7df9ffcbe84"}
{"reqId":"ZIa@kKbSHuLMj208HoZo2QAAAAs","level":1,"time":"12\/Jun\/2023:08:43:29","remoteAddr":"10.234.0.3","user":"surfsara","app":"core","method":"DELETE","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares\/2385?format=json","message":"cleaning 1 stray shared locks for files\/df7874091b33ff621e907e1ec3970e79"}
{"reqId":"ZIa@kKbSHuLMj208HoZo2QAAAAs","level":1,"time":"12\/Jun\/2023:08:43:29","remoteAddr":"10.234.0.3","user":"surfsara","app":"core","method":"DELETE","url":"\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares\/2385?format=json","message":"cleaning 1 stray shared locks for files\/5886cc0eef51da3c2b057c42de50bb0b"}

Screenshot 2023-06-12 at 08 44 22

navid-shokri commented 1 year ago

@T0mWz can you share the error on the receiver side? It seems there should be an error on the share receiver party in the create share phase. the 500 error is coming from the receiver in response to the create share OCM message.

the second error may disappear after overcoming on first error.

T0mWz commented 1 year ago

See #193 too.

navid-shokri commented 1 year ago

@T0mWz No, It seems it has a different error: It seems your core code is a little bit different than ours.

navid-shokri commented 1 year ago

‍‍‍‍``` "reqId":"ZIa@@KzPpvVAbue9QLMxLAAAAAg","level":3,"time":"12\/Jun\/2023:08:45:12","remoteAddr":"10.234.0.3","user":"--","app":"index","method":"POST","url":"\/index.php\/apps\/federatedfilesharing\/shares", -------->"message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Call to undefined method OCA\\FederatedGroups\\AppInfo\\Application::getOcmController()\",\"Code\":0,\"Trace\":\"

0 \\/var\\/www\\/owncloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php(169): OCA\\FederatedFileSharing\\Controller\\OcmController->createShare()\n

1 \\/var\\/www\\/owncloud\\/lib\\/private\\/AppFramework\\/Http\\/Dispatcher.php(89): OC\\AppFramework\\Http\\Dispatcher->executeController()\n

2 \\/var\\/www\\/owncloud\\/lib\\/private\\/AppFramework\\/App.php(99): OC\\AppFramework\\Http\\Dispatcher->dispatch()\n

3 \\/var\\/www\\/owncloud\\/lib\\/private\\/AppFramework\\/Routing\\/RouteActionHandler.php(47): OC\\AppFramework\\App::main()\n

4 \\/var\\/www\\/owncloud\\/lib\\/private\\/Route\\/Router.php(344): OC\\AppFramework\\Routing\\RouteActionHandler->__invoke()\n

5 \\/var\\/www\\/owncloud\\/lib\\/base.php(916): OC\\Route\\Router->match()\n

6 \\/var\\/www\\/owncloud\\/index.php(54): OC::handleRequest()\n

------->#7 {main}\",\"File\":\"\\/var\\/www\\/owncloud\\/apps\\/federatedfilesharing\\/lib\\/Controller\\/OcmController.php\",\"Line\":185}"

according to the message line and line #7, the error occurs in line 185 of federatedfilesharing\OcmController.php.

But according to this link:

https://github.com/pondersource/core/blob/c2d3c6b32651279b8c5c519a476d5e5c864d928b/apps/federatedfilesharing/lib/Controller/OcmController.php#L185

it is in the parameter list of the create share function, So, my conclusion is: the receiver code is not matched with our patched version on the Owncloud.

@T0mWz @michielbdejong @thepeak99 I am looking for a session to investigate more in detail.

T0mWz commented 1 year ago

Updated the apps again. Encounter an another issue;

{"reqId":"ZIxodH1VWed9XRNc_Vde_wAAAAs","level":3,"time":"16\/Jun\/2023:15:49:40","remoteAddr":"10.234.2.58","user":"--","app":"index","method":"POST","url":"\/index.php\/apps\/federatedfilesharing\/notifications","message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Call to undefined method OCA\\\\FederatedGroups\\\\AppInfo\\\\Application::getOcmController()\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(169): OCA\\\\FederatedFileSharing\\\\Controller\\\\OcmController->processNotification()\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController()\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(99): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch()\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main()\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(344): OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke()\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(916): OC\\\\Route\\\\Router->match()\\n#6 \\\/var\\\/www\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n#7 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/federatedfilesharing\\\/lib\\\/Controller\\\/OcmController.php\",\"Line\":312}"}
{"reqId":"ZIxobp9Lw2NscQMYX1tdGgAAAA0","level":3,"time":"16\/Jun\/2023:15:49:34","remoteAddr":"10.234.0.3","user":"surfsara","app":"index","method":"GET","url":"\/index.php\/apps\/files_sharing\/api\/externalShares","message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Call to undefined method OCA\\\\FederatedGroups\\\\AppInfo\\\\Application::getExternalManager()\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/AppInfo\\\/Application.php(84): OCA\\\\Files_Sharing\\\\Controllers\\\\ExternalSharesController->__construct()\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/composer\\\/pimple\\\/pimple\\\/src\\\/Pimple\\\/Container.php(122): OCA\\\\Files_Sharing\\\\AppInfo\\\\Application->OCA\\\\Files_Sharing\\\\AppInfo\\\\{closure}(*** sensitive parameters replaced ***)\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Utility\\\/SimpleContainer.php(107): Pimple\\\\Container->offsetGet()\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(76): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->query()\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main()\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(344): OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke()\\n#6 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(916): OC\\\\Route\\\\Router->match()\\n#7 \\\/var\\\/www\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n#8 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/files_sharing\\\/lib\\\/Controllers\\\/ExternalSharesController.php\",\"Line\":74}"}

As attachment my applied patch owncloud-sram-10.12.1.patch

navid-shokri commented 1 year ago

So, I checked again and it seems that your Owncloud core version is not the same as ours in this branch. Are you sure that you are using the correct git branch to apply the patches?

as you can find in this link there is no Application::getOcmController() method call:

https://github.com/pondersource/core/blob/c2d3c6b32651279b8c5c519a476d5e5c864d928b/apps/federatedfilesharing/lib/Controller/OcmController.php#L312

but your log is addressing call of Application::getOcmController() function:

{"reqId":"ZIxodH1VWed9XRNc_Vde_wAAAAs","level":3,"time":"16\/Jun\/2023:15:49:40","remoteAddr":"10.234.2.58","user":"--","app":"index","method":"POST","url":"\/index.php\/apps\/federatedfilesharing\/notifications","message":"Exception: {\"Exception\":\"Error\",
---------->\"Message\":\"Call to undefined method OCA\\\\FederatedGroups\\\\AppInfo\\\\Application::getOcmController()\",\"Code\":0,\"Trace\":\"

#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(169): OCA\\\\FederatedFileSharing\\\\Controller\\\\OcmController->processNotification()\\n
#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController()\\n
#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(99): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch()\\n
#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main()\\n
#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(344): OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke()\\n
#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(916): OC\\\\Route\\\\Router->match()\\n
#6 \\\/var\\\/www\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n
----------> #7 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/apps\\\/federatedfilesharing\\\/lib\\\/Controller\\\/OcmController.php\",\"Line\":312}"}
T0mWz commented 1 year ago

‍‍‍‍``` "reqId":"ZIa@@KzPpvVAbue9QLMxLAAAAAg","level":3,"time":"12/Jun/2023:08:45:12","remoteAddr":"10.234.0.3","user":"--","app":"index","method":"POST","url":"/index.php/apps/federatedfilesharing/shares", -------->"message":"Exception: {"Exception":"Error","Message":"Call to undefined method OCA\FederatedGroups\AppInfo\Application::getOcmController()","Code":0,"Trace":" #0 \/var\/www\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(169): OCA\FederatedFileSharing\Controller\OcmController->createShare()\n #1 \/var\/www\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(89): OC\AppFramework\Http\Dispatcher->executeController()\n #2 \/var\/www\/owncloud\/lib\/private\/AppFramework\/App.php(99): OC\AppFramework\Http\Dispatcher->dispatch()\n #3 \/var\/www\/owncloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php(47): OC\AppFramework\App::main()\n #4 \/var\/www\/owncloud\/lib\/private\/Route\/Router.php(344): OC\AppFramework\Routing\RouteActionHandler->__invoke()\n #5 \/var\/www\/owncloud\/lib\/base.php(916): OC\Route\Router->match()\n #6 \/var\/www\/owncloud\/index.php(54): OC::handleRequest()\n ------->#7 {main}","File":"\/var\/www\/owncloud\/apps\/federatedfilesharing\/lib\/Controller\/OcmController.php","Line":185}"

according to the message line and line #7, the error occurs in line 185 of federatedfilesharing\OcmController.php.

But according to this link:

https://github.com/pondersource/core/blob/c2d3c6b32651279b8c5c519a476d5e5c864d928b/apps/federatedfilesharing/lib/Controller/OcmController.php#L185

it is in the parameter list of the create share function, So, my conclusion is: the receiver code is not matched with our patched version on the Owncloud.

@T0mWz @michielbdejong @thepeak99 I am looking for a session to investigate more in detail.

This app version is different then my app version..

Here is an app version number.. Please use that, so it's more clear of we are in sync in stead of apply your own patches.. https://github.com/pondersource/core/blob/c2d3c6b32651279b8c5c519a476d5e5c864d928b/apps/federatedfilesharing/appinfo/info.xml#L8

navid-shokri commented 1 year ago

@T0mWz sorry we could not because we have some changes on that app you can find our changes in this branch

T0mWz commented 1 year ago

@T0mWz sorry we could not because we have some changes on that app you can find our changes in this branch

@navid-shokri How should I find out what changes you all made? Can you provide me with a patch / diff file?

navid-shokri commented 1 year ago

absolutely yes!!!

https://github.com/owncloud/core/pull/40589/files