Files above about 5kb fail to load in tramp mode, with the error:

tramp-file-name-handler: Invalid base64 data

Loading smaller files works fine:

Tramp: Inserting ‘/scp:server:small_file’...
Tramp: Encoding remote file ‘/scp:server:small_file’ with ‘base64 <%s’...done
Tramp: Decoding local file ‘/tmp/tramp.13491uQF.py’ with ‘base64-decode-region’...done
Tramp: Inserting ‘/scp:server:small_file’...done

But with larger files I get this:

Tramp: Inserting ‘/scp:server:larger_file’...
Tramp: Encoding remote file ‘/scp:server:larger_file’ with ‘(gzip <%s | base64)’...done
Tramp: Decoding local file ‘/tmp/tramp.13491iyp.py’ with ‘(lambda (beg end) (base64-decode-region beg end) (let ((coding-system-for-write (quote binary)) (coding-system-for-read (quote binary)) (default-directory (tramp-compat-temporary-file-directory))) (apply (quote tramp-call-process-region) [scp nil kronos larger_file nil] (point-min) (point-max) (car (split-string gzip -d)) t t nil (cdr (split-string gzip -d)))))’...failed
Tramp: Inserting ‘/scp:server:larger_file’...failed
tramp-file-name-handler: Invalid base64 data

I've checked the gzip command on the remote server, it seems to be working. Can I get tramp to keep the intermediate files around so I can inspect them? How else can I debug this?

1 Answer 1


You can tell Tramp to print traces. Apply (setq tramp-verbose 6) prior your test. There will be a Tramp debug buffer, which you shall show, best in the tramp-devel@gnu.org mailing list.

If you inspect the debug buffer yourself, follow all trace lines marked with (6). These lines show sent commands, and their output.

  • Thanks for responding, Michael! I used that setting to find the transferred string, and I could decode it correctly using gzip and base64 on my local computer. It now appears that this problem only occurs when I open the file using neotree, not with helm. I will ask on tramp-devel.
    – mskel
    Apr 11, 2017 at 0:04
  • @mskel: do you have any updates on this? At the very least, if a fix was not yet done (I'm having the same problem with neotree right now), can you share how you mitigated the problem?
    – MB.
    Nov 30, 2019 at 1:54
  • 1
    @MB. : I switched to ranger for filesystem navigation for a while but now I run my editor on the remote host
    – mskel
    Nov 30, 2019 at 6:02
  • Thanks, @mskel: I'm resorting to do the same thing as well. Given how long this bug has been outstanding, I will try and figure out what it is when I get a few spare cycles...
    – MB.
    Nov 30, 2019 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.