node-redis icon indicating copy to clipboard operation
node-redis copied to clipboard

do you assume root access to run unix_socket tests ?

Open smartmouse opened this issue 12 years ago • 6 comments

redis-server version Redis 2.8.17 (00000000/0) 64 bit

node version 10.3.3

The unix_socket tests var unixClient = redis.createClient('/tmp/redis.sock');

// if this fails, check the permission of unix socket.
// unixsocket /tmp/redis.sock
// unixsocketperm 777

This test failed consistently on all our machines -- we do not have sudo access or root access on our account, looks like we cannot create /tmp/redis.sock.

Just want to confirm if this is a truly authority issue on our machine? or something else?

Is it possible we modify it to a different location e.g. /home/user1/redis.sock so that we have access to the location? Are there any other places we need to fix up if such a change is made?

I actually tried using root on one of the machine, it still failed. (Most other machine , we do not have root access.)

Failure:

Using reply parser javascript

  • unix_socket:client: Error: Redis connection to /tmp/redis.sock failed - connect ENOENT at RedisClient.on_error (/root/test/node_redis/index.js:196:24) at Socket. (/root/test/node_redis/index.js:106:14) at Socket.emit (events.js:95:17) at net.js:440:14 at process._tickCallback (node.js:419:13) Uncaught exception: AssertionError: true == false at process. (/root/test/node_redis/test.js:2272:12) at process.emit (events.js:95:17) at process.exit (node.js:711:17) at RedisClient. (/root/test/node_redis/test.js:188:17) at RedisClient.emit (events.js:95:17) at RedisClient.on_error (/root/test/node_redis/index.js:196:10) at Socket. (/root/testnode_redis/index.js:106:14) at Socket.emit (events.js:95:17) at net.js:440:14 at process._tickCallback (node.js:419:13)

Thank you for your help in advance.

smartmouse avatar Nov 12 '14 23:11 smartmouse

I ran into the same problem as well. Would appreciate some feedback too!

rubentlz avatar Dec 08 '14 07:12 rubentlz

I also run into that problem.

mariecl avatar Dec 09 '14 18:12 mariecl

You can avoid this problem by starting redis-server with --unixsocket /tmp/redis.sock --unixsocketperm 755. Hope that helps.

mkohlmyr avatar Mar 04 '15 11:03 mkohlmyr

Same machine -same user account --redis server If I start the redis server on a machine with the option you suggested on the same user account, then run the test on the same user account, it worked now.

Same machine - Different user account However, if I use another user account (not the one that started redis server) and run the test, it failed with some permission issue. Is there another config we need to set up? or it is by-designed that the test has to be run in account where redis-server is started?
It only make sense to have one redis-server per machine and not per account.
Something probably is missing my account configurations. Thank you in advance for your insight.

Using reply parser javascript util.print: Use console.log instead

  • ipv6:Skipping IPV6 for old Redis server version < 2.8.0 util.print: Use console.log instead
  • unix_socket:client: Error: Redis connection to /tmp/redis.sock failed - connect EACCES at RedisClient.on_error (/home/test/node_modules/node_redis/index.js:196:24) at Socket. (/home/test/node_modules/node_redis/index.js:106:14) at Socket.emit (events.js:107:17) at net.js:451:14 at process._tickCallback (node.js:355:11) Uncaught exception: AssertionError: true == false at process. (/home/test/node_modules/node_redis/test.js:2283:12) at process.emit (events.js:107:17) at process.exit (node.js:600:17) at RedisClient. (/home/test/node_modules/node_redis/test.js:188:17) at RedisClient.emit (events.js:107:17) at RedisClient.on_error (/home/nodebot1/testIvy/node_modules/node_redis/index.js:196:10) at Socket. (/home/nodebot1/testIvy/node_modules/node_redis/index.js:106:14) at Socket.emit (events.js:107:17) at net.js:451:14 at process._tickCallback (node.js:355:11) npm ERR! Test failed. See above for more details. [nodebot1@jtcjs05 node_redis]$

smartmouse avatar Mar 05 '15 14:03 smartmouse

I think we will need to do a unixsocketperm 777 to make it work.

smartmouse avatar Mar 05 '15 15:03 smartmouse

Thank you so much for your resolution and it worked now and we can close this.

smartmouse avatar Mar 05 '15 15:03 smartmouse