Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share invite on virtual drive returns 500 #8495

Closed
amrita-shrestha opened this issue Feb 20, 2024 · 2 comments · Fixed by #8610
Closed

Share invite on virtual drive returns 500 #8495

amrita-shrestha opened this issue Feb 20, 2024 · 2 comments · Fixed by #8610
Assignees
Labels

Comments

@amrita-shrestha
Copy link
Contributor

Describe the bug

Share virtual drive with other users return 500 status code
Similar type of bug: #8494

Steps to reproduce

  • create user dummy and sammy
  • user sammy sends share invite on Share/Virtual drive to user dummy
    https://localhost:9200/graph/v1beta1/drives/{drive-item}/items/{item-id}/invite
    (item-id will be <oc:fileid> from api response of propfind on user sammy virtual-drive-id)
curl -X PROPFIND 'https://localhost:9200/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668' \

.......
    <d:response>
        .......
                <oc:fileid>a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!a0ca6a90-a365-4782-871e-d44447bbc668</oc:fileid>
curl --location --request POST 'https://localhost:9200/graph/v1beta1/drives/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668/items/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668!a0ca6a90-a365-4782-871e-d44447bbc668/invite' \
--data-raw '{
  "recipients": [
    {
      "@libre.graph.recipient.type": "user",
      "objectId": "1bac9409-47ca-4066-a562-941b0ff68032"
    }
  ],
  "roles": [
    "3a4ba8e9-6a0d-4235-9140-0e7a34007abe"
  ]
}'

-----------------------Response-------------------------------
{
    "error": {
        "code": "generalException",
        "innererror": {
            "date": "2024-02-20T11:43:48Z",
            "request-id": "amrita-OptiPlex-3050/ap6P8vS3TY-011017"
        },
        "message": "rpc error: code = Unimplemented desc = gateway: error adding grant to storage: gateway: error calling AddGrant: rpc error: code = Unimplemented desc = method not implemented"
    }
}

Expected behavior

status code should be 4xx rather than 5xx with better error message

Actual behavior

500 status code is returned

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

OCIS_XXX=5.1.0-prealpha+ccc729936c
OCIS_YYY=latest
Web client version	8.0.0-rc.4

Additional context

Add any other context about the problem here.

@2403905
Copy link
Contributor

2403905 commented Mar 8, 2024

If the method is not implemented it should be 501, right?

@rhafer
Copy link
Contributor

rhafer commented Mar 12, 2024

Hm, I think for the user of the graph service returning a 400 (Bad Request) or 405 (Method not allowed) would be more helpful in this special case. The 500 is coming from the sharestorageprovider, because that one does not implement the AddGrant Method. But that is an implementation detail that is not relevant for the user of the graph API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants