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

[wopi] Check file info return 500 if file has been deleted #10097

Closed
Tracked by #9844
amrita-shrestha opened this issue Sep 18, 2024 · 2 comments
Closed
Tracked by #9844

[wopi] Check file info return 500 if file has been deleted #10097

amrita-shrestha opened this issue Sep 18, 2024 · 2 comments
Labels

Comments

@amrita-shrestha
Copy link
Contributor

Describe the bug

try to get file info using wopi, which returns 500 if a file has been deleted

Steps to reproduce

  1. get access token and URL using endpoint /app/open?app_name=$app&file_id=$fileId returns
"app_url":"https://host.docker.internal:9980/browser/d5ebff5/cool.html?WOPISrc=https%3A%2F%2Fhost.docker.internal%3A9300%2Fwopi%2Ffiles%2Ffccd2d62499f7173360",
"method":"POST",
"form_parameters":{"access_token":"eyJhbGciOiJIUzI1NiIjl0BboY4ktwyLYivcSK08",
"access_token_ttl":"1726739024000"
}
  1. delete file from the ocis server
  2. using WOPISrc and access_token from the above response send get request return 500 status code

Expected behavior

401 unauthorized or 404 code should be return

Actual behavior

500 status code returned

Setup

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

ownCloud	Infinite Scale
Edition	Community
Version	6.3.0+283948487
Web client version	10.2.0

Additional context

Add any other context about the problem here.

@jvillafanez
Copy link
Member

For reference, log entry below:

{"level":"error","service":"collaboration","request-id":"","proto":"HTTP/1.1","method":"GET","path":"/wopi/files/3087b86e78853869ae2ec56a7cc646cbf8b8d9e058ed123dcf19ced87e57cd86","WopiSessionId":"","WopiOverride":"","WopiProof":"","WopiProofOld":"","WopiStamp":"","FileReference":"resource_id:{storage_id:\"7edebe16-6335-47a0-bf76-3885202dffcf\"  opaque_id:\"22f17a98-4255-4c1b-856f-f64b5a36917e\"  space_id:\"542053c5-dafc-45c8-92e2-6bb01a8bec29\"}  path:\".\"","ViewMode":"VIEW_MODE_READ_WRITE","Requester":"idp:\"https://ocis.jp.solidgear.prv\"  opaque_id:\"542053c5-dafc-45c8-92e2-6bb01a8bec29\"  type:USER_TYPE_PRIMARY","StatusCode":"CODE_NOT_FOUND","StatusMsg":"stat: error: not found: ","time":"2024-09-18T16:04:50Z","line":"/home/juan/src/ocis/ocis/services/collaboration/pkg/connector/fileconnector.go:1060","message":"CheckFileInfo: stat failed with unexpected status"}

We can detect that case and return an appropriate 404 error

@amrita-shrestha
Copy link
Contributor Author

fix PR has been merged and the test has been covered so closing this issue

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

No branches or pull requests

2 participants