GNU bug report logs - #57800
TRAMP insert-file-contents now fails for regions

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmail.com>

Date: Wed, 14 Sep 2022 12:12:02 UTC

Severity: normal

Tags: moreinfo

Fixed in version 29.1

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57800 in the body.
You can then email your comments to 57800 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Wed, 14 Sep 2022 12:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Pogonyshev <pogonyshev <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 14 Sep 2022 12:12:02 GMT) Full text and rfc822 format available.

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

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: TRAMP insert-file-contents now fails for regions
Date: Wed, 14 Sep 2022 14:11:00 +0200
[Message part 1 (text/plain, inline)]
Git commit fd1ee05977.

Open any file with TRAMP. From this buffer, evaluate:

    (let ((file buffer-file-name)) (with-temp-buffer (insert-file-contents
file nil)))

This works fine. However, if you use a region:

    (let ((file buffer-file-name)) (with-temp-buffer (insert-file-contents
file nil 1 10)))

this fails with an obviously wrong (file is certainly there) signal:

    Debugger entered--Lisp error: (file-missing "/ssh:...")
      signal(file-missing ("/ssh:..."))
      tramp-error((tramp-file-name "ssh" "..." nil "..." "..." "..." nil)
file-missing "/ssh:...")
      tramp-handle-insert-file-contents("/ssh:..." nil 1 10 nil)
      apply(tramp-handle-insert-file-contents ("/ssh:..." nil 1 10 nil))
      tramp-sh-file-name-handler(insert-file-contents "/ssh:..." nil 1 10
nil)
      apply(tramp-sh-file-name-handler insert-file-contents ("/ssh:..." nil
1 10 nil))
      tramp-file-name-handler(insert-file-contents "/ssh:..." nil 1 10 nil)
      insert-file-contents("/ssh:..." nil 1 10)
      (progn (insert-file-contents file nil 1 10))

Please add some automated tests for this.

Also, when a command fails with `file-missing' signal, Emacs UI only prints
the filename, as that seems to be the signal data. From user point of view
that says nothing. You can only understand what's wrong (even if this is
not a bug, as above) by setting `debug-on-error' to t, which is extremely
user-unfriendly.

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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Wed, 14 Sep 2022 18:09:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Wed, 14 Sep 2022 20:08:09 +0200
Paul Pogonyshev <pogonyshev <at> gmail.com> writes:

> Git commit fd1ee05977.
>
> Open any file with TRAMP. From this buffer, evaluate:
>
>     (let ((file buffer-file-name)) (with-temp-buffer (insert-file-contents file nil)))
>
> This works fine. However, if you use a region:
>
>     (let ((file buffer-file-name)) (with-temp-buffer (insert-file-contents file nil 1 10)))
>
> this fails with an obviously wrong (file is certainly there) signal:
>
>     Debugger entered--Lisp error: (file-missing "/ssh:...")
>       signal(file-missing ("/ssh:..."))

I tried this recipe with the current trunk, and things worked fine for
me.

Is it possible that you have an old version of tramp somewhere in your
load path?  I seem to vaguely recall that insert-file-contents +
start/end was something that was fixed sometime last year.




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 14 Sep 2022 18:09:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Wed, 14 Sep 2022 18:19:03 GMT) Full text and rfc822 format available.

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

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Wed, 14 Sep 2022 20:18:28 +0200
[Message part 1 (text/plain, inline)]
Hm, now I cannot reproduce this anymore. But today I got this bug,
recompiled Emacs from Git and the bug was still there. Right now I
tested Emacs 28 in case I managed to switch them accidentally, but
no, also not there.

So, either I have mixed something up, or this depends on some
volatile state in TRAMP, e.g. its cache.

I guess you can close the bug.

Paul

On Wed, 14 Sept 2022 at 20:08, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Paul Pogonyshev <pogonyshev <at> gmail.com> writes:
>
> > Git commit fd1ee05977.
> >
> > Open any file with TRAMP. From this buffer, evaluate:
> >
> >     (let ((file buffer-file-name)) (with-temp-buffer
> (insert-file-contents file nil)))
> >
> > This works fine. However, if you use a region:
> >
> >     (let ((file buffer-file-name)) (with-temp-buffer
> (insert-file-contents file nil 1 10)))
> >
> > this fails with an obviously wrong (file is certainly there) signal:
> >
> >     Debugger entered--Lisp error: (file-missing "/ssh:...")
> >       signal(file-missing ("/ssh:..."))
>
> I tried this recipe with the current trunk, and things worked fine for
> me.
>
> Is it possible that you have an old version of tramp somewhere in your
> load path?  I seem to vaguely recall that insert-file-contents +
> start/end was something that was fixed sometime last year.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Wed, 14 Sep 2022 18:24:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Wed, 14 Sep 2022 20:23:20 +0200
Paul Pogonyshev <pogonyshev <at> gmail.com> writes:

