tporadowski / redis

Native port of Redis for Windows. Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs. This repository contains unofficial port of Redis to Windows.
http://redis.io
Other
9.03k stars 1.1k forks source link

Could not create server TCP listening socket *:6379: on windows #119

Closed sailaoda closed 3 years ago

sailaoda commented 3 years ago

Describe the bug/issue Hi, excuse me It happened some wrong on my redis on windows11/10. I can sure it's nothing to do with Redis version. I have tried the redis.zip and the redis.msi , also tried the version Redis 5.0.10 for Windows and Redis 5.0.14 for Windows which released yesterday. The redis-cli is good , and I can use it to connect my cloud server. About the redis-server , I tried some different .conf ,and changed my local computer server Redis from Internet service to Local system . When I want to start the redis server ,it will be 1067 err. image When I want to start it from the cmd: it was the next:

just like 
Could not create server TCP listening socket 0.0.0.0:6379: bind: 操作成功完成。
Invalid argument during startup: Failed to open the .conf file: redis.windows-server.conf CWD=C:\Redis
Could not create server TCP listening socket 127.0.0.1:6379: bind: 存储控制块地址无效。
PS C:\Redis> redis-server
[1484] 18 Oct 09:55:33.843 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
[1484] 18 Oct 09:55:33.843 # Redis version=5.0.14, bits=64, commit=a7c01ef4, modified=0, pid=1484, just started
[1484] 18 Oct 09:55:33.843 # Warning: no config file specified, using the default config. In order to specify a config file use c:\redis\redis-server.exe /path/to/redis.conf
[1484] 18 Oct 09:55:33.846 # Could not create server TCP listening socket *:6379: bind: 在一个非套接字上尝试了一个操作。
PS C:\Redis> redis-server redis.windows.conf
[39536] 18 Oct 09:55:45.737 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
[39536] 18 Oct 09:55:45.737 # Redis version=5.0.14, bits=64, commit=a7c01ef4, modified=0, pid=39536, just started
[39536] 18 Oct 09:55:45.737 # Configuration loaded
[39536] 18 Oct 09:55:45.739 # Could not create server TCP listening socket 127.0.0.1:6379: bind: 操作成功完成。
PS C:\Redis> redis-server redis.windows-server.conf
Invalid argument during startup: Failed to open the .conf file: redis.windows-server.conf CWD=C:\Redis
PS C:\Redis> netsh int ipv6 show excludedportrange tcp

协议 tcp 端口排除范围

开始端口    结束端口
----------    --------
      1838        1937
      4834        4933
      4934        5033
      5057        5156
      5208        5307
      6292        6391
     50000       50059     *

* - 管理的端口排除。

PS C:\Redis> redis-server redis.windows.conf
[36580] 18 Oct 10:02:18.141 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
[36580] 18 Oct 10:02:18.141 # Redis version=5.0.14, bits=64, commit=a7c01ef4, modified=0, pid=36580, just started
[36580] 18 Oct 10:02:18.141 # Configuration loaded
[36580] 18 Oct 10:02:18.145 # Could not create server TCP listening socket 0.0.0.0:6379: bind: 操作成功完成。
PS C:\Redis> redis-server redis.windows-server.conf
Invalid argument during startup: Failed to open the .conf file: redis.windows-server.conf CWD=C:\Redis

Event Log image

some Log like this: syslog-ident = redis Invalid argument during startup: Failed to open the .conf file: redis.windows-server.conf CWD=C:\Redis image syslog-ident = redis Could not create server TCP listening socket 127.0.0.1:6379: bind: 存储控制块地址无效。 ... and so on

Additional context It may not a bug , because it did well yesterday.(redis-server) My 6379 port is free but cannot use to run redis-server. But when I change port to another port like 16379 , it will be work . image I would be very grateful if you can let me know the reason for these errors.

Best Wishes,

tporadowski commented 3 years ago

I tested the above, but all worked fine for me - starting with redis.windows-service.conf argument, etc. Could there be an old process running still bound to port 6379? And what about ipv4 excluded ports? (I can see you pasted ipv6 above)

sailaoda commented 3 years ago

I tested the above, but all worked fine for me - starting with redis.windows-service.conf argument, etc. Could there be an old process running still bound to port 6379? And what about ipv4 excluded ports? (I can see you pasted ipv6 above)

Thank you very much! This problem finilly solved. It may be caused by "Could there be an old process running still bound to port 6379?" as you say.

I found two servers about Redis like this : image

When I delect the last one server "Redis for Windows , based ..... " , then it worked. image

It maybe have happened some conflict on it.

Thank you for your reply ! Best wishes, 👍 👍 👍