pondersource / oc-sciencemesh

Sciencemesh app for Own Cloud
MIT License
0 stars 1 forks source link

marie cannot see the shared file. #6

Closed shokri-navid closed 2 years ago

shokri-navid commented 2 years ago

Einstein can select Marie as a list item when he wants to share something. when Einstein will click on Marie in the list Marie Adds to the Sharee party of the file in the Einstein OC file Manger but Marie cannot see the shared file in her OC file manager app.

shokri-navid commented 2 years ago

there is no error on OC ajax calls, and also no error on revaoc1, and there is no incoming request in revaoc2

michielbdejong commented 2 years ago

It should be calling createShare at https://github.com/pondersource/OC-Sciencemesh/blob/75d958065653325439c4c25a49a63a5a849d5cf0/lib/ShareProvider/ShareAPIHelper.php#L82 - is it reaching that point in the code?

shokri-navid commented 2 years ago

it just calls the share API of the files_sharing app of the Owncloud but there are no logs on reva1 that indicate oc1 call any API on reva1.

I do not think it reaches there, also the result of API call is status code 200 with this body: {"ocs":{"meta":{"status":"ok","statuscode":200,"message":null,"totalitems":"","itemsperpage":""},"data":[{"id":"5","share_type":6,"uid_owner":"einstein","displayname_owner":"einstein","permissions":19,"stime":1656402753,"parent":null,"expiration":null,"token":"foo","uid_file_owner":"einstein","displayname_file_owner":"einstein","additional_info_owner":null,"additional_info_file_owner":null,"path":"\/test.txt","mimetype":"text\/plain","storage_id":"home::einstein","storage":1,"item_type":"file","item_source":50,"file_source":50,"file_parent":3,"file_target":"","share_with":"marie@revaoc2.docker","share_with_displayname":"marie@revaoc2.docker","mail_send":0,"attributes":null}]}}

shokri-navid commented 2 years ago

there is no error in data/owncloud.log folder in oc1 container

shokri-navid commented 2 years ago

also, there is no error /var/log/apache2/error.log

shokri-navid commented 2 years ago

I will take a look at nc-sciencemesh app to figure out what could be the missing part

shokri-navid commented 2 years ago

I looked at nc-sciencemesh and I figure out that there are some changes that are done on NextCloud core in this repo: https://github.com/pondersource/server/tree/dynamic-shareproviders 1- https://github.com/pondersource/server/blob/dynamic-shareproviders/apps/files_sharing/lib/Controller/ShareAPIController.php --> Line 703 + Line 350 2- https://github.com/pondersource/server/blob/dynamic-shareproviders/lib/private/Share20/Manager.php --> Line 248 3- https://github.com/pondersource/server/blob/dynamic-shareproviders/lib/public/Share/IShare.php --> Line 122 4- https://github.com/pondersource/server/blob/dynamic-shareproviders/lib/private/Share20/ProviderFactory.php --> Line 290

shokri-navid commented 2 years ago

the first item is done.

mrvahedi68 commented 2 years ago

When Einstein share a file with Marie this function called:

https://github.com/pondersource/oc-sciencemesh/blob/df0c316c5be18098589909e2373d1729a5717e67/lib/ShareProvider/ScienceMeshShareProvider.php#L240

at this function only add a share to Einstein's database and for adding it to Marie's database we must fix the commented lines that sends a notification to Marie to accept and add a share to her database.

the first thing that must be fixed is cloudIdManager which must inject correctly. Currently it throws this exception: error: Call to a member function getCloudId() on null witch cloudIdManager is null here.

shokri-navid commented 2 years ago

@mrvahedi68 this is commented in ScienceMesh of NextCloud and I think this part of the code is an abandoned try to achieve the goal.

shokri-navid commented 2 years ago

I take one more step toward final sharing. in the current state when einstein shares a file with marine all API calls are successful in 200 HTTP status code. and also there is an HTTP call from einstein's Reva to Marie's Reva.

shokri-navid commented 2 years ago

on the other side it is another HTTP call from Marie's Reva to Einstein's Owncloud Sciencemesh app that create such log:

