You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A reasonable error message is displayed - e.g. Could not rename "aaaa.txt"
The original aaaa.txt file is listed in the UI.
Actual behaviour
Error displayed:
Could not rename "aaaa.txt", it does not exist any more
and the file is gone from the display in the UI.
Note: refreshing the page brings back the file aaaa.txt to the UI list. So the original file is still there on server storage.
Server configuration
Operating system:
Ubuntu 16.04 Web server:
PHP dev Database:
MySQL PHP version:
7.0 ownCloud version: (see ownCloud admin page)
10.0.2+ current master as of right now 20/07/2017
If you try to rename to .htaccess then it returns 404:
NetworkError: 404 Not Found - http://localhost:8080/remote.php/dav/files/admin/aaaa.txt
and that causes the JS in the UI to think that that aaaa.txt has gone away, so it displays that error message and removes it from the list of displayed files.
I guess it should return the same 409 so that the UI code will react in the same way.
renaming a file to something containing a back slash \ does return
HTTP/1.1 400 Bad Request
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:o="http://owncloud.org/ns">
<s:exception>OCA\DAV\Connector\Sabre\Exception\InvalidPath</s:exception>
<s:message>File name contains at least one invalid character</s:message>
<o:retry xmlns:o="o:">false</o:retry>
<o:reason xmlns:o="o:">File name contains at least one invalid character</o:reason>
</d:error>
what I guess is the correct error result.
using a / in the file name when renaming it, tries to move the file into an other folder. It works if the folder exists. If the folder does not exist a 409 error is returned. Even ../ works if the file is located in a sub-folder
We got lucky. I expect that there are plenty of other (hopefully little) things, specially where the JS in the UI might do UI stuff differently if the new dav endpoint responds a bit differently (different status code, message...) than the old end point did.
In theory, the integration tests should find all issues with the API itself. UI tests should just find local (client/browser) issues in interacting with the API>
Activity
[-]Renaming to forbidden file name returns [/-][+]Renaming to .htaccess problems in UI[/+]phil-davis commentedon Jul 20, 2017
This causes test failures in the Travis-CI Saucelabs UI tests, where they try to do a rename to .htaccess.
So all Travis-CI runs against current master are failing.
Started when #25494 was merged.
The CI for that PR passed, because it happened 10 months ago:
https://travis-ci.org/owncloud/core/builds/165233987
At that time, these UI tests did not exist. Now that there are UI tests, they have the chance to fail (like this)
phil-davis commentedon Jul 20, 2017
If you try to rename a file to some string that is not a valid file name, then it returns 409:
If you try to rename to .htaccess then it returns 404:
and that causes the JS in the UI to think that that aaaa.txt has gone away, so it displays that error message and removes it from the list of displayed files.
I guess it should return the same 409 so that the UI code will react in the same way.
phil-davis commentedon Jul 20, 2017
Options for resolving this quickly so that Travis-CI in master will pass:
Choose one.
individual-it commentedon Jul 20, 2017
renaming a file to something containing a back slash
\does returnwhat I guess is the correct error result.
using a
/in the file name when renaming it, tries to move the file into an other folder. It works if the folder exists. If the folder does not exist a409error is returned. Even../works if the file is located in a sub-folderindividual-it commentedon Jul 20, 2017
when fixing this need to remember to take off
@skip @issue-28441tags in:PVince81 commentedon Jul 20, 2017
let's skip the issue then.
So apparently thanks to your tests this API inconsistency could be discovered. Cool
phil-davis commentedon Jul 20, 2017
We got lucky. I expect that there are plenty of other (hopefully little) things, specially where the JS in the UI might do UI stuff differently if the new dav endpoint responds a bit differently (different status code, message...) than the old end point did.
In theory, the integration tests should find all issues with the API itself. UI tests should just find local (client/browser) issues in interacting with the API>
PVince81 commentedon Aug 3, 2017
moving to "planned" for later
PVince81 commentedon Aug 18, 2017
Old endpoint:
New endpoint:
It's a backend issue on the new endpoint, it should return 403 instead.
PVince81 commentedon Aug 18, 2017
Apparently these tests fail on master now, or they did before and I didn't notice.
Anyway, here's the fix: #28735
lock commentedon Aug 1, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.