I just started using emacs last week and everything is going well so far. I am using tramp to edit remote files as follows:
C-x C-f
/ssh:user@server:/file/to/edit
I login to the server using an ssh key, so no password is needed. Therefore I don't do anything special to start tramp and nothing has been added to my .emacs file, I simply type the above in my local emacs and it works.
The files im editing are mostly python (ie: plain text *.py files) and for the most part everything works correctly. However when I try to open some files they don't open and the following message is displayed:
gzip: stdin: unexpected end of file
Is there any way to get around this issue?
UPDATE: As suggested in the comments I enabled (setq tramp-verbose 6)
. The tramp debug buffer is huge (thousands of lines) so I have tried to pick out the parts that appear to be important or where some sort of error is mentioned, hopefully that will aid in figuring out what is happening:
16:11:29.124528 tramp-sh-handle-file-local-copy (3) # Encoding remote file `/ssh:myuser@myserver:/path/to/python/file.py' with `(gzip <%s | base64)'...done
16:11:29.130875 tramp-sh-handle-file-truename (4) # Finding true name for `/ssh:myuser@myserver:/path/to/python/file/'
16:11:29.131565 tramp-send-command (6) # \readlink --canonicalize-missing /path/to/python/file/ 2>/dev/null; echo tramp_exit_status $?
16:11:29.376133 tramp-wait-for-regexp (6) #
16:11:33.245252 tramp-sh-handle-file-local-copy (3) # Decoding local file `/tmp/tramp.4885Mau.py' with `(lambda (beg end) (base64-decode-region beg end) (let ((coding-system-for-write (quote binary)) (coding-system-for-read (quote binary))) (apply (quote call-process-region) (point-min) (point-max) (car (split-string gzip -d)) t t nil (cdr (split-string gzip -d)))))'...done
16:11:33.249827 tramp-call-process (6) # `chown 1000:1000 /tmp/tramp.4885Mau.py' nil nil
16:11:33.252963 tramp-call-process (6) # 0
16:11:33.255820 tramp-handle-insert-file-contents (3) # Inserting `/ssh:myuser@myserver:/path/to/python/file.py'...done
///b47a60d20b86781fc5d02f0fac35ec59#$16:11:34.975322 tramp-send-command-and-check (1) # File error: Couldn't find exit status of `( (test -e /path/to/python/file.py || test -h /path/to/python/file.py) && \stat -c '(("%N") %h %ue0 %ge0 %Xe0 %Ye0 %Ze0 %se0 "%A" t %ie0 -1)' /path/to/python/file.py || echo nil)'
The last line appears to be the actual error.