Post by r***@comcast.netGreetings
I am looking for a good if not complete list of possible error
messages that one might get within sftp. Does such a list exist ?
If you're using OpenSSH you can grep the source, something like:
$ sed 's/^\t*//g' sftp.c sftp-client.c |egrep '^fatal\(|^error\(|^logit\('
fatal("Couldn't fork: %s", strerror(errno));
fatal("Couldn't wait for child: %s", strerror(errno));
error("Shell exited abnormally");
error("Shell exited with status %d", WEXITSTATUS(status));
error("Invalid path");
error("%s: Invalid flag -%c", cmd, ch);
error("ls: Invalid flag -%c", ch);
fatal("stat %s: %s", path, strerror(errno));
error("File \"%s\" not found.", abs_src);
error("Multiple files match, but \"%s\" is not a directory",
error("File \"%s\" not found.", src);
error("Multiple files match, but \"%s\" is not a directory",
error("skipping non-regular file %s",
fatal("Unknown ls sort type");
error("Can't ls: \"%s\" not found", path);
error("string too long");
error("Unterminated quoted argument");
error("Invalid command.");
error("You must specify at least one path after a "
error("You must specify two paths after a %s "
error("You must specify a path after a %s command.",
error("You must supply a numeric argument "
error("You must specify a path after a %s command.",
fatal("Command not implemented");
error("Can't change directory: Can't check target");
error("Can't change directory: \"%s\" is not "
error("Couldn't change local directory to "
error("Couldn't create local directory "
error("Can't get current ownership of "
error("Couldn't get local cwd: %s", strerror(errno));
fatal("%d is not implemented", cmdnum);
fatal("Couldn't initialise editline");
fatal("Couldn't initialise editline history");
fatal("Couldn't initialise connection to server");
fatal("Need cwd");
fatal("pipe: %s", strerror(errno));
fatal("socketpair: %s", strerror(errno));
fatal("fork: %s", strerror(errno));
fatal("Batch file already specified.");
fatal("%s (%s).", strerror(errno), optarg);
fatal("Invalid buffer size \"%s\"", optarg);
fatal("Invalid number of requests \"%s\"",
fatal("Couldn't wait for ssh process: %s",
fatal("Outbound message too long %u", buffer_len(m));
fatal("Couldn't send packet: %s", strerror(errno));
fatal("Connection closed");
fatal("Couldn't read packet: %s", strerror(errno));
fatal("Received message too long %u", msg_len);
fatal("Connection closed");
fatal("Read packet: %s", strerror(errno));
fatal("ID mismatch (%u != %u)", id, expected_id);
fatal("Expected SSH2_FXP_STATUS(%u) packet, got %u",
fatal("ID mismatch (%u != %u)", id, expected_id);
error("Couldn't get handle: %s", fx2txt(status));
fatal("Expected SSH2_FXP_HANDLE(%u) packet, got %u",
fatal("ID mismatch (%u != %u)", id, expected_id);
error("Couldn't stat remote file: %s", fx2txt(status));
fatal("Expected SSH2_FXP_ATTRS(%u) packet, got %u",
error("Invalid packet back from SSH2_FXP_INIT (type %u)",
error("Couldn't close file: %s", fx2txt(status));
fatal("ID mismatch (%u != %u)", id, expected_id);
error("Couldn't read directory: %s",
fatal("Expected SSH2_FXP_NAME(%u) packet, got %u",
error("Couldn't delete file: %s", fx2txt(status));
error("Couldn't create directory: %s", fx2txt(status));
error("Couldn't remove directory: %s", fx2txt(status));
logit("Server version does not support lstat operation");
error("Couldn't setstat on \"%s\": %s", path,
error("Couldn't fsetstat: %s", fx2txt(status));
fatal("ID mismatch (%u != %u)", id, expected_id);
error("Couldn't canonicalise: %s", fx2txt(status));
fatal("Expected SSH2_FXP_NAME(%u) packet, got %u",
fatal("Got multiple names (%d) from SSH_FXP_REALPATH", count);
error("Couldn't rename file \"%s\" to \"%s\": %s", oldpath,
error("This server does not support the symlink operation");
error("Couldn't symlink file \"%s\" to \"%s\": %s", oldpath,
fatal("ID mismatch (%u != %u)", id, expected_id);
error("Couldn't readlink: %s", fx2txt(status));
fatal("Expected SSH2_FXP_NAME(%u) packet, got %u",
fatal("Got multiple names (%d) from SSH_FXP_READLINK", count);
error("Cannot download non-regular file: %s", remote_path);
error("Couldn't open local file \"%s\" for writing: %s",
fatal("Unexpected reply %u", id);
fatal("Received more data than asked for "
fatal("Expected SSH2_FXP_DATA(%u) packet, got %u",
fatal("Transfer complete, but requests still in queue");
error("Couldn't read from remote file \"%s\" : %s",
error("Couldn't write to \"%s\": %s", local_path,
error("Couldn't set mode on \"%s\": %s", local_path,
error("Can't set times on \"%s\": %s",
error("Couldn't open local file \"%s\" for reading: %s",
error("Couldn't fstat local file \"%s\": %s",
error("%s is not a regular file", local_path);
fatal("Couldn't read from \"%s\": %s", local_path,
fatal("Unexpected ACK %u", id);
fatal("Expected SSH2_FXP_STATUS(%d) packet, "
fatal("Can't find request for ID %u", r_id);
error("Couldn't write to remote file \"%s\": %s",
fatal("%s: offset < 0", __func__);
error("Couldn't close local file \"%s\": %s", local_path,
--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.