> Hm, now I cannot reproduce this anymore. But today I got this bug,
> recompiled Emacs from Git and the bug was still there. Right now I
> tested Emacs 28 in case I managed to switch them accidentally, but
> no, also not there.
>
> So, either I have mixed something up, or this depends on some
> volatile state in TRAMP, e.g. its cache.
>
> I guess you can close the bug.

Perhaps Michael has some comments here, so we'll wait for him to chime
in before closing, I think.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Wed, 14 Sep 2022 18:35:01 GMT) Full text and rfc822 format available.

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

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Wed, 14 Sep 2022 20:33:42 +0200
[Message part 1 (text/plain, inline)]
Might be somehow related to bug 57486. That one also doesn't happen to
me anymore, though this might be because it got fixed by side-effect,
since I have recompiled Emacs several times since then. But that bug
happened to me at least twice (with Emacs restarted etc.) on different
days. I could immediately tell since our Java application won't even
compile if system encoding is not UTF-8.

Paul

On Wed, 14 Sept 2022 at 20:23, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Paul Pogonyshev <pogonyshev <at> gmail.com> writes:
>
> > Hm, now I cannot reproduce this anymore. But today I got this bug,
> > recompiled Emacs from Git and the bug was still there. Right now I
> > tested Emacs 28 in case I managed to switch them accidentally, but
> > no, also not there.
> >
> > So, either I have mixed something up, or this depends on some
> > volatile state in TRAMP, e.g. its cache.
> >
> > I guess you can close the bug.
>
> Perhaps Michael has some comments here, so we'll wait for him to chime
> in before closing, I think.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Thu, 15 Sep 2022 10:31:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Thu, 15 Sep 2022 12:30:01 +0200
Paul Pogonyshev <pogonyshev <at> gmail.com> writes:

Hi Paul,

> Might be somehow related to bug 57486. That one also doesn't happen to
> me anymore, though this might be because it got fixed by side-effect,
> since I have recompiled Emacs several times since then. But that bug
> happened to me at least twice (with Emacs restarted etc.) on different
> days. I could immediately tell since our Java application won't even
> compile if system encoding is not UTF-8.

tramp-handle-insert-file-contents hasn't been touched for about two
months, so it shouldn't be caused by a change in that function. But as
said in bug#57486, there were some bugs when migrating Tramp to use
rx. They are fixed meanwhile (I hope I could detect all of them), which
might explain the behavior.

Btw, tramp-test09-insert-file-contents checks also inserting just a
file region. So the Tramp testsuite should signal regressions here.

From my pov, we could close the bug, unless the problem happens again.

> Paul

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Fri, 16 Sep 2022 09:38:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Paul Pogonyshev <pogonyshev <at> gmail.com>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Fri, 16 Sep 2022 11:37:37 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

>>From my pov, we could close the bug, unless the problem happens again.
>
>> Paul

OK; closing this bug report, then.




bug closed, send any further explanations to 57800 <at> debbugs.gnu.org and Paul Pogonyshev <pogonyshev <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 16 Sep 2022 09:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Thu, 29 Sep 2022 09:25:01 GMT) Full text and rfc822 format available.

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

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Thu, 29 Sep 2022 11:24:10 +0200
[Message part 1 (text/plain, inline)]
Happened to me again. Symptoms are exactly the same: inserting the whole
file works, inserting only a part dies with `file-missing'.

Paul

On Fri, 16 Sept 2022 at 11:37, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Michael Albinus <michael.albinus <at> gmx.de> writes:
>
> >>From my pov, we could close the bug, unless the problem happens again.
> >
> >> Paul
>
> OK; closing this bug report, then.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Thu, 29 Sep 2022 10:44:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Thu, 29 Sep 2022 12:43:13 +0200
Paul Pogonyshev <pogonyshev <at> gmail.com> writes:

> Happened to me again. Symptoms are exactly the same: inserting the whole file
> works, inserting only a part dies with `file-missing'.

OK; reopening.

