Emacs Cannot Open File Within ZFS Snapshot Folders reddit / emacs ---------------------------------------------------------------------- JavaScriptDude96 · 2022-04-19 23:00 I have a need to open a file for processing that sits in a zfs snapshot directory (/.zfs/snapshot/...). When trying to open a file under the snapshot directory, emacs fails with: File mode specification error: (error ‘tramp-file-name-structure’ didn’t match!) Recursive load: "/usr/share/emacs/26.3/lisp/net/tramp.elc ... I have a completely valid usecase for opening such files with emacs in batch mode. This error occurs in non batch modes as well; both GUI and cli (-nw). I know these .zfs folders are special folders which is why tramp may be in use. Any idea on how to get around this issue? This issue seems like a bug. ---------------------------------------------------------------------- QuirkyImage · 2022-04-19 23:17 No idea, however.. https://stackoverflow.com/questions/4180111/what-does-it-mean-when- emacs-tells-me-file-mode-specification-error#4181236 ---------------------------------------------------------------------- ieure · 2022-04-20 02:57 What's the path you're trying to open? The error is coming from TRAMP, which is used for remote / privileged file access, and shouldn't be in play if you're using local paths. Your install might be messed up, or if you're invoking Emacs from a sudo shell, environment variables from your user session might be leaking into the root one and causing issues. ---------------------------------------------------------------------- JavaScriptDude96 · 2022-04-20 04:21 Its a read only filesystem presented by every OpenZFS file system. Every ZFS Dataset has a '/.zfs/snapshot' directory that contains one folder for each snapshot of the dataset. Anyone using ZFS can browse these directories to see old copies of files and directories. Not running sudo and I stripped out my emacs config files (\~/.emacs.el and \~/.emacs.d) and the issue still occurred. I'm running a fully updated system with Emacs 26.3. Here is the mount info for one of my datasets: $ mount | grep /dpool/vcmain dpool/vcmain on /dpool/vcmain type zfs (rw,xattr,noacl) ---------------------------------------------------------------------- ieure · 2022-04-20 15:56 I understand, I run ZFS on my NAS. What's the stack show if you run `toggle-debug-on-error` before opening the file? That ought to point to the TRAMP stuff getting called. ---------------------------------------------------------------------- JavaScriptDude96 · 2022-04-20 16:33 I raised this issue with Emacs team and it was resolved after upgrading from 26.3 to 28.1 (latest stable). I'm not a lisp guy so I'm not going to do any deep diving. Thanks for your posts :) ---------------------------------------------------------------------- JavaScriptDude96 · 2022-04-20 16:35 This issue was resolved by upgrading from Emacs from 26.3 to 28.1 by building from source.