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

Drives endpoint returns invalid DAV endpoint URL if OCIS_URL ends with a slash #3706

Closed
felix-schwarz opened this issue May 5, 2022 · 0 comments · Fixed by #3916
Closed
Assignees
Labels

Comments

@felix-schwarz
Copy link

Describe the bug

When using the OCIS_URL environment variable and ending the URL with a slash, the drives endpoint returns a WebDAV URL that doesn't support PROPFINDs.

Steps to reproduce

Steps to reproduce the behavior:

  1. Set up an instance using this docker-compose file:
---
version: "3.7"

services:
  ocis:
    image: owncloud/ocis:latest
    ports:
      - 9200:9200
      - 9215:9215
    environment:
      OCIS_INSECURE: "true"
      OCIS_URL: "https://myserver:9200/"
      IDM_CREATE_DEMO_USERS: "true"
      IDM_ADMIN_PASSWORD: "admin"
    restart: "no"
    entrypoint:
      - /bin/sh
    # run ocis init to initialize a configuration file with random secrets
    # it will fail on subsequent runs, because the config file already exists
    # therefore we ignore the error and then start the ocis server
    command: ["-c", "ocis init || true; ocis server"]
  1. Request the drive list from /graph/v1.0/me/drives
  2. Send a PROPFIND request to the returned webDavUrl.

Expected behavior

The server returns the requested items in response to the PROPFIND.

Actual behavior

  1. The drives endpoint returns a URL with double slashes:
https://myserver:9200//dav/spaces/1284d238-aa92-42ce-bdc4-0b0000009157$4a0448ca-0347-49a6-ae59-b0d7b32f7bfe/
  1. Sending a PROPFIND to that URL returns a 405 METHOD NOT ALLOWED response:
# RESPONSE --------------------------------------------------------
Method:      PROPFIND
URL:         https://myserver:9200//dav/spaces/1284d238-aa92-42ce-bdc4-0b0000009157$4a0448ca-0347-49a6-ae59-b0d7b32f7bfe/
Request-ID:  4C8864E8-7C7A-4357-9DF8-3EB3B6541C52
Error:       -
Req Signals: authAvailable
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
405 METHOD NOT ALLOWED
X-Content-Type-Options: nosniff
Cache-Control: no-cache, no-store, max-age=0, must-revalidate, value
Content-Security-Policy: frame-ancestors 'none'
Last-Modified: Thu, 05 May 2022 15:05:11 GMT
Date: Thu, 05 May 2022 15:05:11 GMT
X-Frame-Options: SAMEORIGIN
Content-Length: 0
X-Web-Version: d0a00f8a8
Expires: Thu, 01 Jan 1970 00:00:00 GMT

The issue is resolved by using

      OCIS_URL: "https://myserver:9200"

(without trailing slash) in the docker compose file.

Setup

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

~ $ ocis version
Version: d0a00f8a8
Compiled: 2022-05-05 00:00:00 +0000 UTC