Do you have a backtrace for when it fails?

A complete recipe to reproduce the problem would also be helpful.




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 29 Sep 2022 10:44:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Thu, 29 Sep 2022 11:27:02 GMT) Full text and rfc822 format available.

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

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Thu, 29 Sep 2022 13:26:05 +0200
[Message part 1 (text/plain, inline)]
No, the bug is not reproducible all the time. I have switched to Emacs 28
since then, as this breaks functionality important for me. Now tried to run
29 again, but it doesn't happen anymore, neither with `-Q' nor without.
Also cannot find a backtrace for the same reason now.

From the reproducing early today I remember that restarting Emacs doesn't
help - or is at least random, since now a newly started Emacs doesn't
exhibit this problem. It feels like the problem is in some cache and the
cache appears to be persistent (cross-Emacs), if TRAMP uses something like
that at all.

The files I have noticed this on have names like "/ssh:USER <at> HOST#22222:/...",
i.e. using SSH backend and a non-standard port, if that matters.

Paul

On Thu, 29 Sept 2022 at 12:43, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Paul Pogonyshev <pogonyshev <at> gmail.com> writes:
>
> > Happened to me again. Symptoms are exactly the same: inserting the whole
> file
> > works, inserting only a part dies with `file-missing'.
>
> OK; reopening.
>
> Do you have a backtrace for when it fails?
>
> A complete recipe to reproduce the problem would also be helpful.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Thu, 29 Sep 2022 11:29:01 GMT) Full text and rfc822 format available.

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

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Thu, 29 Sep 2022 13:27:50 +0200
[Message part 1 (text/plain, inline)]
> is not reproducible all the time

As a clarification, if certain Emacs instance is affected, then the bug
appears to happen in it always. Likewise, if it works once in an instance,
then it will work properly every time in it -- or at least I haven't seen
any counterexamples.

Paul

On Thu, 29 Sept 2022 at 13:26, Paul Pogonyshev <pogonyshev <at> gmail.com> wrote:

> No, the bug is not reproducible all the time. I have switched to Emacs 28
> since then, as this breaks functionality important for me. Now tried to run
> 29 again, but it doesn't happen anymore, neither with `-Q' nor without.
> Also cannot find a backtrace for the same reason now.
>
> From the reproducing early today I remember that restarting Emacs doesn't
> help - or is at least random, since now a newly started Emacs doesn't
> exhibit this problem. It feels like the problem is in some cache and the
> cache appears to be persistent (cross-Emacs), if TRAMP uses something like
> that at all.
>
> The files I have noticed this on have names like "/ssh:USER <at> HOST#22222:/...",
> i.e. using SSH backend and a non-standard port, if that matters.
>
> Paul
>
> On Thu, 29 Sept 2022 at 12:43, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>
>> Paul Pogonyshev <pogonyshev <at> gmail.com> writes:
>>
>> > Happened to me again. Symptoms are exactly the same: inserting the
>> whole file
>> > works, inserting only a part dies with `file-missing'.
>>
>> OK; reopening.
>>
>> Do you have a backtrace for when it fails?
>>
>> A complete recipe to reproduce the problem would also be helpful.
>>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Thu, 29 Sep 2022 17:40:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Thu, 29 Sep 2022 19:39:39 +0200
Paul Pogonyshev <pogonyshev <at> gmail.com> writes:

Hi Paul,

> No, the bug is not reproducible all the time. I have switched to Emacs
> 28 since then, as this breaks functionality important for me. Now
> tried to run 29 again, but it doesn't happen anymore, neither with
> `-Q' nor without. Also cannot find a backtrace for the same reason
> now.
>
> From the reproducing early today I remember that restarting Emacs
> doesn't help - or is at least random, since now a newly started Emacs
> doesn't exhibit this problem. It feels like the problem is in some
> cache and the cache appears to be persistent (cross-Emacs), if TRAMP
> uses something like that at all.
>
> The files I have noticed this on have names like
> "/ssh:USER <at> HOST#22222:/...", i.e. using SSH backend and a non-standard
> port, if that matters.

Thanks, this might make a difference when caching files. Ports are used
for creating a file name index in the cache, but I'm not certain they
are always taken into account, in all dark corners of Tramp. Will analyze.

However, it would be great if you could reproduce the bug somehow in an
Emacs instance started with

--8<---------------cut here---------------start------------->8---
emacs -Q --eval '(setq tramp-verbose 10)'
--8<---------------cut here---------------end--------------->8---

