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

Sharing folder fails with shareType must be an integer error response #15839

Closed
Tracked by #15840
dkocher opened this issue Apr 16, 2024 · 6 comments · Fixed by #15840
Closed
Tracked by #15840

Sharing folder fails with shareType must be an integer error response #15839

dkocher opened this issue Apr 16, 2024 · 6 comments · Fixed by #15840
Assignees
Labels

Comments

@dkocher
Copy link
Contributor

dkocher commented Apr 16, 2024

Relates to #15838. When connected to oCIS, sharing a folder with the request {"path":"/remote.php/webdav/d","shareType":3,"permissions":4} fails with response

HTTP/1.1 400 Bad Request
Content-Length: 160
Content-Type: text/xml; charset=utf-8
Date: Tue, 16 Apr 2024 08:59:11 GMT
Ocs-Api-Version: 2
Vary: Origin
X-Request-Id: bf1ed42bf42f/8qs05uaikb-002006

<?xml version="1.0" encoding="UTF-8"?>
<ocs><meta><status>error</status><statuscode>400</statuscode><message>shareType must be an integer</message></meta></ocs>
@dkocher dkocher self-assigned this Apr 16, 2024
@dkocher dkocher linked a pull request Apr 16, 2024 that will close this issue
3 tasks
@dkocher dkocher mentioned this issue Apr 16, 2024
3 tasks
@micbar
Copy link

micbar commented Apr 18, 2024

Can you post the request also?

@dkocher
Copy link
Contributor Author

dkocher commented Apr 19, 2024

@micbar Please find below a full request/response log

POST /ocs/v1.php/apps/files_sharing/api/v1/shares HTTP/1.1
OCS-APIRequest: true
Accept: application/xml
Content-Length: 42
Content-Type: application/json; charset=UTF-8
Host: ocis.ocis-keycloak.latest.owncloud.works
Connection: Keep-Alive
User-Agent: Cyberduck/8.8.3.41368 (Mac OS X/14.4.1) (aarch64)
Accept-Encoding: gzip,deflate
Authorization: Bearer ***

{"path":"d","shareType":3,"permissions":4}


HTTP/1.1 200 OK
Content-Length: 160
Content-Type: text/xml; charset=utf-8
Date: Fri, 19 Apr 2024 11:12:50 GMT
Ocs-Api-Version: 1
Vary: Origin
X-Request-Id: 3c9a7676557b/HgcReilixE-000556

<?xml version="1.0" encoding="UTF-8"?>
<ocs><meta><status>error</status><statuscode>400</statuscode><message>shareType must be an integer</message></meta></ocs>

@micbar
Copy link

micbar commented Apr 19, 2024

You are sending a json body. That is not working on ocs. With our new libregraph sharing api, everything will be better 😄

Valid OCS Request

curl 'https://ocis.ocis-wopi.released.owncloud.works/ocs/v1.php/apps/files_sharing/api/v1/shares' \
  -H 'accept: */*' \
  -H 'accept-language: en' \
  -H 'authorization: Bearer <access-token>' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -H 'ocs-apirequest: true' \
  --data-raw $'shareType=0&shareWith=moss&path=%2FNew+folder&permissions=17&role=viewer'

dkocher added a commit that referenced this issue Apr 19, 2024
@dkocher
Copy link
Contributor Author

dkocher commented Apr 19, 2024

With our new libregraph sharing api, everything will be better 😄

Hopefully rather sooner than later as part of #14166.

@dkocher
Copy link
Contributor Author

dkocher commented Apr 19, 2024

Will have to make sure there is no regression for #13478.

dkocher added a commit that referenced this issue Apr 19, 2024
dkocher added a commit that referenced this issue Apr 19, 2024
@dkocher
Copy link
Contributor Author

dkocher commented Apr 19, 2024

In 39a2172.

@dkocher dkocher closed this as completed Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants