Open gonejack opened 6 years ago
Hmm @gonejack , thanks for the report. Can you repro this with a smaller file (so it's faster to fail!) and include the output with the --verbose
flag? That will help debug. If the issue is indeed of permissions, you're right, we should be able to fail fast.
Tried with an empty txt, here is the output:
[root@host ~]# dbxcli put --verbose ./test.txt /
2018/03/18 21:29:32 sdk.go:93: arg: &{ 0x1a9a73b0 false 2018-03-19 01:29:33 +0000 UTC false []}
2018/03/18 21:29:32 sdk.go:93: req: &{POST https://content.dropboxapi.com/2/files/upload HTTP/1.1 1 1 map[Content-Type:[application/octet-stream] Dropbox-Api-Arg:[{"path":"","mode":{".tag":"overwrite"},"autorename":false,"client_modified":"2018-03-19T01:29:33Z","mute":false}]] {0x1a9506c0} <nil> 0 [] false content.dropboxapi.com map[] map[] <nil> map[] <nil> <nil> <nil> <nil>}
2018/03/18 21:29:32 sdk.go:93: resp: &{400 Bad Request 400 HTTP/1.1 1 1 map[X-Dropbox-Request-Id:[e5e3b0934ee57ee07b4d87ffecdd08b9] X-Robots-Tag:[noindex, nofollow, noimageindex] Server:[nginx] Date:[Mon, 19 Mar 2018 01:29:46 GMT] Content-Type:[text/plain; charset=utf-8] Connection:[keep-alive] Content-Security-Policy:[sandbox allow-forms allow-scripts]] 0x1ac280d0 -1 [chunked] false false map[] 0x1a982980 0x1a9743c0}
2018/03/18 21:29:32 sdk.go:93: body: [69 114 114 111 114 32 105 110 32 99 97 108 108 32 116 111 32 65 80 73 32 102 117 110 99 116 105 111 110 32 34 102 105 108 101 115 47 117 112 108 111 97 100 34 58 32 72 84 84 80 32 104 101 97 100 101 114 32 34 68 114 111 112 98 111 120 45 65 80 73 45 65 114 103 34 58 32 112 97 116 104 58 32 84 104 101 32 114 111 111 116 32 102 111 108 100 101 114 32 105 115 32 117 110 115 117 112 112 111 114 116 101 100 46]
Error: Error in call to API function "files/upload": HTTP header "Dropbox-API-Arg": path: The root folder is unsupported.
I don't believe this is a permission issue. The root folder is special in that you cannot retrieve its metadata. So, it is not possible to upload to the root folder since upload returns the metadata for the path of the upload.
We can update the help description for the upload command to reflect this if we want to avoid special casing the root folder in implementation.
Upload a large video file from Linux server to dropbox account using dbxcli by this command:
After long long time uploading waiting, the command end with error: no permission with the root directory, which punch me on the face: it's really a rookie mistake of transfer tool, if it has no permission, why not just reject the upload directly when upload start.