2022-07-07 12:03:59.64 INF ../../reva/pkg/ocm/share/manager/nextcloud/nextcloud.go:191 > am.do https://oc2.docker/index.php/apps/sciencemesh/~marie/api/ocm/addReceivedShare {"share":{"resourceId":{"storageId":"remote","opaqueId":"/welcome.txt"},"name":"/welcome.txt","permissions":{"permissions":{"getPath":true,"getQuota":true,"initiateFileDownload":true,"listGrants":true,"listContainer":true,"listFileVersions":true,"listRecycle":true,"stat":true}},"grantee":{"type":"GRANTEE_TYPE_USER","userId":{"idp":"https://revaoc2.docker/","opaqueId":"marie"},"opaque":{"map":{"remoteShareId":{"decoder":"plain","value":"eyJ0b2RvIjoiY29tcGlsZSB0aGlzIGluZm8gZnJvbSB2YXJpb3VzIGRhdGFiYXNlIHRhYmxlcyJ9"},"sharedSecret":{"decoder":"plain","value":"aGFhZUFSaVF6ZQ=="}}}},"owner":{"idp":"https://revaoc1.docker/","opaqueId":"einstein","type":"USER_TYPE_PRIMARY"},"creator":{"idp":"https://revaoc1.docker/","opaqueId":"einstein","type":"USER_TYPE_PRIMARY"},"shareType":"SHARE_TYPE_REGULAR"},"state":"SHARE_STATE_PENDING"} pid=7 pkg=rgrpc traceid=650b52cdb096f31b39eaa8fad864b1fe
2022-07-07 12:03:59.87 INF ../../reva/pkg/ocm/share/manager/nextcloud/nextcloud.go:212 > am.do response 500 <!DOCTYPE html>
<html class="ng-csp" data-placeholder-focus="false" lang="en" >
        <head data-requesttoken="">
                <meta charset="utf-8">
                <title>
                ownCloud                </title>
                <meta http-equiv="X-UA-Compatible" content="IE=edge">
                <meta name="referrer" content="never">
                <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
                                        <meta name="apple-itunes-app" content="app-id=1359583808">
                                <meta name="theme-color" content="#041e42">
                <link rel="icon" href="/core/img/favicon.ico">
                <link rel="apple-touch-icon-precomposed" href="/core/img/favicon-touch.png">
                <link rel="mask-icon" sizes="any" href="/core/img/favicon-mask.svg" color="#041e42">
                                        <link rel="stylesheet" href="/core/vendor/select2/select2.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/styles.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/inputs.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/header.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/icons.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/fonts.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/apps.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/global.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/fixes.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/multiselect.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/mobile.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/vendor/jquery-ui/themes/base/jquery-ui.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/jquery-ui-fixes.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/tooltip.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/share.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/apps/files_versions/css/versions.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                        <link rel="stylesheet" href="/core/css/jquery.ocdialog.css?v=988aa7c922b23fb7c36fc75c2c4ad3a6">
                                                                        <script src="/core/vendor/jquery/dist/jquery.min.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/jquery-migrate/jquery-migrate.min.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/jquery-ui/ui/jquery-ui.custom.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/underscore/underscore.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/moment/min/moment-with-locales.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/handlebars/handlebars.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/blueimp-md5/js/md5.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/bootstrap/js/tooltip.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/backbone/backbone.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/es6-promise/es6-promise.auto.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/davclient.js/lib/client.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/clipboard/dist/clipboard.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/bowser/src/bowser.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/jquery.ocdialog.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/oc-dialogs.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/js.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/l10n.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/octemplate.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/eventsource.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/config.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/search/js/search.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/oc-requesttoken.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/apps.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/mimetype.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/mimetypelist.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/snapjs/dist/latest/snap.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/vendor/select2/select2.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/oc-backbone.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/oc-backbone-webdav.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/placeholder.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/jquery.avatar.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/shareconfigmodel.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/sharemodel.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/sharescollection.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/shareitemmodel.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/sharedialogresharerinfoview.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/sharedialoglinklistview.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/sharedialoglinkshareview.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/sharedialogmailview.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/sharedialoglinksocialview.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/sharedialoglinkexpirationview.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/sharedialogshareelistview.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/sharedialogview.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/share.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/user.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/files/fileinfo.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        <script src="/core/js/files/client.js?v=988aa7c922b23fb7c36fc75c2c4ad3a6"></script>
                                        </head>
        <body id="body-login"  >
                <noscript>
        <div id="nojavascript">
                <div>
                        This application requires JavaScript for correct operation. Please <a href="http://enable-javascript.com/" target="_blank" rel="noreferrer">enable JavaScript</a> and reload the page.            </div>
        </div>
