Re: tramp (2.7.0-pre nil/nil); Can't connect to server anymore

Michael Albinus <[email protected]>
Newsgroups gmane.emacs.tramp
Message-ID <[email protected]>
"Kirill A. Korinsky" <[email protected]> writes:

> Greetings,

Hi Kirill,

> When I run emacs your way I have:
>
> In *Messages*
>> For information about GNU Emacs and the GNU system, type C-h C-a.
>> Tramp: Opening connection nil for playground.island.local using ssh...failed
>> signal: Wrong type argument: "listp /bin/sh:"
>
> and I've attached tramp.log

Thanks a lot, this has helped. In the debug buffer we see what happens:

--8<---------------cut here---------------start------------->8---
22:48:20.976768 tramp-send-command (6) # tramp_bundle_read_file_names <<'36584af1a5124300cf63739980e7d186'
/usr/bin
/bin
/usr/sbin
/sbin
/usr/X11R6/bin
/usr/local/bin
/usr/local/sbin
/local/bin
/local/freeware/bin
/local/gnu/bin
/usr/freeware/bin
/usr/pkg/bin
/usr/contrib/bin
/opt/bin
/opt/sbin
/opt/local/bin
36584af1a5124300cf63739980e7d186
22:48:21.035464 tramp-wait-for-regexp (6) #
/bin/sh: can't create temporary file /tmp/shZPInbtKR: Permission denied
///8056ae9d33677d9550fbd457130ab698#$
22:48:21.049964 tramp-bundle-read-file-names (10) #
  backtrace()
  tramp-signal-hook-function(wrong-type-argument (listp /bin/sh:))
  tramp-bundle-read-file-names((tramp-file-name "ssh" nil nil "playground.island.local" nil "" nil) ("/usr/bin" "/bin" "/usr/sbin" "/sbin" "/usr/X11R6/bin" "/usr/local/bin" "/usr/local/sbin" "/local/bin" "/local/freeware/bin" "/local/gnu/bin" "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin" "/opt/bin" "/opt/sbin" "/opt/local/bin"))
  ...
--8<---------------cut here---------------end--------------->8---

The error "/bin/sh: can't create temporary file /tmp/shZPInbtKR:
Permission denied" isn't propagated properly by Tramp. Could you,
please, try the appended patch? There shall be a better error message.

> wbr, Kirill

Best regards, Michael.
(unnamed) (text/x-patch, 1.3 KB)
diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
index 6489f473..8ec9467a 100644
--- a/lisp/tramp-sh.el
+++ b/lisp/tramp-sh.el
@@ -3652,20 +3652,20 @@ filled are described in `tramp-bundle-read-file-names'."

     (dolist
 	(elt
-	 (ignore-errors
+	 (with-current-buffer (tramp-get-connection-buffer vec)
 	   ;; We cannot use `tramp-send-command-and-read', because
 	   ;; this does not cooperate well with heredoc documents.
-	   (tramp-send-command
-	    vec
-	    (format
-	     "tramp_bundle_read_file_names <<'%s'\n%s\n%s\n"
-	     tramp-end-of-heredoc
-	     (mapconcat #'tramp-shell-quote-argument files "\n")
-	     tramp-end-of-heredoc))
-	   (with-current-buffer (tramp-get-connection-buffer vec)
-	     ;; Read the expression.
-	     (goto-char (point-min))
-	     (read (current-buffer)))))
+	   (unless (tramp-send-command-and-check
+		    vec
+		    (format
+		     "tramp_bundle_read_file_names <<'%s'\n%s\n%s\n"
+		     tramp-end-of-heredoc
+		     (mapconcat #'tramp-shell-quote-argument files "\n")
+		     tramp-end-of-heredoc))
+	     (tramp-error vec 'file-error "%s" (tramp-get-buffer-string)))
+	   ;; Read the expression.
+	   (goto-char (point-min))
+	   (read (current-buffer))))

       (tramp-set-file-property vec (car elt) "file-exists-p" (nth 1 elt))
       (tramp-set-file-property vec (car elt) "file-readable-p" (nth 2 elt))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.