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

Early request in previewing a file gives 500 server error for old and new webdav #7502

Closed
SagarGi opened this issue Oct 16, 2023 · 2 comments · Fixed by #7507
Closed

Early request in previewing a file gives 500 server error for old and new webdav #7502

SagarGi opened this issue Oct 16, 2023 · 2 comments · Fixed by #7507
Assignees
Labels

Comments

@SagarGi
Copy link
Member

SagarGi commented Oct 16, 2023

Description

When previewing (downloading) the file with the old and new webdav after a file is uploaded. Some times the the uploaded files is not ready yet to get it. At that time the server should respond with a status code of 425 not 500.

Steps to reproduce as an admin user

  1. Start ocis with env POSTPROCESSING_DELAY so as to reproduce this issue
OCIS_INSECURE=true \
PROXY_ENABLE_BASIC_AUTH=true \
POSTPROCESSING_DELAY=20s \
ocis/bin/ocis server
  1. upload file named textfile.txt
curl -X PUT -vk -u admin:admin -d "hello" https://localhost:9200/dav/files/admin/textfile.txt
  1. Using old or new webdav make a request to preview the uploaded file
curl -k -X GET 'https://localhost:9200/remote.php/dav/files/admin/textfile.txt?x=32&y=32&forceIcon=0&preview=1' -uadmin:admin -v

Expeted Behaviour

The expected behaviour should have been the status code 425.

Actual Behaviour

The server is giving 500 status code as Internal Server Error

> GET /remote.php/dav/files/admin/textfile.txt?x=32&y=32&forceIcon=0&preview=1 HTTP/1.1
> Host: localhost:9200
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.81.0
> Accept: */*
> 
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Content-Length: 306
< Content-Type: application/xml; charset=utf-8
< Date: Mon, 16 Oct 2023 09:20:05 GMT
< X-Request-Id: desktop/UM1bosUj1W-000461
< 
<?xml version="1.0" encoding="UTF-8"?>
* Connection #0 to host localhost left intact
<d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns"><s:exception></s:exception><s:message>{&#34;id&#34;:&#34;com.owncloud.api.thumbnails&#34;,&#34;code&#34;:425,&#34;detail&#34;:&#34;File Processing&#34;,&#34;status&#34;:&#34;Too Early&#34;}</s:message></d:error>

Note
With spaces webdav the server gives 425 status when the for early request to preview the downloaded content.

Environment

Ocis (build with commit de4529d) locally

@SagarGi
Copy link
Member Author

SagarGi commented Oct 16, 2023

Server log as:

{"level":"error","service":"webdav","error":"{\"id\":\"com.owncloud.api.thumbnails\",\"code\":425,\"detail\":\"FileProcessing\",\"status\":\"Too Early\"}","time":"2023-10-16T12:49:39+05:45","message":"could not get thumbnail"}

@micbar
Copy link
Contributor

micbar commented Oct 16, 2023

I agree with the qualification.

The API should return 425

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