I got the not terribly helpful error message recently trying to connect emacsclient to a emacs daemon using tcp sockets.

emacsclient: error accessing server file "server"

Looking at the source, its not obvious what is going wrong - http://git.savannah.gnu.org/cgit/emacs.git/tree/lib-src/emacsclient.c?h=emacs-24#n1356

Any suggestions?

(I tried to recompile emacs and attach a gdb, but I didn't have much luck with that)

  • Which OS? Have you checked the permissions on the server file?
    – nanny
    Dec 8, 2014 at 13:45
  • OSX. Permissions are -rw-------, where I am the owner. What should the permissions be?
    – Job Evers
    Dec 8, 2014 at 16:52
  • I'm not sure if it's necessary, but mine is -rwx------.
    – nanny
    Dec 8, 2014 at 17:07

1 Answer 1


For a socket the permissions should be srwx------ - the s, meaning "socket" is the important part. (I also tried removing the executable bit, it didn't make a difference).

Since the permissions are -rw------- you are not using a socket. There are two ways to fix that, (1) make sure you are using a socket (2) tell emacsclient that it's not a socket.

(1) Make sure the value of server-use-tcp is nil (which happens to be the default). It has to be nil at the time you start the daemon, changing it later only serves to confuse you.

(2) Tell emacsclient to connect to a tcp file using emacsclient --server-file=SERVER.

I recommend the former.

Your Answer

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

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