GNU bug report logs - #78572
30.1; Tramp Project error message loop - File is missing

Previous Next

Package: emacs;

Reported by: Alexis Bakatine <abakatine <at> proton.me>

Date: Sat, 24 May 2025 02:28:02 UTC

Severity: normal

Found in version 30.1

Fixed in version 31.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Full log


Message #41 received at 78572 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Alexis Bakatine <abakatine <at> proton.me>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 78572 <at> debbugs.gnu.org
Subject: Re: bug#78572: 30.1;
 Tramp Project error message loop - File is missing
Date: Wed, 28 May 2025 17:10:48 -0400
[Message part 1 (text/plain, inline)]
On Wed, May 28, 2025 at 5:05 PM Alexis Bakatine via Bug reports for GNU
Emacs, the Swiss army knife of text editors <bug-gnu-emacs <at> gnu.org> wrote:

> Hello Michael,
>
> > What you've sent didn't help; the problem is indicated much earlier in
> > the debug file. This is why I always insist in sending the whole debug
> > information.
>
> I apologize, I thought it was just irrelevant noise until what looped over
> and over, but it was indeed crucial.
>
> All your explanations make sense now. But I'm still not sure if it's an
> issue with Tramp or Project? Trivially speaking, we could also ask Project
> to not look for vc related information over Tramp, but maybe some people
> rely on this? After all, I'm the first one to report that bug as far as I
> know.
>
> > sudo's session timeout after ca 5 minutes due to inactivity on the
> > wire.
>
> This led me to investigate something. I told you it happened when
> using Tramp with sudo. But now I tested it WITHOUT sudo and I can
> reproduce the same errors. Here are the steps:
>
> 1. start an Emacs session with the command below (replace "x" with your own
>    server)
>
> --8<---------------cut here---------------start------------->8---
> # emacs -Q -l project --eval '(setopt project-vc-extra-root-markers (quote
> (".project")))' --eval '(setopt project-mode-line t)' '/ssh:x:'
> --8<---------------cut here---------------end--------------->8---
>
> 2. after successfuly connecting do:
>    M-x tramp-cleanup-all-connections
>
> As soon as the connection is closed the same errors happen.
>
> > --8<---------------cut here---------------start------------->8---
> > (add-to-list 'tramp-connection-properties (list (regexp-quote
> "/sudo:root <at> x:") "session-timeout" nil))
> > --8<---------------cut here---------------end--------------->8---
>
> > Does this work for you?
>
> I did try it in my init.el, and it cancels the automatic disconnect, but as
> soon as I M-x tramp-cleanup-all-connections or simply kill the process,
> the errors appear.
>
> I can live without having the project name in the mode line, so I removed
> (setopt project-mode-line t)
> but kept (setopt project-vc-extra-root-markers (quote (".project")))
>
> It seems the problem doesn't happen anymore (tested with 30.1 and master),
> yet I'm almost confident even with that setting only it was crashing
> Emacs at some point, I will try in my main config to see if it happens
> again later.
>

If this continues to be a concern, you can easily wrap the project mode
line with a remote file guard.  Maybe something like this:

  (setq project-mode-line-format '(:eval (my/project-mode-line-format)))
  (defun my/project-mode-line-format ()
    (unless (file-remote-p default-directory)
      (project-mode-line-format)))

You could make the guard sensitive to a custom variable of your own or to
the directory tree root or whatever makes sense for you.

-Stephane
[Message part 2 (text/html, inline)]

This bug report was last modified 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.