Bug 2230 - Undocumented sftp put -r quirk: Couldn't canonicalize: No such file or directory
Summary: Undocumented sftp put -r quirk: Couldn't canonicalize: No such file or directory
Status: CLOSED DUPLICATE of bug 2150
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp (show other bugs)
Version: 6.5p1
Hardware: amd64 Linux
: P5 minor
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-17 16:55 AEST by Parke
Modified: 2015-08-11 23:05 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Parke 2014-04-17 16:55:34 AEST
As of OpenSSH 6.5 on Ubuntu 14.04 (package version 1:6.5p1-6), there
appears to be an undocumented requirement for the sftp "put -r"
command.  In order to "put -r foo", a remote directory named "foo"
must already exist.

If a remote directory named foo does not exist, the following
(confusing) error message is displayed:

sftp> put -r foo
Uploading foo/ to /home/user/test/foo
Couldn't canonicalize: No such file or directory
Unable to canonicalize path "/home/parke/test/foo"

I recommend that this requirement be documented in the sftp manpage.
I can draft language, if needed.

The error message could also be more helpful.  For example: "Required
remote directory "foo" does not exist."

There is related discussion on stack exchange:
http://unix.stackexchange.com/questions/7004/uploading-directories-with-sftp
http://stackoverflow.com/questions/17477226/what-cause-the-error-couldnt-canonicalise-no-such-file-or-directory-in-sftp

----

Damien Miller on the openssh-unix-dev@mindrot.org mailing list has an alternative suggestion for fixing this problem:

IMO the directory should be created if it doesn't exist, just like
"cp -r" does.
Comment 1 Parke 2014-04-18 07:31:30 AEST
Duplicate of https://bugzilla.mindrot.org/show_bug.cgi?id=2150
Comment 2 Damien Miller 2014-07-03 13:27:54 AEST

*** This bug has been marked as a duplicate of bug 2150 ***
Comment 3 Damien Miller 2015-08-11 23:05:56 AEST
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1