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

Moving a file into a folder that is a number fails #39702

Closed
phil-davis opened this issue Jan 20, 2022 · 2 comments · Fixed by #39703
Closed

Moving a file into a folder that is a number fails #39702

phil-davis opened this issue Jan 20, 2022 · 2 comments · Fixed by #39703
Labels

Comments

@phil-davis
Copy link
Contributor

phil-davis commented Jan 20, 2022

Steps to reproduce

  1. Alice creates folders called "text" and "1"
  2. Alice creates file "text/file.txt"
    3.Alice moves "text/file.txt" to "1/file.txt"

Expected behaviour

It works - Alice should have "file.txt" in folder "1"

Actual behaviour

HTTP 500 response

owncloud log:

{"reqId":"PJFhRucPPskTsSHy8iSS","level":3,"time":"2022-01-20T13:09:55+00:00","remoteAddr":"192.168.1.64","user":"Alice","app":"PHP","method":"MOVE","url":"\/remote.php\/webdav\/text\/file.txt","message":"rename(\/home\/phil\/git\/owncloud\/core\/data\/Alice\/\/files_versions\/text\/file.txt.current.json,\/home\/phil\/git\/owncloud\/core\/data\/Alice\/\/files_versions\/1\/file.txt.current.json): No such file or directory at \/home\/phil\/git\/owncloud\/core\/apps\/files_versions\/lib\/MetaStorage.php#262"}
{"reqId":"PJFhRucPPskTsSHy8iSS","level":4,"time":"2022-01-20T13:09:55+00:00",
"remoteAddr":"192.168.1.64",
"user":"Alice",
"app":"webdav",
"method":"MOVE",
"url":"\/remote.php\/webdav\/text\/file.txt",
"message":"Exception: strpos() expects parameter 1 to be string, int given: 
{\"Exception\":\"TypeError\",\"Message\":\"strpos() expects parameter 1 to be string, int given\",
\"Code\":0,
\"Trace\":\"
#0 \\\/home\\\/phil\\\/git\\\/owncloud\\\/core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(229): strpos()\\n
#1 \\\/home\\\/phil\\\/git\\\/owncloud\\\/core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(167): Sabre\\\\DAV\\\\Tree->markDirty()\\n
#2 \\\/home\\\/phil\\\/git\\\/owncloud\\\/core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(612): Sabre\\\\DAV\\\\Tree->move()\\n
#3 \\\/home\\\/phil\\\/git\\\/owncloud\\\/core\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpMove()\\n
#4 \\\/home\\\/phil\\\/git\\\/owncloud\\\/core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(472): Sabre\\\\DAV\\\\Server->emit()\\n
#5 \\\/home\\\/phil\\\/git\\\/owncloud\\\/core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(253): Sabre\\\\DAV\\\\Server->invokeMethod()\\n
#6 \\\/home\\\/phil\\\/git\\\/owncloud\\\/core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(321): Sabre\\\\DAV\\\\Server->start()\\n
#7 \\\/home\\\/phil\\\/git\\\/owncloud\\\/core\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(67): Sabre\\\\DAV\\\\Server->exec()\\n
#8 \\\/home\\\/phil\\\/git\\\/owncloud\\\/core\\\/remote.php(165): require_once('\\\/home\\\/phil\\\/git\\\/...')\\n
#9 {main}\",\"File\":\"\\\/home\\\/phil\\\/git\\\/owncloud\\\/core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php\",\"Line\":229}"}

Server configuration

Current core master.

PR #39703 demonstrates the problem.

@phil-davis
Copy link
Contributor Author

Fixed by sabre-io/dav#1385

I locally made the small code change there to sabre/dav/lib/DAV/Tree.php and the failing test passes locally.

@jnweiger
Copy link
Contributor

jnweiger commented May 6, 2022

Confirmed fixed in 10.10.0 RC1

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

Successfully merging a pull request may close this issue.

2 participants