If the problem happens, pls show the recipe to provoke, and the Tramp
debug buffer.

> Paul

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Fri, 30 Sep 2022 08:50:02 GMT) Full text and rfc822 format available.

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

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Fri, 30 Sep 2022 10:49:27 +0200
[Message part 1 (text/plain, inline)]
Happened again. See attached `BACKTRACE' and `TRAMP-LOG' generated after
evalling `(setf tramp-verbose 10)'.

Note this suspicious entry in the log:
10:26:36.864700 tramp-get-remote-tmpdir (1) # File error: Directory
/ssh:USER <at> HOST#22222:/ssh:USER <at> HOST#22222:/tmp not accessible

Mentioned Git commit cannot be found, because I build Emacs with a few
minor local changes. I can assure you they have nothing to do with TRAMP.
The build is from 14th of September, so upstream commit number should be
around 997284d2a5 or so.

I will keep this Emacs instance around in case you have questions.

Paul

On Thu, 29 Sept 2022 at 19:39, Michael Albinus <michael.albinus <at> gmx.de>
wrote:

> Paul Pogonyshev <pogonyshev <at> gmail.com> writes:
>
> Hi Paul,
>
> > No, the bug is not reproducible all the time. I have switched to Emacs
> > 28 since then, as this breaks functionality important for me. Now
> > tried to run 29 again, but it doesn't happen anymore, neither with
> > `-Q' nor without. Also cannot find a backtrace for the same reason
> > now.
> >
> > From the reproducing early today I remember that restarting Emacs
> > doesn't help - or is at least random, since now a newly started Emacs
> > doesn't exhibit this problem. It feels like the problem is in some
> > cache and the cache appears to be persistent (cross-Emacs), if TRAMP
> > uses something like that at all.
> >
> > The files I have noticed this on have names like
> > "/ssh:USER <at> HOST#22222:/...", i.e. using SSH backend and a non-standard
> > port, if that matters.
>
> Thanks, this might make a difference when caching files. Ports are used
> for creating a file name index in the cache, but I'm not certain they
> are always taken into account, in all dark corners of Tramp. Will analyze.
>
> However, it would be great if you could reproduce the bug somehow in an
> Emacs instance started with
>
> --8<---------------cut here---------------start------------->8---
> emacs -Q --eval '(setq tramp-verbose 10)'
> --8<---------------cut here---------------end--------------->8---
>
> If the problem happens, pls show the recipe to provoke, and the Tramp
> debug buffer.
>
> > Paul
>
> Best regards, Michael.
>
[Message part 2 (text/html, inline)]
[BACKTRACE (application/octet-stream, attachment)]
[TRAMP-LOG (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Fri, 30 Sep 2022 18:40:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Fri, 30 Sep 2022 20:39:22 +0200
Paul Pogonyshev <pogonyshev <at> gmail.com> writes:

Hi Paul,

> Happened again. See attached `BACKTRACE' and `TRAMP-LOG' generated
> after evalling `(setf tramp-verbose 10)'.

I guess you mean setq.

> Note this suspicious entry in the log:
> 10:26:36.864700 tramp-get-remote-tmpdir (1) # File error: Directory
> /ssh:USER <at> HOST#22222:/ssh:USER <at> HOST#22222:/tmp not accessible

Yes. And the debug buffer shows us

--8<---------------cut here---------------start------------->8---
> ;; 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/5fd8e1cc49d2ebd59219ddf3a691949a22b601f3
> 10:26:36.638086 tramp-handle-insert-file-contents (3) # Inserting ‘/ssh:USER <at> HOST#22222:/PATH’...
> 10:26:36.639033 tramp-get-connection-property (7) # remote-tmpdir undef; cache used: nil
> 10:26:36.639200 tramp-get-connection-property (7) # tmpdir /ssh:USER <at> HOST#22222:/tmp; cache used: t
> 10:26:36.639335 tramp-get-connection-property (7) # tmpdir /ssh:USER <at> HOST#22222:/tmp; cache used: t
--8<---------------cut here---------------end--------------->8---

The value of of "tmpdir" is completely wrong, it must be something like
"/tmp" or so. Tramp doesn't set this connection property anymore; it
takes it from tramp-methods if declared there.

It was set like this prior commit 9ea40b3ddfb of 2022-08-15, likely your
cache did offer this old value. Could you pls apply "M-x
tramp-cleanup-all-connections" in order to clean up the connection
cache, and retry your test?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Fri, 30 Sep 2022 18:53:02 GMT) Full text and rfc822 format available.

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

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Fri, 30 Sep 2022 20:52:00 +0200
[Message part 1 (text/plain, inline)]
Yes, that fixes the problem. Does that mean I somehow have a mixup of
sources from different commits (not sure how) or that the cache is
persistent and can survive long times? Note that I also run Emacs 28 from
time to time. Could it be that 29 reuses cache created by 28 that contains
no-longer-compatible values?

Paul

On Fri, 30 Sept 2022 at 20:39, Michael Albinus <michael.albinus <at> gmx.de>
wrote:

> Paul Pogonyshev <pogonyshev <at> gmail.com> writes:
>
> Hi Paul,
>
> > Happened again. See attached `BACKTRACE' and `TRAMP-LOG' generated
> > after evalling `(setf tramp-verbose 10)'.
>
> I guess you mean setq.
>
> > Note this suspicious entry in the log:
> > 10:26:36.864700 tramp-get-remote-tmpdir (1) # File error: Directory
> > /ssh:USER <at> HOST#22222:/ssh:USER <at> HOST#22222:/tmp not accessible
>
> Yes. And the debug buffer shows us
>
> --8<---------------cut here---------------start------------->8---
> > ;; 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/5fd8e1cc49d2ebd59219ddf3a691949a22b601f3
> > 10:26:36.638086 tramp-handle-insert-file-contents (3) # Inserting
> ‘/ssh:USER <at> HOST#22222:/PATH’...
> > 10:26:36.639033 tramp-get-connection-property (7) # remote-tmpdir undef;
> cache used: nil
> > 10:26:36.639200 tramp-get-connection-property (7) # tmpdir /ssh:USER <at> HOST#22222:/tmp;
> cache used: t
> > 10:26:36.639335 tramp-get-connection-property (7) # tmpdir /ssh:USER <at> HOST#22222:/tmp;
> cache used: t
> --8<---------------cut here---------------end--------------->8---
>
> The value of of "tmpdir" is completely wrong, it must be something like
> "/tmp" or so. Tramp doesn't set this connection property anymore; it
> takes it from tramp-methods if declared there.
>
> It was set like this prior commit 9ea40b3ddfb of 2022-08-15, likely your
> cache did offer this old value. Could you pls apply "M-x
> tramp-cleanup-all-connections" in order to clean up the connection
> cache, and retry your test?
>
> Best regards, Michael.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Fri, 30 Sep 2022 19:12:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Fri, 30 Sep 2022 21:11:34 +0200
Paul Pogonyshev <pogonyshev <at> gmail.com> writes:

Hi Paul,

> Yes, that fixes the problem. Does that mean I somehow have a mixup of
> sources from different commits (not sure how) or that the cache is
> persistent and can survive long times? Note that I also run Emacs 28
> from time to time. Could it be that 29 reuses cache created by 28 that
> contains no-longer-compatible values?

Could be the latter, yes. "tmpdir" is the only cache value I know of
which has changed its meaning(*). Perhaps I shall add a test that it
ignores cached "tmpdir" values if they are remote. But hmm, it has
changed its meaning also in Tramp 2.5.3.2, which is distributed via GNU
ELPA.

(*): More precisely, there were two different meanings in different
places of Tramp. The fix was needed to fix that bug.

> Paul

Best regards, Michael.




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Fri, 30 Sep 2022 19:59:02 GMT) Full text and rfc822 format available.

Notification sent to Paul Pogonyshev <pogonyshev <at> gmail.com>:
bug acknowledged by developer. (Fri, 30 Sep 2022 19:59:02 GMT) Full text and rfc822 format available.

Message #61 received at 57800-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: 57800-done <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Fri, 30 Sep 2022 21:58:35 +0200
Version: 29.1

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

Hi Paul,

>> Yes, that fixes the problem. Does that mean I somehow have a mixup of
>> sources from different commits (not sure how) or that the cache is
>> persistent and can survive long times? Note that I also run Emacs 28
>> from time to time. Could it be that 29 reuses cache created by 28 that
>> contains no-longer-compatible values?
>
> Could be the latter, yes. "tmpdir" is the only cache value I know of
> which has changed its meaning(*). Perhaps I shall add a test that it
> ignores cached "tmpdir" values if they are remote. But hmm, it has
> changed its meaning also in Tramp 2.5.3.2, which is distributed via GNU
> ELPA.

Pushed this change to the emacs-28 branch, it will appear in the master
branch after merge.

It will also be contained in the upcoming Tramp 2.5.3.4 on GNU
ELPA. Closing the bug.

>> Paul

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Fri, 30 Sep 2022 20:49:02 GMT) Full text and rfc822 format available.

Message #64 received at 57800-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 57800-done <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Fri, 30 Sep 2022 22:48:29 +0200
[Message part 1 (text/plain, inline)]
Thanks. I suggest also adding a simple "version" to the cache. Whenever you
make an incompatible change in the future, bump this version. And also make
Tramp automatically discard all cached values when they come from a
different (earlier or even a later) version. Otherwise something like this
will certainly happen again sooner or later and will cost both the person
bumping into it and you or whoever responds to the bugreport a lot of time
again.

Paul

On Fri, 30 Sept 2022 at 21:58, Michael Albinus <michael.albinus <at> gmx.de>
wrote:

> Version: 29.1
>
> Michael Albinus <michael.albinus <at> gmx.de> writes:
>
> Hi Paul,
>
> >> Yes, that fixes the problem. Does that mean I somehow have a mixup of
> >> sources from different commits (not sure how) or that the cache is
> >> persistent and can survive long times? Note that I also run Emacs 28
> >> from time to time. Could it be that 29 reuses cache created by 28 that
> >> contains no-longer-compatible values?
> >
> > Could be the latter, yes. "tmpdir" is the only cache value I know of
> > which has changed its meaning(*). Perhaps I shall add a test that it
> > ignores cached "tmpdir" values if they are remote. But hmm, it has
> > changed its meaning also in Tramp 2.5.3.2, which is distributed via GNU
> > ELPA.
>
> Pushed this change to the emacs-28 branch, it will appear in the master
> branch after merge.
>
> It will also be contained in the upcoming Tramp 2.5.3.4 on GNU
> ELPA. Closing the bug.
>
> >> Paul
>
> Best regards, Michael.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Sat, 01 Oct 2022 15:20:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Sat, 01 Oct 2022 17:18:56 +0200
Paul Pogonyshev <pogonyshev <at> gmail.com> writes:

Hi Paul,

> Thanks. I suggest also adding a simple "version" to the cache.
> Whenever you make an incompatible change in the future, bump this
> version. And also make Tramp automatically discard all cached values
> when they come from a different (earlier or even a later) version.
> Otherwise something like this will certainly happen again sooner or
> later and will cost both the person bumping into it and you or whoever
> responds to the bugreport a lot of time again.

That's a good idea, thanks! I've pushed a respective change to master.

However, the cache doesn't keep its own version, it uses just the Tramp
version for check. Using an own cache version is error-prone, there are
good chances to forget to change it when needed. At least *I* would
forget it always, as far as I know me.

> Paul

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#57800; Package emacs. (Sat, 01 Oct 2022 16:17:02 GMT) Full text and rfc822 format available.

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

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 57800 <at> debbugs.gnu.org
Subject: Re: bug#57800: TRAMP insert-file-contents now fails for regions
Date: Sat, 1 Oct 2022 18:16:01 +0200
[Message part 1 (text/plain, inline)]
> However, the cache doesn't keep its own version, it uses just the Tramp
> version for check.

Yeah, as long as it is not expensive, it won't hurt to throw it away
whenever Tramp version changes, even if cache format stays the same,
just to be sure.

Paul

On Sat, 1 Oct 2022 at 17:19, Michael Albinus <michael.albinus <at> gmx.de> wrote:

> Paul Pogonyshev <pogonyshev <at> gmail.com> writes:
>
> Hi Paul,
>
> > Thanks. I suggest also adding a simple "version" to the cache.
> > Whenever you make an incompatible change in the future, bump this
> > version. And also make Tramp automatically discard all cached values
> > when they come from a different (earlier or even a later) version.
> > Otherwise something like this will certainly happen again sooner or
> > later and will cost both the person bumping into it and you or whoever
> > responds to the bugreport a lot of time again.
>
> That's a good idea, thanks! I've pushed a respective change to master.
>
> However, the cache doesn't keep its own version, it uses just the Tramp
> version for check. Using an own cache version is error-prone, there are
> good chances to forget to change it when needed. At least *I* would
> forget it always, as far as I know me.
>
> > Paul
>
> Best regards, Michael.
>
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 30 Oct 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 177 days ago.

Previous Next


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