Subject: bug#22478: 25.1.50; tramp error: Wrong method specification for ‘scp’

From: Michael Albinus <[email-masked]>
Date: Mon, 15 Aug 2016 12:26:04 +0200

Sam Steingold <[email-masked]> writes:

> Hi Michael,

Hi Sam,

We see the following error in the traces:

> 16:59:43.011954 tramp-send-command (6) # tramp_perl_file_attributes /home/sds/.newsrc integer 2>/dev/null; echo tramp_exit_status $?
> 16:59:43.039832 tramp-wait-for-regexp (6) # 
> tramp_exit_status 2
> ///8a1abdf5d064a13495e6037e3daf8b9a#$

Unfortunately, the call of the shell function tramp_perl_file_attributes
redirects stderr, so we don't know exactly what happened.

Checking the relevant code, I've found a potential problem in Tramp's
cache handling. Not sure whether it is related to your problem, but I've
committed the following patch to the master branch:

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp/lisp/tramp-cache.el.~996962bcc3f8778ae9bae93e4ac926fde1d34ea9~	2016-08-15 12:17:00.813388070 +0200
--- /home/albinus/src/tramp/lisp/tramp-cache.el	2016-08-15 11:01:56.021498208 +0200
***************
*** 237,245 ****
      (aset key 3 nil)
      (aset key 4 nil))
    (let* ((hash (tramp-get-hash-table key))
! 	 (value (if (hash-table-p hash)
! 		    (gethash property hash default)
! 		  default)))
      (tramp-message key 7 "%s %s" property value)
      value))
  
--- 237,250 ----
      (aset key 3 nil)
      (aset key 4 nil))
    (let* ((hash (tramp-get-hash-table key))
! 	 (value
! 	  ;; If the key is an auxiliary process object, check whether
! 	  ;; the process is still alive.
! 	  (if (and (processp key) (not (memq (process-status key) '(run open))))
! 	      default
! 	    (if (hash-table-p hash)
! 		(gethash property hash default)
! 	      default))))
      (tramp-message key 7 "%s %s" property value)
      value))
  
--8<---------------cut here---------------end--------------->8---

Could you, pls, check whether this cures the problem already? If not, we
need more information why the shell function fails. Pls apply the
following patch:

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp/lisp/tramp-sh.el.~b3f62af997d071306fe3ab571f54e0537557f373~	2016-08-15 12:21:09.129601587 +0200
--- /home/albinus/src/tramp/lisp/tramp-sh.el	2016-08-15 12:20:22.127720434 +0200
***************
*** 1400,1405 ****
--- 1400,1409 ----
    (tramp-message vec 5 "file attributes with perl: %s" localname)
    (tramp-maybe-send-script
     vec tramp-perl-file-attributes "tramp_perl_file_attributes")
+   (tramp-send-command
+    vec
+    (format "tramp_perl_file_attributes %s %s"
+ 	   (tramp-shell-quote-argument localname) id-format))
    (tramp-send-command-and-read
     vec
     (format "tramp_perl_file_attributes %s %s"
--8<---------------cut here---------------end--------------->8---

Afterwards, rerun the test until it fails, with tramp-verbose set to
10. Maybe we will know better then what happens.

Best regards, Michael.