Can't bind TCP listener *:6379 using Redis on Windows
Asked Answered
A

11

65

I'm using Redis 2.8 on Windows which I downloaded from github release. After unzip and I've set maxheap in redis.windows.conf file. After running redis-server redis.windows.conf I get # Creating Server TCP listening socket *:6379:No such file or directory, but redis is not running correctly. I don't know why.

Adenocarcinoma answered 2/8, 2015 at 6:13 Comment(4)
Now service is normally.I run redis-cli.exe in the same window,and it connect correctly.Then I typed shutdown,the service is over.Reopen a command windows,type redis-server.The service run correctly.But I still did not understand why # Creating Server TCP listening socket *:6379:No such file or directory came out.Adenocarcinoma
I ran into the same problem this morning on Win 2008 R2. Your comment worked so you should post and accept it as the answer :)Rovit
@verbumSapienti OK,I'll post the answer.Adenocarcinoma
you can accept it with the tick to the left of the answerRovit
A
27

Now service is normally.I run redis-cli.exe in the same window,and it connect correctly.Then I typed shutdown,the service is over.Reopen a command windows,type redis-server.The service run correctly.But I still did not understand why # Creating Server TCP listening socket *:6379:No such file or directory came out.

Adenocarcinoma answered 19/8, 2015 at 8:27 Comment(2)
nope. When I run redis-cli.exe, I see a black screen. Can't even type. So change the port to 6380 and it worked !Vipul
"But I still did not understand why # Creating Server TCP listening socket *:6379:No such file or directory came out." - because you had a Redis server running as a windows service. Your shutdown command stopped it. Alternatively you can go into Computer Management > Services and Applications > Services and stop Redis and set it to not start automatically at startup.Tijuana
T
104

You must've used the .msi installer. It automagically registers a windows service which starts instantly after the installation (at least on my win 10 machine).

This service uses the default config and binds to port 6379. When you start redis-server from the command line, if you haven't specified a different port through a config file, it picks up the default config again and tries to bind to port 6379 which fails.

Your cli works because it connects to the redis service that's already listening on 6379. Your shutdown command stops the service and from there things work as expected. Mystery solved. Case closed.

Tijuana answered 9/12, 2015 at 19:52 Comment(5)
perfect answer.Jackquelinejackrabbit
Perfect answer!Proudhon
That's nice to hear from a SexyBeast. My life is complete ;)Tijuana
If you want to completely remove running Redis as a service, on windows: Windows key (Run) > Regedit > "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Redis" > right mouse click > deleteCissie
Great answer! This helped alot. I thought there was a problem but turns out it isn't a problem. Just needed to know this.Spermatid
B
79

cdto the bin directory of Redis, and run

  1. redis-cli.exe
  2. shutdown
  3. exit

open another cmd window, cd to the bin directory of Redis, and run

4.redis-server.exe

Befuddle answered 1/8, 2017 at 7:30 Comment(4)
A few words of explanation would make this more helpful.Fiester
You are an angel. Thank you!Armored
It worked even if it said that server was not runningAkimbo
Thanks! Worked like a charmSociopath
A
27

Now service is normally.I run redis-cli.exe in the same window,and it connect correctly.Then I typed shutdown,the service is over.Reopen a command windows,type redis-server.The service run correctly.But I still did not understand why # Creating Server TCP listening socket *:6379:No such file or directory came out.

Adenocarcinoma answered 19/8, 2015 at 8:27 Comment(2)
nope. When I run redis-cli.exe, I see a black screen. Can't even type. So change the port to 6380 and it worked !Vipul
"But I still did not understand why # Creating Server TCP listening socket *:6379:No such file or directory came out." - because you had a Redis server running as a windows service. Your shutdown command stopped it. Alternatively you can go into Computer Management > Services and Applications > Services and stop Redis and set it to not start automatically at startup.Tijuana
C
10

We had a similar/related "redis-server.exe" service hosting issue.

After installing the Redis Windows Service, we could access the service on port 6379 locally, but not from a remote client (even though the firewall was configured to allow inbound traffic on the port).

In order to resolve the issue, we had to edit the redis.windows-service.conf configuration file and change the following:

  • bind 127.0.0.1 needed use the actual IP address
  • protected-mode yes needed to be set to "no"

After making the above changes, we restarted the Redis service and were able to connect from all clients.