+-----------+-----------------+--------------------------------------------------------------------------+
|  Version  |     Address     |                                    Id                                    |
+-----------+-----------------+--------------------------------------------------------------------------+
| d0a00f8a8 | 127.0.0.1:9130  | com.owncloud.web.idp-97cd1ded-920a-4a0d-bc4a-80050294b123                |
| d0a00f8a8 | 127.0.0.1:9178  | com.owncloud.api.storage-publiclink-b789d4c5-f951-4791-89ab-d7940edafae5 |
| d0a00f8a8 | 127.0.0.1:9242  | com.owncloud.api.app-registry-da4384a1-a955-4d57-a665-ec496fa38abb       |
| d0a00f8a8 | 127.0.0.1:9157  | com.owncloud.api.storage-users-fe2aa83f-6741-48a5-a712-5889a87f0053      |
| d0a00f8a8 | 127.0.0.1:9154  | com.owncloud.api.storage-shares-998dc2b0-8f1e-4f1f-97ed-3d32859c3000     |
| d0a00f8a8 | 127.0.0.1:9144  | com.owncloud.api.users-75ac0d58-7cf1-4693-a747-339b3b456055              |
| d0a00f8a8 | 127.0.0.1:9120  | com.owncloud.graph.graph-97cd1ded-920a-4a0d-bc4a-80050294b123            |
| d0a00f8a8 | 127.0.0.1:9164  | com.owncloud.api.app-provider-ea40e6df-1a9b-4359-9a54-c8c65ddb28b5       |
| d0a00f8a8 | 127.0.0.1:9148  | com.owncloud.api.auth-bearer-bfbbcf24-617d-49c0-9e0b-6016a672b083        |
| d0a00f8a8 | 127.0.0.1:9135  | com.owncloud.web.graph-explorer-97cd1ded-920a-4a0d-bc4a-80050294b123     |
| d0a00f8a8 | 127.0.0.1:9142  | com.owncloud.api.gateway-5cb0d906-e8bf-4577-bb6c-d672c15898fb            |
| d0a00f8a8 | 127.0.0.1:9191  | com.owncloud.api.settings-97cd1ded-920a-4a0d-bc4a-80050294b123           |
| d0a00f8a8 | 127.0.0.1:9100  | com.owncloud.web.web-97cd1ded-920a-4a0d-bc4a-80050294b123                |
| d0a00f8a8 | 127.0.0.1:9110  | com.owncloud.web.ocs-97cd1ded-920a-4a0d-bc4a-80050294b123                |
| d0a00f8a8 | 172.26.0.2:9200 | com.owncloud.web.proxy-97cd1ded-920a-4a0d-bc4a-80050294b123              |
| d0a00f8a8 | 127.0.0.1:9220  | com.owncloud.api.search-97cd1ded-920a-4a0d-bc4a-80050294b123             |
| d0a00f8a8 | 127.0.0.1:9166  | com.owncloud.api.auth-machine-8b63d7df-549b-40de-858c-10ce8757bdf8       |
| d0a00f8a8 | 127.0.0.1:9460  | com.owncloud.api.store-97cd1ded-920a-4a0d-bc4a-80050294b123              |
| d0a00f8a8 | 127.0.0.1:9115  | com.owncloud.web.webdav-97cd1ded-920a-4a0d-bc4a-80050294b123             |
| d0a00f8a8 | 127.0.0.1:9215  | com.owncloud.api.storage-system-99cfc8ad-8955-46f7-83fb-0359f84f6198     |
| latest    | 127.0.0.1:45789 | ocdav-97cd1ded-920a-4a0d-bc4a-80050294b123                               |
| d0a00f8a8 | 127.0.0.1:9150  | com.owncloud.api.sharing-444dad9f-38b9-4c35-b94a-d7fb5cd844d3            |
| d0a00f8a8 | 127.0.0.1:9146  | com.owncloud.api.auth-basic-5a08367b-c855-477c-a9ee-88079e561958         |
| d0a00f8a8 | 127.0.0.1:9140  | com.owncloud.web.frontend-5e4d7d26-9342-43d3-8d43-92a09f4229fb           |
| d0a00f8a8 | 127.0.0.1:9190  | com.owncloud.web.settings-97cd1ded-920a-4a0d-bc4a-80050294b123           |
| d0a00f8a8 | 127.0.0.1:9160  | com.owncloud.api.groups-f92d8e90-8b49-4f3a-aa40-11f74f0db5d2             |
| d0a00f8a8 | 127.0.0.1:9185  | com.owncloud.api.thumbnails-97cd1ded-920a-4a0d-bc4a-80050294b123         |
| d0a00f8a8 | 127.0.0.1:9186  | com.owncloud.web.thumbnails-97cd1ded-920a-4a0d-bc4a-80050294b123         |
| d0a00f8a8 | 127.0.0.1:9216  | com.owncloud.web.storage-system-189d61fb-7e9e-47bc-a1fb-7e7eeeb46f0d     |
+-----------+-----------------+--------------------------------------------------------------------------+

@micbar micbar added this to Qualification in Infinite Scale Team Board via automation May 10, 2022
@micbar micbar added Priority:p3-medium Normal priority and removed p3-medium labels May 10, 2022
@micbar micbar moved this from Qualification to Bugs Prio 3 or less in Infinite Scale Team Board May 10, 2022
@C0rby C0rby self-assigned this Jun 2, 2022
@C0rby C0rby moved this from Bugs Prio 3 or less to In progress in Infinite Scale Team Board Jun 2, 2022
Infinite Scale Team Board automation moved this from In progress to Done Jun 3, 2022
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