Subject: bug#78638: 30.1; When editing a remote file owned by another user, Tramp signals an error because it cannot change the file mode

From: Michael McClennen <[email-masked]>
Date: Sat, 14 Jun 2025 17:04:00 +0000

Hi Michael,

As you suggested, setting tramp-inhibit-errors-if-setting-file-attributes-fail to t solved the problem. Thank you for this information!

However, I think the best long-term solution would be to fix Tramp so as not to make this step necessary. Perhaps a check could be added so that the chmod command is not run unless the remote file is owned by the user?

I set up the same situation on my local machine, and the error does not occur locally. I tried it with backup-by-copying set to both nil and t, and in neither case do I get the error.

My local machine is running MacOS, whereas the remote machine is running Ubuntu, so that may have something to do with the difference.

  — Michael McClennen

On Jun 12, 2025, at 5:24 AM, Michael Albinus <[email-masked]<mailto:[email-masked]>> wrote:

Since Emacs 30.1, there is the user option
tramp-inhibit-errors-if-setting-file-attributes-fail. See (info "(tramp)
Frequently Asked Questions")

--8<---------------cut here---------------start------------->8---
  • How to ignore errors when changing file attributes?

    Sometimes, for example while saving remote files, errors appear
    when changing file attributes like permissions, time stamps, or
    ownership.  If these errors can be ignored, set user option
    ‘tramp-inhibit-errors-if-setting-file-attributes-fail’ to a
    non-‘nil’ value.  This transforms the error into a warning.
--8<---------------cut here---------------end--------------->8---