Carincarina answered 20/10, 2016 at 21:15 Comment(1)
This solved my problem. This probably is the answer if: everything (including firewall, server, etc) is configure properly, and accessible from same host, but not from other host.Krouse
B
9

Its simple and works for me nice: -open redis-cli (default in C:\Program Files\Redis) and run this command:

shutdown

Finished.

now open cmd and try redis-server again.

I know its a little late for answering but because maybe others faced this problem later I answered it.

Burlie answered 22/6, 2021 at 4:12 Comment(0)
E
3

After getting this error,open the cli and press the command 'shutdown' and restart redis server. You are good to go. You will get the logo and everything is as expected.

Entirety answered 26/3, 2016 at 21:4 Comment(0)
M
2
  1. check the port(if something else is using redis port)
  2. use redis-server xxx.conf to run a server with your configuration
  3. try to use redis-cli
  4. check redis issues(https://github.com/ServiceStack/redis-windows/wiki/Issues-might-happen)

    C:\redis>redis-server.exe --service-install [8124] 03 Feb 23:58:14.573 # HandleServiceCommands: system error caught. error c ode=1073, message = CreateService failed: unknown error

    C:\redis>redis-server --service-install redis.windows.conf --loglevel verbose [10848] 04 Feb 00:00:40.508 # HandleServiceCommands: system error caught. error code=1073, message = CreateService failed: unknown error

    C:\redis>redis-server --service-install -–service-name redisService1 –port 100 01 Failed to open the .conf file: 10001 CWD=C:\redis

    C:\redis>redis-server --service-install redis.windows.conf -–service-name redis Service1 –port 10001 Failed to open the .conf file: 10001 CWD=C:\redis

    C:\redis>redis-server --service-install redis.windows.conf -–service-name redis Service1 –port 10001 Failed to open the .conf file: 10001 CWD=C:\redis

    C:\redis>redis-server --service-install C:\redis\redis.windows.conf -–service-n ame redisService1 –port 10001 Failed to open the .conf file: 10001 CWD=C:\redis

    C:\redis>redis-server --service-install C:\redis\redis.windows.conf -–service-n ame redisService1 –port 10001 Failed to open the .conf file: 10001 CWD=C:\redis

    C:\redis>redis-server --service-install redis.windows.conf -–service-name redis Service1 –port 10001 Failed to open the .conf file: 10001 CWD=C:\redis

    C:\redis> C:\redis>redis-server --service-install redis.windows.conf -–service-name redis Service1 –port 10001 Failed to open the .conf file: 10001 CWD=C:\redis

    C:\redis>redis-server --service-install redis.windows.conf --loglevel verbose [11572] 04 Feb 00:03:34.847 # HandleServiceCommands: system error caught. error code=1073, message = CreateService failed: unknown error

    C:\redis>redis-server --service-install redis.windows.conf --loglevel verbose -- service-name redisService [7484] 04 Feb 00:03:53.610 # Granting read/write access to 'NT AUTHORITY\Network Service' on: "C:\redis" "C:\redis" [7484] 04 Feb 00:03:53.612 # Redis successfully installed as a service.

Monotheism answered 19/10, 2017 at 5:15 Comment(0)
C
-1

Got the same behavior after restart. Initially thought Redis is not running, but your question made me to dig some more. Apparently, there's Windows service, called "Redis" and it started after computer reboot.

Cytologist answered 16/10, 2015 at 7:50 Comment(0)
K
-1

I just got the same error message, but the root cause was different: I copied the config file over from a different machine, but it contained a "bind" entry containing an IP address, which - for sure - was invalid for the new machine, i.e. bind 234.234.234.234

I changed it to the correct address and it was working as expected.

Knop answered 1/2, 2016 at 12:34 Comment(0)
G
-1

As @FeigMan said you must've used the .msi installer. It automagically registers a windows service which starts instantly after the installation.

I was getting below error:

[15052] 10 Apr 14:40:14.601 # Creating Server TCP listening socket *:6379: listen: Unknown error

If service is already running you will get above error.
As per need you can restart service by below commands:

redis-server --service-stop
redis-server --service-start

Grandiloquent answered 10/4, 2017 at 9:29 Comment(0)
A
-1

For windows after installing using windows installer. So Check if your Redis server is already up and running. check by going to redis-cli

redis-cli 127.0.0.1:6379>

Ademption answered 5/6, 2021 at 12:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.