pondersource / sciencemesh-php

Connect your Nextcloud server to Sciencemesh
MIT License
0 stars 1 forks source link

Network Beta Testing #180

Closed michielbdejong closed 1 year ago

michielbdejong commented 1 year ago

We're testing sharing in both directions between {mesh|cloud}.pondersource.org and {sm1|sm2}.cernbox.cern.ch Next error:

>> ocm-share-create -grantee lopresti -idp sm1.cernbox.cern.ch /home/testing
error: code=CODE_INVALID_ARGUMENT msg="invalid parameters" support_trace="7bc1c1845b560a29104f173d81b67c46"
michielbdejong commented 1 year ago

Reva logs show:

2023-04-05 07:03:14.575 INF ../reva/pkg/ocm/share/repository/nextcloud/nextcloud.go:427 > am.do https://cloud.pondersource.org/index.php/apps/sciencemesh/~einstei
n/api/ocm/addSentShare {"resourceId":{"storageId":"00000000-0000-0000-0000-000000000000", "opaqueId":"fileid-/home/testing"}, "name":"home", "token":"KEwsLKi4d4Oj
EcHsgsq5NYwwS5ve1AFY", "grantee":{"type":"GRANTEE_TYPE_USER", "userId":{"idp":"sm1.cernbox.cern.ch", "opaqueId":"lopresti", "type":"USER_TYPE_PRIMARY"}}, "owner":
{"idp":"https://mesh.pondersource.org/", "opaqueId":"einstein"}, "creator":{"idp":"https://mesh.pondersource.org/", "opaqueId":"einstein"}, "ctime":{"seconds":"16
80678194", "nanos":575717581}, "mtime":{"seconds":"1680678194", "nanos":575717581}, "shareType":"SHARE_TYPE_USER", "accessMethods":[{"webdavOptions":{"permissions
":{"getPath":true, "getQuota":true, "initiateFileDownload":true, "listGrants":true, "listContainer":true, "listFileVersions":true, "listRecycle":true, "stat":true
}}}]} pid=1616949 pkg=rgrpc traceid=9d3a26f20eb4b7a74d7dc0a16983a320
2023-04-05 07:03:14.668 INF ../reva/pkg/ocm/share/repository/nextcloud/nextcloud.go:448 > am.do response 201 "2" pid=1616949 pkg=rgrpc traceid=9d3a26f20eb4b7a74d7
dc0a16983a320

and then nothing

michielbdejong commented 1 year ago

This seems to be a 400 response on the other side, see https://github.com/cs3org/reva/blob/6f953aea4f8dc236d02bcbe0a1485b2be4ad7d7f/pkg/ocm/client/client.go#L220

michielbdejong commented 1 year ago
OCM send to https://sm1.cernbox.cern.ch/ocm/shares: {
"shareWith":"lopresti@sm1.cernbox.cern.ch",
"name":"home",
"description":"",
"resourceId":"00000000-0000-0000-0000-000000000000:fileid-/home/testing",
"owner":"einstein@",
"sender":"einstein@",
"ownerDisplayName":"",
"senderDisplayName":"einstein",
"shareType":"user",
"expiration":0,
"resourceType":"folder",
"protocol":{
"name":"multi",
  "options":{},
  "webdav":{
    "sharedSecret":"",
    "permissions":["read"],
    "url":"remote.php/dav/ocm/CjK83H05UmTMS6AcE0hwyQ6gomgBLdFH"
    }
  }
}
OCM response from https://sm1.cernbox.cern.ch/ocm/shares: 400 {
  "code": "INVALID_PARAMETER",
  "message": "Key: 'createShareRequest.Protocols' 
              Error:Field validation for 'Protocols' failed on the 'required' tag"
}
michielbdejong commented 1 year ago

@glpatcern what is happening here?

glpatcern commented 1 year ago

The sm1 server was not updated to latest master :) I'm updating it

michielbdejong commented 1 year ago

OK! Retrying now.

michielbdejong commented 1 year ago

Hm, looks like it's still broken:

root@mesh:~/ocm-test-suite/reva/cmd/reva# ./reva -insecure ocm-share-create -grantee lopresti -idp sm2.cernbox.cern.ch /home/testing
error: code=CODE_INVALID_ARGUMENT msg="invalid parameters response from other OCM server" support_trace="32586bb5974ee65b0fcf97bfbdcde246"
root@mesh:~/ocm-test-suite/reva/cmd/reva# ./reva -insecure ocm-share-create -grantee lopresti -idp sm1.cernbox.cern.ch /home/testing
error: code=CODE_INVALID_ARGUMENT msg="invalid parameters response from other OCM server" support_trace="11f830500ff27e6282679e5a7be89534"

And server-side log:

2023-04-06 07:49:12.533 DBG ../reva/pkg/ocm/client/client.go:199 > OCM send to https://sm1.cernbox.cern.ch/ocm/shares: {"shareWith":"lopresti@sm1.cernbox.cern.ch","name":"home","description":"","resourceId":"00000000-0000-0000-0000-000000000000:fileid-/home/testing","owner":"einstein@","sender":"einstein@","ownerDisplayName":"","senderDisplayName":"einstein","shareType":"user","expiration":0,"resourceType":"folder","protocol":{"name":"multi","options":{},"webdav":{"sharedSecret":"","permissions":["read"],"url":"remote.php/dav/ocm/d5GSaVmnlM1xCHlqfkMUo5r0e5WhILJ9"}}}
 pid=1621505 pkg=rgrpc traceid=8f8ed4be34ee5da6ae6afdba68510372
2023-04-06 07:49:12.675 DBG ../reva/pkg/ocm/client/client.go:219 > OCM response from https://sm1.cernbox.cern.ch/ocm/shares: 400 {
  "code": "INVALID_PARAMETER",
  "message": "Key: 'createShareRequest.Protocols' Error:Field validation for 'Protocols' failed on the 'required' tag"
} pid=1621505 pkg=rgrpc traceid=8f8ed4be34ee5da6ae6afdba68510372

See also https://github.com/pondersource/nc-sciencemesh/issues/271 - I think OCM is just broken in the master branch of Reva, probably some untested code was merged. :(

glpatcern commented 1 year ago

I tried this yesterday and indeed I got the same from the pondersource server, yet trying between two revad at CERN (both running the current master) it worked.

I guess with our configuration we don't trigger some (now broken) code path, as we use an SQL driver to store the shares as opposed to the JSON driver, and we also use the production LDAP as idp + production storage provider (EOS).

Anyway, I won't be able to help today - I'm off until next week. @gmgigi96 will be back on Tuesday. Happy Easter!

On 06/04/2023 09:51, Michiel de Jong wrote:

|invalid parameters response from other OCM server|

michielbdejong commented 1 year ago

Thanks! I'll try to fix it.