1

I have written an app which connect to an already created unix.sock file and get some data from it. But I am getting EACCES error while try to connect. Error message is given below.

{ Error: connect EACCES /home/unix.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
  errno: 'EACCES',
  code: 'EACCES',
  syscall: 'connect',
  address: '/home/unix.sock' }

code snippet.

var socket = net.createConnection("/home/unix.sock")
          .on("connect", function() {
            console.log("Connected");
            socket.write(req1);
            socket.write(req2);
          })
          .on("data", function (data) {
            data = JSON.parse(data);
            console.log("Response from server: %s", data.response);
            // Close the connection
            socket.end();
          })
          .on('error', function(data) {
            console.log(data);
          })

Any idea about why this error occurs? I think it is because of the non root container. Is there anyway I can get rid of this error with non root container?

3
  • Please check Sockets Error mentioned here. Also this Commented Jul 28, 2020 at 10:20
  • 1
    What's on the server side of the socket? How does it get into the container filesystem? What are its permissions, and are they compatible with the user the process is running as? Commented Jul 28, 2020 at 10:34
  • Bindmounting the volume. I mounted the path which have the socket to /home/ folder Commented Jul 28, 2020 at 16:02

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.