</noscript>
                <div class="wrapper">
                        <div class="v-align">
                                                                        <header role="banner">
                                                <div id="header">
                                                        <div class="logo">
                                                                <h1 class="hidden-visually">
                                                                        ownCloud                                                                </h1>
                                                        </div>
                                                        <div id="logo-claim" style="display:none;"></div>
                                                </div>
                                        </header>
                                                                <span class="error error-wide">
        <h2><strong>Internal Server Error</strong></h2>
                <p>The server encountered an internal error and was unable to complete your request.</p>
                <p>Please contact the server administrator if this error reappears multiple times and include the technical details below in your report.</p>
                <p>More details can be found in the <a target="_blank" rel="noreferrer" href="https://doc.owncloud.com/server/10.10/go.php?to=admin-logfiles">server log</a>.</p>
        <br>

        <h2><strong>Technical details</strong></h2>
        <ul>
                <li>Remote Address: 172.20.0.8</li>
                <li>Request ID: SKxfNY7SWAjgMg7j9iCg</li>
                        </ul>

        </span>
                        </div>
                </div>
                <footer role="contentinfo">
                        <p class="info">
                                <a href="https://owncloud.com" target="_blank" rel="noreferrer">ownCloud</a> &ndash; A safe home for all your data</p>
                </footer>
        </body>
</html>
 pid=7 pkg=rgrpc traceid=650b52cdb096f31b39eaa8fad864b1fe
2022-07-07 12:03:59.871 DBG ../../reva/internal/grpc/interceptors/log/log.go:66 > unary code=OK end="07/Jul/2022:12:03:59 +0000" from=tcp://127.0.0.1:41654 pid=7 pkg=rgrpc start="07/Jul/2022:12:03:59 +0000" time_ns=231266581 traceid=650b52cdb096f31b39eaa8fad864b1fe uri=/cs3.ocm.core.v1beta1.OcmCoreAPI/CreateOCMCoreShare user-agent=grpc-go/1.45.0
2022-07-07 12:03:59.871 DBG ../../reva/internal/grpc/interceptors/log/log.go:66 > unary code=OK end="07/Jul/2022:12:03:59 +0000" from=tcp://127.0.0.1:40862 pid=7 pkg=rgrpc start="07/Jul/2022:12:03:59 +0000" time_ns=232291307 traceid=7acf4a679bbbcc6c9e8cb1aab5d53bec uri=/cs3.gateway.v1beta1.GatewayAPI/CreateOCMCoreShare user-agent=grpc-go/1.45.0
2022-07-07 12:03:59.872 INF ../../reva/internal/http/services/ocmd/shares.go:253 > Share created. pid=7 pkg=rhttp traceid=4e5feb81fa1258def982da08d9cae409
2022-07-07 12:03:59.872 DBG ../../reva/internal/http/interceptors/log/log.go:112 > http end="07/Jul/2022:12:03:59 +0000" host=172.20.0.7 method=POST pid=7 pkg=rhttp proto=HTTP/2.0 size=11006 start="07/Jul/2022:12:03:59 +0000" status=201 time_ns=427149921 traceid=4e5feb81fa1258def982da08d9cae409 uri=/ocm/shares url=/ocm/shares
shokri-navid commented 2 years ago

and this is the log of Einstein's Owncloud

[Thu Jul 07 12:03:19.795560 2022] [php7:notice] [pid 80] [client 172.20.0.7:47204] FIXME: shareInfoToResourceInfo not implemented

shokri-navid commented 2 years ago

and it is the log inside marie's Owncloud:

