Opened 14 years ago

Last modified 2 years ago

#29794 assigned defect

emacs-app @23.3_0 Problem using tramp in emacs.app: "ControlPath too long"

Reported by: gorzarg@… Owned by: drkp (Dan Ports)
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc: humem (humem), cooljeanius (Eric Gallager)
Port: emacs-app

Description

OS: 10.6.7 Xcode: Version 3.2.6 (1761)

Using tramp in emacs.app results in the error "ControlPath too long" after typing in the remote machine's password.

For example, in emacs:

1) "C-x C-f" to find a file

2) Type "/user@remotemachine:somefile.txt"

3) Asks for password, (type the correct one in).

4) Results in this error:

user@remotemachine's password: ControlPath too long

Process *tramp/scpc remotemachine* exited abnormally with code 255

In the *Messages* buffer, it says the tramp is doing the command:

Tramp: Sending command `exec ssh -o ControlPath=/var/folders/...a_really_long_dir_name.../-Tmp-/tramp.442LsW.%r@%h:%p -o ControlMaster=yes -e none remotemachine'

So I think the ControlPath is just too long for ssh.

Note: I don't think this is a problem with tramp itself, because I compared the tramp files in /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/net/ with the ones on a linux machine where tramp works, and they're pretty much the same.

Any suggestions or fixes?

Change History (17)

comment:1 Changed 14 years ago by gorzarg@…

Cc: gorzarg@… added

Cc Me!

comment:2 Changed 14 years ago by jmroot (Joshua Root)

Cc: gorzarg@… removed
Owner: changed from macports-tickets@… to css@…

Please remember to cc the maintainer. You do not need to be in cc when you are the reporter.

comment:3 in reply to:  description Changed 14 years ago by dmercer@…

Replying to gorzarg@…:

Any suggestions or fixes?

I saw this today (MacOS 10.6.7 + Aquamacs 23.3.1). I don't have a permanent fix, but this workaround works for me. Tramp is using the TMPDIR environment to build a path for the ssh control socket. On my system, TMPDIR is set to something that looks like:

/var/folders/Ww/WwhMzsgCFW0-C433VCMqNE+++TI/-Tmp-/

which results in a path ssh thinks is too long. You can force Aquamacs to use a standard TMPDIR by starting it from the terminal like so:

$ TMPDIR=/tmp open /Applications/Aquamacs.app

comment:4 Changed 13 years ago by cssdev

So is this an issue with the port or a more general platform configuration issue?

comment:5 in reply to:  4 ; Changed 13 years ago by gorzarg@…

Replying to css@…:

So is this an issue with the port or a more general platform configuration issue?

Not sure. However, dmercer's workaround works. So, I dug around in the tramp files, and I think I have a fix:

1) Open up /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/net/tramp-compat.el.gz in emacs with root access (e.g. sudo emacs tramp-compat.el.gz). 2) In tramp-compat.el.gz, delete lines 212-224. 3) Add the following text: (file-name-as-directory "/tmp"))

to line 212.

4) Control-x-s to save the file. 5) Meta-x, byte-compile-file, then enter in tramp-compat.el.gz and press enter. 6) Meta-x, byte-compile-file, then enter in tramp.el.gz and press enter. 7) Adjust permissions of byte-compiled files so other people can use them: sudo chmod go+r tramp.elc tramp-compat.elc.

Tramp should work now without having to set the $TMPDIR env variable. Basically, I'm just modifying the tramp-compat-temporary-file-directory function in tramp-compat.el.gz to just set the temporary directory as "/tmp."

Maybe for the next release of this port, this change (or something similar) could be incorporated so I don't have to manually do this every time I update Emacs.app?

comment:6 Changed 13 years ago by yaroslavvb@…

I got same error and gorzag's solution seems to work.

The only snag was with the the byte compilation part using official Emacs for MacOS build (23.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.35)) -- tramp.el gives error on (require 'tramp-compat) -- "Cannot open load file: tramp-compat". I got around this by deleting tramp.elc and tramp-compat.elc, unzipping tramp and tramp-compat, and doing gorzarg's modification in tramp-compat.el.

comment:7 in reply to:  6 Changed 13 years ago by gorzarg@…

You used the default Mac OS emacs (i.e. /usr/bin/emacs)? I used emacs.app (from MacPorts) to do the byte-compilations, and it worked okay. I also have (auto-compression-mode t) in my .emacs file to edit compressed files on the fly (you can also do M-x auto-compression-mode).

Hope that helps any other users with problems with tramp.

Replying to yaroslavvb@…:

I got same error and gorzag's solution seems to work.

The only snag was with the the byte compilation part using official Emacs for MacOS build (23.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.35)) -- tramp.el gives error on (require 'tramp-compat) -- "Cannot open load file: tramp-compat". I got around this by deleting tramp.elc and tramp-compat.elc, unzipping tramp and tramp-compat, and doing gorzarg's modification in tramp-compat.el.

comment:8 Changed 13 years ago by yaroslavvb@…

I think perhaps the error in byte-compilation was due to archiving. Once I unarchived tramp-compat.el.gz, I can byte-compile it

comment:9 Changed 13 years ago by jmroot (Joshua Root)

Cc: hum@… added

comment:10 Changed 12 years ago by humem (humem)

Resolution: worksforme
Status: newclosed

I do not get the same error with the latest emacs-app @24.1. I am closing this ticket, but please reopen it if you find any trouble.

comment:11 Changed 12 years ago by buckmeisterq@…

Resolution: worksforme
Status: closedreopened

I've got GNU Emacs 24.2.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2012-08-27 on bob.porkrind.org and it still has the issue. I've tried both workarounds of setting TMPDIR=/tmp and modifying/byte-compiling the tramp-compat.el.gz, but I still get:

CentOS release 5.8 (Final)

Kernel 2.6.18-194.32.1.el5 on an x86_64

ControlPath too long (followed by a hat-M, like a CTRL-M from windows line ending?)

Any way that I can provide more details to help diagnose/reproduce/workaround this problem? I would really like to use tramp on the mac but it is unusable due to this error. I'm trying to do things like open "~/bin/file_name.sh" on a host named "aa-master". It seems like the control path for that would be really, really short.

My username is only six chars, and this is my obfuscated but character-count-equivalent ssh config (note that I've tried with and without ControlPath being set):

Host aa-master

HostName aa-hudson-master-vm.ottffssente.com

User ottffs

IdentitiesOnly yes

IdentityFile ~/.ssh/id_rsa

ControlPath /c/c-%r

comment:12 in reply to:  11 Changed 12 years ago by cabo@…

Replying to buckmeisterq@…:

HostName aa-hudson-master-vm.ottffssente.com

From someone who also lives in la-la-la-can-i-make-my-domain-name-longer-land:

Workaround: use the IP address.

(I know, I know.)

comment:13 in reply to:  5 Changed 11 years ago by espenhw@…

Replying to gorzarg@…:

Replying to css@…:

So is this an issue with the port or a more general platform configuration issue?

Not sure. However, dmercer's workaround works. So, I dug around in the tramp files, and I think I have a fix:

1) Open up /Applications/MacPorts/Emacs.app/Contents/Resources/lisp/net/tramp-compat.el.gz in emacs with root access (e.g. sudo emacs tramp-compat.el.gz). 2) In tramp-compat.el.gz, delete lines 212-224. 3) Add the following text: (file-name-as-directory "/tmp"))

to line 212.

4) Control-x-s to save the file. 5) Meta-x, byte-compile-file, then enter in tramp-compat.el.gz and press enter. 6) Meta-x, byte-compile-file, then enter in tramp.el.gz and press enter. 7) Adjust permissions of byte-compiled files so other people can use them: sudo chmod go+r tramp.elc tramp-compat.elc.

Or better, add the following to your .emacs:

(put 'temporary-file-directory 'standard-value '((file-name-as-directory "/tmp")))

comment:14 Changed 10 years ago by sergey+macports@…

I haven't experiences this problem until OS X 10.10 Yosemite and Emacs 24.4. The original workaround recipe didn't work and I wasn't kin on modifying Tramp source. The following worked for me right before starting Tramp: M-x setenv TMPDIR /tmp. I only use it btw to sync up Org mode files using MobileOrg.

comment:15 Changed 9 years ago by kurthindenburg (Kurt Hindenburg)

Owner: changed from css@… to macports-tickets@…
Status: reopenednew

comment:16 Changed 7 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to drkp
Status: newassigned

comment:17 Changed 2 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.