Subject: bug#57572: 29.0.50; Tramp error with tramp-file-name-unify

From: Thierry Volpiatto <[email-masked]>
Date: Sat, 10 Sep 2022 14:53:36 +0000

Hello Michael and thanks for your answer.

Michael Albinus <[email-masked]> writes:

> Thierry Volpiatto <[email-masked]> writes:
>
>> Hello,
>
> Hi Thierry,
>
> (sorry for the delayed reply, but I was too busy with changing Tramp to
> the rx machinery)

No problems.

> So I've added `expand-file-name' to even more places in Tramp in the
> hope, that it fits now for all cases. Pushed to master, could you please
> check?

I am using for now the emacs-28 version of tramp-file-name-unify to
prevent this error (it is inlined), to reproduce the bug with
helm-find-files you have to use:

(setq helm-ff--file-accessible-directory-p-fn
#'file-accessible-directory-p)

And I still have the error, here the backtrace, the tramp log at the end
of this message:

Debugger entered--Lisp error: (file-error "File `' must be absolute, please report a bug!")
  signal(file-error ("File `' must be absolute, please report a bug!"))
  tramp-error((tramp-file-name "sudo" "root" nil "IPad-S340" nil "" nil) file-error "File `%s' must be absolute, please report a bug!" "")
  tramp-file-name-unify((tramp-file-name "sudo" "root" nil "IPad-S340" nil "" nil) "")
  tramp-get-file-property((tramp-file-name "sudo" "root" nil "IPad-S340" nil "" nil) "" "file-readable-p" undef)
  tramp-sh-handle-file-readable-p("/sudo:root@IPad-S340:")
  apply(tramp-sh-handle-file-readable-p "/sudo:root@IPad-S340:")
  tramp-sh-file-name-handler(file-readable-p "/sudo:root@IPad-S340:")
  apply(tramp-sh-file-name-handler file-readable-p "/sudo:root@IPad-S340:")
  tramp-file-name-handler(file-readable-p "/sudo:root@IPad-S340:")
  file-readable-p("/sudo:root@IPad-S340:")
  tramp-handle-file-accessible-directory-p("/sudo:root@IPad-S340:")
  apply(tramp-handle-file-accessible-directory-p "/sudo:root@IPad-S340:")
  tramp-sh-file-name-handler(file-accessible-directory-p "/sudo:root@IPad-S340:")
  apply(tramp-sh-file-name-handler file-accessible-directory-p "/sudo:root@IPad-S340:")
  tramp-file-name-handler(file-accessible-directory-p "/sudo:root@IPad-S340:")
  file-accessible-directory-p(#("/sudo:root@IPad-S340:" 6 10 (tramp-default t) 11 20 (tramp-default t)))
  helm-find-files-get-candidates()
  apply(helm-find-files-get-candidates nil)
  helm-update()
  helm-check-new-input("/sudo::")
  helm-check-minibuffer-input()
  #f(compiled-function () #<bytecode 0x13c64df807298d0c>)()
  apply(#f(compiled-function () #<bytecode 0x13c64df807298d0c>) nil)
  timer-event-handler([t 0 0 10000 repeat #f(compiled-function () #<bytecode 0x13c64df807298d0c>) nil idle 0 nil])
  helm-read-from-minibuffer("Find files or url: " "/home/thierry/.emacs.d/emacs-config/" "^[[:multibyte:] ]*init\\.el$" nil nil nil nil)
  helm-internal(helm-source-find-files "/home/thierry/.emacs.d/emacs-config/" "Find files or url: " nil "^[[:multibyte:] ]*init\\.el$" "*helm find files*" nil nil nil)
  apply(helm-internal (helm-source-find-files "/home/thierry/.emacs.d/emacs-config/" "Find files or url: " nil "^[[:multibyte:] ]*init\\.el$" "*helm find files*" nil nil nil))
  helm(helm-source-find-files "/home/thierry/.emacs.d/emacs-config/" "Find files or url: " nil "^[[:multibyte:] ]*init\\.el$" "*helm find files*" nil nil nil)
  apply(helm (helm-source-find-files "/home/thierry/.emacs.d/emacs-config/" "Find files or url: " nil "^[[:multibyte:] ]*init\\.el$" "*helm find files*" nil nil nil))
  helm(:sources helm-source-find-files :input "/home/thierry/.emacs.d/emacs-config/" :case-fold-search smart :preselect "^[[:multibyte:] ]*init\\.el$" :ff-transformer-show-only-basename t :default nil :prompt "Find files or url: " :buffer "*helm find files*")
  helm-find-files-1("/home/thierry/.emacs.d/emacs-config/" "^[[:multibyte:] ]*init\\.el$")
  helm-find-files(nil)
  funcall-interactively(helm-find-files nil)
  call-interactively(helm-find-files nil nil)
  command-execute(helm-find-files)

> And we're here in Emacs development, master branch, in order to detect
> such regressions early. That's why the sanity message was added to
> `tramp-file-name-unify'.

Ok I understand.

Here the tramp backtrace as well if that helps.

;; Emacs: 29.0.50 Tramp: 2.6.0-pre -*- mode: outline; coding: utf-8; -*-
;; Location: /usr/local/share/emacs/29.0.50/lisp/net/tramp.elc Git: master/4cf9c92e27d20da9453f9abe89d84bee5d776329
16:52:31.091698 tramp-get-file-property (10) # 
  backtrace()
  tramp-error((tramp-file-name "sudo" "root" nil "IPad-S340" nil "" nil) file-error "File `%s' must be absolute, please report a bug!" "")
  tramp-file-name-unify((tramp-file-name "sudo" "root" nil "IPad-S340" nil "" nil) "")
  tramp-get-file-property((tramp-file-name "sudo" "root" nil "IPad-S340" nil "" nil) "" "file-readable-p" undef)
  tramp-sh-handle-file-readable-p("/sudo:root@IPad-S340:")
  apply(tramp-sh-handle-file-readable-p "/sudo:root@IPad-S340:")
  tramp-sh-file-name-handler(file-readable-p "/sudo:root@IPad-S340:")
  apply(tramp-sh-file-name-handler file-readable-p "/sudo:root@IPad-S340:")
  tramp-file-name-handler(file-readable-p "/sudo:root@IPad-S340:")
  file-readable-p("/sudo:root@IPad-S340:")
  tramp-handle-file-accessible-directory-p("/sudo:root@IPad-S340:")
  apply(tramp-handle-file-accessible-directory-p "/sudo:root@IPad-S340:")
  tramp-sh-file-name-handler(file-accessible-directory-p "/sudo:root@IPad-S340:")
  apply(tramp-sh-file-name-handler file-accessible-directory-p "/sudo:root@IPad-S340:")
  tramp-file-name-handler(file-accessible-directory-p "/sudo:root@IPad-S340:")
  file-accessible-directory-p(#("/sudo:root@IPad-S340:" 6 10 (tramp-default t) 11 20 (tramp-default t)))
  helm-find-files-get-candidates()
  apply(helm-find-files-get-candidates nil)
  helm-update()
  helm-check-new-input("/sudo::")
  helm-check-minibuffer-input()
  #f(compiled-function () #<bytecode 0x13c64df807298d0c>)()
  apply(#f(compiled-function () #<bytecode 0x13c64df807298d0c>) nil)
  timer-event-handler([t 0 0 10000 repeat #f(compiled-function () #<bytecode 0x13c64df807298d0c>) nil idle 0 nil])
  helm-read-from-minibuffer("Find files or url: " "/home/thierry/.emacs.d/emacs-config/" "^[[:multibyte:] ]*init\\.el$" nil nil nil nil)
  helm-internal(helm-source-find-files "/home/thierry/.emacs.d/emacs-config/" "Find files or url: " nil "^[[:multibyte:] ]*init\\.el$" "*helm find files*" nil nil nil)
  apply(helm-internal (helm-source-find-files "/home/thierry/.emacs.d/emacs-config/" "Find files or url: " nil "^[[:multibyte:] ]*init\\.el$" "*helm find files*" nil nil nil))
  helm(helm-source-find-files "/home/thierry/.emacs.d/emacs-config/" "Find files or url: " nil "^[[:multibyte:] ]*init\\.el$" "*helm find files*" nil nil nil)
  apply(helm (helm-source-find-files "/home/thierry/.emacs.d/emacs-config/" "Find files or url: " nil "^[[:multibyte:] ]*init\\.el$" "*helm find files*" nil nil nil))
  helm(:sources helm-source-find-files :input "/home/thierry/.emacs.d/emacs-config/" :case-fold-search smart :preselect "^[[:multibyte:] ]*init\\.el$" :ff-transformer-show-only-basename t :default nil :prompt "Find files or url: " :buffer "*helm find files*")
  helm-find-files-1("/home/thierry/.emacs.d/emacs-config/" "^[[:multibyte:] ]*init\\.el$")
  helm-find-files(nil)
  funcall-interactively(helm-find-files nil)
  call-interactively(helm-find-files nil nil)
  command-execute(helm-find-files)
16:52:31.095416 tramp-get-file-property (1) # File error: File `' must be absolute, please report a bug!
Find Files
 IPad-S340

Thanks.

-- 
Thierry