{"reqId":"tysXfOYJi7QmPnwygkev","level":3,"time":"2022-07-07T12:03:20+00:00","remoteAddr":"172.20.0.8","user":"--","app":"index","method":"POST","url":"\/index.php\/apps\/sciencemesh\/~marie\/api\/ocm\/addReceivedShare","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\InvalidFieldNameException\",\"Message\":\"An exception occurred while executing 'INSERT INTO `oc_share_external` (`share_type`, `remote`, `remote_id`, `share_token`, `password`, `name`, `owner`, `user`, `mountpoint`, `mountpoint_hash`, `accepted`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [1000, \\\"https:\\\\\\\/\\\\\\\/revaoc1.docker\\\\\\\/\\\", \\\"{\\\\\\\"todo\\\\\\\":\\\\\\\"compile this info from various database tables\\\\\\\"}\\\", \\\"NYQFpbcCnp\\\", \\\"\\\", \\\"\\\\\\\/welcome.txt\\\", \\\"einstein\\\", \\\"marie\\\", \\\"{{TemporaryMountPointName#\\\\\\\/welcome.txt}}\\\", \\\"32021e94fecfcd644f9a5666263732f5\\\", 0]:\\n\\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'share_type' in 'field list'\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(182): Doctrine\\\\DBAL\\\\Driver\\\\AbstractMySQLDriver->convertException()\\n#1 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(159): Doctrine\\\\DBAL\\\\DBALException::wrapException()\\n#2 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(2226): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery()\\n#3 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(1538): Doctrine\\\\DBAL\\\\Connection->handleExceptionDuringQuery()\\n#4 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/DB\\\/Connection.php(238): Doctrine\\\\DBAL\\\\Connection->executeStatement()\\n#5 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Query\\\/QueryBuilder.php(216): OC\\\\DB\\\\Connection->executeStatement()\\n#6 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/DB\\\/QueryBuilder\\\/QueryBuilder.php(142): Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder->execute()\\n#7 \\\/var\\\/www\\\/html\\\/apps\\\/sciencemesh\\\/lib\\\/ShareProvider\\\/ScienceMeshShareProvider.php(427): OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder->execute()\\n#8 \\\/var\\\/www\\\/html\\\/apps\\\/sciencemesh\\\/lib\\\/ShareProvider\\\/ScienceMeshShareProvider.php(1441): OCA\\\\ScienceMesh\\\\ShareProvider\\\\ScienceMeshShareProvider->addReceivedShareToDB()\\n#9 \\\/var\\\/www\\\/html\\\/apps\\\/sciencemesh\\\/lib\\\/Controller\\\/RevaController.php(843): OCA\\\\ScienceMesh\\\\ShareProvider\\\\ScienceMeshShareProvider->addScienceMeshShare()\\n#10 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(170): OCA\\\\ScienceMesh\\\\Controller\\\\RevaController->addReceivedShare()\\n#11 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController()\\n#12 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/App.php(100): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch()\\n#13 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main()\\n#14 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Route\\\/Router.php(344): OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke()\\n#15 \\\/var\\\/www\\\/html\\\/lib\\\/base.php(928): OC\\\\Route\\\\Router->match()\\n#16 \\\/var\\\/www\\\/html\\\/index.php(54): OC::handleRequest()\\n#17 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractMySQLDriver.php\",\"Line\":79}"}
{"reqId":"tysXfOYJi7QmPnwygkev","level":3,"time":"2022-07-07T12:03:20+00:00","remoteAddr":"172.20.0.8","user":"--","app":"index","method":"POST","url":"\/index.php\/apps\/sciencemesh\/~marie\/api\/ocm\/addReceivedShare","message":"Caused by: {\"Exception\":\"Doctrine\\\\DBAL\\\\Driver\\\\PDO\\\\Exception\",\"Message\":\"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'share_type' in 'field list'\",\"Code\":\"42S22\",\"Trace\":\"#0 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/PDOStatement.php(119): Doctrine\\\\DBAL\\\\Driver\\\\PDO\\\\Exception::new()\\n#1 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(1527): Doctrine\\\\DBAL\\\\Driver\\\\PDOStatement->execute()\\n#2 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/DB\\\/Connection.php(238): Doctrine\\\\DBAL\\\\Connection->executeStatement()\\n#3 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Query\\\/QueryBuilder.php(216): OC\\\\DB\\\\Connection->executeStatement()\\n#4 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/DB\\\/QueryBuilder\\\/QueryBuilder.php(142): Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder->execute()\\n#5 \\\/var\\\/www\\\/html\\\/apps\\\/sciencemesh\\\/lib\\\/ShareProvider\\\/ScienceMeshShareProvider.php(427): OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder->execute()\\n#6 \\\/var\\\/www\\\/html\\\/apps\\\/sciencemesh\\\/lib\\\/ShareProvider\\\/ScienceMeshShareProvider.php(1441): OCA\\\\ScienceMesh\\\\ShareProvider\\\\ScienceMeshShareProvider->addReceivedShareToDB()\\n#7 \\\/var\\\/www\\\/html\\\/apps\\\/sciencemesh\\\/lib\\\/Controller\\\/RevaController.php(843): OCA\\\\ScienceMesh\\\\ShareProvider\\\\ScienceMeshShareProvider->addScienceMeshShare()\\n#8 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(170): OCA\\\\ScienceMesh\\\\Controller\\\\RevaController->addReceivedShare()\\n#9 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController()\\n#10 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/App.php(100): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch()\\n#11 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main()\\n#12 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Route\\\/Router.php(344): OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke()\\n#13 \\\/var\\\/www\\\/html\\\/lib\\\/base.php(928): OC\\\\Route\\\\Router->match()\\n#14 \\\/var\\\/www\\\/html\\\/index.php(54): OC::handleRequest()\\n#15 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/PDO\\\/Exception.php\",\"Line\":18}"}
{"reqId":"tysXfOYJi7QmPnwygkev","level":3,"time":"2022-07-07T12:03:20+00:00","remoteAddr":"172.20.0.8","user":"--","app":"index","method":"POST","url":"\/index.php\/apps\/sciencemesh\/~marie\/api\/ocm\/addReceivedShare","message":"Caused by: {\"Exception\":\"PDOException\",\"Message\":\"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'share_type' in 'field list'\",\"Code\":\"42S22\",\"Trace\":\"#0 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/PDOStatement.php(117): PDOStatement->execute()\\n#1 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(1527): Doctrine\\\\DBAL\\\\Driver\\\\PDOStatement->execute()\\n#2 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/DB\\\/Connection.php(238): Doctrine\\\\DBAL\\\\Connection->executeStatement()\\n#3 \\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Query\\\/QueryBuilder.php(216): OC\\\\DB\\\\Connection->executeStatement()\\n#4 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/DB\\\/QueryBuilder\\\/QueryBuilder.php(142): Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder->execute()\\n#5 \\\/var\\\/www\\\/html\\\/apps\\\/sciencemesh\\\/lib\\\/ShareProvider\\\/ScienceMeshShareProvider.php(427): OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder->execute()\\n#6 \\\/var\\\/www\\\/html\\\/apps\\\/sciencemesh\\\/lib\\\/ShareProvider\\\/ScienceMeshShareProvider.php(1441): OCA\\\\ScienceMesh\\\\ShareProvider\\\\ScienceMeshShareProvider->addReceivedShareToDB()\\n#7 \\\/var\\\/www\\\/html\\\/apps\\\/sciencemesh\\\/lib\\\/Controller\\\/RevaController.php(843): OCA\\\\ScienceMesh\\\\ShareProvider\\\\ScienceMeshShareProvider->addScienceMeshShare()\\n#8 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(170): OCA\\\\ScienceMesh\\\\Controller\\\\RevaController->addReceivedShare()\\n#9 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController()\\n#10 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/App.php(100): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch()\\n#11 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main()\\n#12 \\\/var\\\/www\\\/html\\\/lib\\\/private\\\/Route\\\/Router.php(344): OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke()\\n#13 \\\/var\\\/www\\\/html\\\/lib\\\/base.php(928): OC\\\\Route\\\\Router->match()\\n#14 \\\/var\\\/www\\\/html\\\/index.php(54): OC::handleRequest()\\n#15 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/lib\\\/composer\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/PDOStatement.php\",\"Line\":117}"}
shokri-navid commented 2 years ago

I found the problem:

It seems there is a share_type column added newly to the oc_share_external by the Sciencemesh project that should be migrated on the installation process of the app or Owncloud application.

shokri-navid commented 2 years ago

none of the database Migrations did run on installation and it should be checked :(

mrvahedi68 commented 2 years ago

This exception creates from OC-scienceMesh at this line:

https://github.com/pondersource/oc-sciencemesh/blob/df0c316c5be18098589909e2373d1729a5717e67/lib/ShareProvider/ScienceMeshShareProvider.php#L416

if we comment out this line exception will be gone, but the insertion does not complete. So we must continue to find why nothing inserts into DB without any error.

mrvahedi68 commented 2 years ago

After removing share_type from the above function, Marie received the share and insert it into her database.

shokri-navid commented 2 years ago

I test federated sharing between oc1.docker and oc2.docker and it was successful it created just one row inside the oc_share_external table of oc2.docker (marine as share). so, I do not know why Sciencemesh is trying to add the information of the shared file inside the oc_share table

mrvahedi68 commented 2 years ago

ScienceMesh also add inside oc_external_share of marie DB.

shokri-navid commented 2 years ago

I remove all share_type column references of oc_share_external table and it worked. currently marine can see the shared file.