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

WebDAV MKCOL returns wrong Status Code 404 if multiple intermediate collections are missing #6136

Closed
kaivol opened this issue Apr 25, 2023 · 4 comments
Assignees
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug

Comments

@kaivol
Copy link

kaivol commented Apr 25, 2023

Describe the bug

When trying to create a collection via WebDAV (MKCOL) where more than one intermediate collections are missing, oCIS returns 404 (Not Found) instead of 409 (Conflict).

According to RFC 4918, Status Code 409 (Conflict) should be used to indicate that

A collection cannot be made at the Request-URI until one or more intermediate collections have been created 1

Steps to reproduce

Steps to reproduce the behavior:

  1. (Precondition) No folder foo exists in the users personal folder
  2. MKCOL /remote.php/webdav/foo/bar returns 409 Conflict
  3. MKCOL /remote.php/webdav/foo/bar/baz returns 404 Not Found
  4. MKCOL /remote.php/webdav/foo returns 201 Created
  5. now MKCOL /remote.php/webdav/foo/bar/baz returns 409 Conflict

Expected behavior

In step 2, the expected Status Code is 409 Conflict.

Actual behavior

The actual Status Code is 404 Not Found.

Setup

oCIS Version: 3.0.0-rc.1 in Podman

OCIS_CONFIG_DIR=/etc/ocis
OCIS_BASE_DATA_PATH=/data
OCIS_LOG_LEVEL=warn
OCIS_LOG_COLOR=true
OCIS_URL=owncloud.***
PROXY_HTTP_ADDR=0.0.0.0:9200
PROXY_TLS=false
OCIS_INSECURE=false
OCIS_OIDC_ISSUER=auth.***
WEB_OIDC_CLIENT_ID=ocis-web
PROXY_OIDC_REWRITE_WELLKNOWN=true
PROXY_ROLE_ASSIGNMENT_DRIVER=oidc
PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM=ocis_role
PROXY_AUTOPROVISION_ACCOUNTS=true
OCIS_ADMIN_USER_ID=
GRAPH_ASSIGN_DEFAULT_USER_ROLE=false

Reverse proxy: Caddy

*.***, *** {
    ..
    @owncloud host owncloud.***
    handle @owncloud {
        reverse_proxy localhost:10020
    }
    ..
}

Footnotes

  1. https://www.rfc-editor.org/rfc/rfc4918#section-9.3.1

@kaivol kaivol changed the title WebDAV MKCOL returns wrong Status Code 404 if multiple intermediate collections are missing WebDAV MKCOL returns wrong Status Code 404 if multiple intermediate collections are missing Apr 25, 2023
@micbar
Copy link
Contributor

micbar commented Apr 27, 2023

@kaivol Can you point out which impact that has for you?

@kaivol
Copy link
Author

kaivol commented Apr 29, 2023

I encountered this problem when I tried to migrate existing data to oCIS using rclone, as described here.
rclone fails when it tries to copy files where multiple parent folders would have to be created prior to copying the file.

@micbar
Copy link
Contributor

micbar commented Apr 29, 2023

I encountered this problem when I tried to migrate existing data to oCIS using rclone, as described here. rclone fails when it tries to copy files where multiple parent folders would have to be created prior to copying the file.

Ok. Thanks for that analysis. We should fix that.

@micbar micbar added the Priority:p2-high Escalation, on top of current planning, release blocker label Apr 29, 2023
@micbar micbar moved this from Qualification to Prio 2 in Infinite Scale Team Board Apr 29, 2023
@micbar micbar self-assigned this Apr 29, 2023
@micbar
Copy link
Contributor

micbar commented May 4, 2023

done. Fixed in rc.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:p2-high Escalation, on top of current planning, release blocker Type:Bug
Projects
Archived in project
Development

No branches or pull requests

2 participants