zookeeper - [NIOServerCnxn@383] - Exception causing close of session 0x0: Len error 1195725856
Asked Answered
A

1

6

I am trying to insttall zookeeper in my Windows. I am getting the error bellow no matter which suggestion I followed in zookeeper + Kafka - Unable to create data directory.

I am running it as Administrator and I have tried all these options:

#dataDir=/tmp/zookeeper
#dataDir=:\zookeeper-3.4.14\
#dataDir=C:\\_d\\WSs\\kafka\\zookeeper-3.4.14\\data
#dataDir=:\\\\zookeeper\\\\data
dataDir=C:\\_d\\WSs\\kafka\\zookeeper-3.4.14

I don´t think it is relevant but let me add here: I have Java 11.

Any idea why it is happening will be appreciated.

Full logs

C:\Windows\system32>zkserver

C:\Windows\system32>call "C:\Program Files\Java\jdk-11.0.2"\bin\java "-Dzookeeper.log.dir=C:\_d\WSs\kafka\zookeeper-3.4.14\bin\.." "-Dzookeeper.root.logger=INFO,CONSOLE" -cp "C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\build\classes;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\build\lib\*;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\*;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\lib\*;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\conf\zoo.cfg"
2019-04-18 15:17:42,629 [myid:] - INFO  [main:QuorumPeerConfig@136] - Reading configuration from: C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\conf\zoo.cfg
2019-04-18 15:17:42,644 [myid:] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2019-04-18 15:17:42,644 [myid:] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2019-04-18 15:17:42,644 [myid:] - INFO  [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2019-04-18 15:17:42,644 [myid:] - WARN  [main:QuorumPeerMain@116] - Either no config or no quorum defined in config, running  in standalone mode
2019-04-18 15:17:42,769 [myid:] - INFO  [main:QuorumPeerConfig@136] - Reading configuration from: C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\conf\zoo.cfg
2019-04-18 15:17:42,769 [myid:] - INFO  [main:ZooKeeperServerMain@98] - Starting server
2019-04-18 15:17:47,344 [myid:] - INFO  [main:Environment@100] - Server environment:zookeeper.version=3.4.14-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on 03/06/2019 16:18 GMT
2019-04-18 15:17:47,344 [myid:] - INFO  [main:Environment@100] - Server environment:host.name=DESKTOP-AKCNE7F
2019-04-18 15:17:47,344 [myid:] - INFO  [main:Environment@100] - Server environment:java.version=11.0.2
2019-04-18 15:17:47,344 [myid:] - INFO  [main:Environment@100] - Server environment:java.vendor=Oracle Corporation
2019-04-18 15:17:47,344 [myid:] - INFO  [main:Environment@100] - Server environment:java.home=C:\Program Files\Java\jdk-11.0.2
2019-04-18 15:17:47,344 [myid:] - INFO  [main:Environment@100] - Server environment:java.class.path=C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\build\classes;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\build\lib\*;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\zookeeper-3.4.14.jar;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\lib\audience-annotations-0.5.0.jar;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\lib\jline-0.9.94.jar;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\lib\log4j-1.2.17.jar;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\lib\netty-3.10.6.Final.jar;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\lib\slf4j-api-1.7.25.jar;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\lib\slf4j-log4j12-1.7.25.jar;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\..\conf
2019-04-18 15:17:47,344 [myid:] - INFO  [main:Environment@100] - Server environment:java.library.path=C:\Program Files\Java\jdk-11.0.2\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Java\jdk-11.0.2\bin;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\_d\tools\apache-maven-3.6.0\bin;C:\_d\WSs\kafka\zookeeper-3.4.14\bin\;C:\Users\jimis\AppData\Local\Programs\Python\Python37-32\Scripts\;C:\Users\jimis\AppData\Local\Programs\Python\Python37-32\;C:\Users\jimis\AppData\Local\Microsoft\WindowsApps;.
2019-04-18 15:17:47,360 [myid:] - INFO  [main:Environment@100] - Server environment:java.io.tmpdir=C:\Users\jimis\AppData\Local\Temp\
2019-04-18 15:17:47,360 [myid:] - INFO  [main:Environment@100] - Server environment:java.compiler=<NA>
2019-04-18 15:17:47,360 [myid:] - INFO  [main:Environment@100] - Server environment:os.name=Windows 10
2019-04-18 15:17:47,360 [myid:] - INFO  [main:Environment@100] - Server environment:os.arch=amd64
2019-04-18 15:17:47,376 [myid:] - INFO  [main:Environment@100] - Server environment:os.version=10.0
2019-04-18 15:17:47,376 [myid:] - INFO  [main:Environment@100] - Server environment:user.name=jimis
2019-04-18 15:17:47,376 [myid:] - INFO  [main:Environment@100] - Server environment:user.home=C:\Users\jimis
2019-04-18 15:17:47,376 [myid:] - INFO  [main:Environment@100] - Server environment:user.dir=C:\Windows\system32
2019-04-18 15:17:47,391 [myid:] - INFO  [main:ZooKeeperServer@836] - tickTime set to 2000
2019-04-18 15:17:47,391 [myid:] - INFO  [main:ZooKeeperServer@845] - minSessionTimeout set to -1
2019-04-18 15:17:47,391 [myid:] - INFO  [main:ZooKeeperServer@854] - maxSessionTimeout set to -1
2019-04-18 15:17:47,782 [myid:] - INFO  [main:ServerCnxnFactory@117] - Using org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory
2019-04-18 15:17:47,797 [myid:] - INFO  [main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:2181
2019-04-18 15:18:00,365 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@222] - Accepted socket connection from /127.0.0.1:54057
2019-04-18 15:18:00,375 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@222] - Accepted socket connection from /127.0.0.1:54058
2019-04-18 15:18:00,378 [myid:] - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@383] - Exception causing close of session 0x0: Len error 1195725856
2019-04-18 15:18:00,379 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1056] - Closed socket connection for client /127.0.0.1:54057 (no session established for client)

*** Edited

enter image description here

*** edited

enter image description here

*** The answer to my question is "you can ignore the fact that I get an error while curl 127.0.0.1:port. Kafka is working anyway.

enter image description here

Androclinium answered 18/4, 2019 at 18:27 Comment(0)
F
10

Are you trying to do a "HTTP GET" against the zookeeper client port?

So the error comes from NIOServerCnxn.java:readLength which is expecting either a 4-letter command or buffer where the first 4 bytes represent size.

The number 1195725856 in hex is 0x47455420 which is "GET " in ASCII.

So the error message is caused when you try to do a HTTP GET" against the 2181 port.

$ curl http://0.0.0.0:2181/
curl: (52) Empty reply from server
$ sudo tail /var/log/zookeeper/zookeeper.out
...
2019-04-19 12:56:25,303 [myid:3] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@215] - Accepted 
2019-04-19 12:56:25,304 [myid:3] - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@383] - Exception causing close of session 0x0: Len error 1195725856
2019-04-19 12:56:25,304 [myid:3] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1040] - Closed socket connection for client /127.0.0.1:33011 (no session established for client)

This WARN message is safe to ignore since ZooKeeper will just close that client session which is implied by the curl response.

Forecast answered 19/4, 2019 at 20:6 Comment(7)
I checked throw netstat -anp | find ":"2181" and I can see the port is free. I added the logs in my original question above. Are you aware about any possible conflict with Hiperr-V? I have a lap top provided by my company and I can't install Docker because there is some conflict with Citrix Receivere used and which I can't turn off. Well, I am mentioning my issue with Docker in case it can ring a bell in your mind about any possible issue with Zookeepr also. Does Zookeeper depends on some virtualization behind the scene?Androclinium
I haven't used Docker or the Citrix software so I can't help in regards to that. ZooKeeper is just a multi-threaded Java application. No virtualization that I'm aware of.Forecast
well, since you reproduced my issue, what do you suggest I am check around? PS. the port numberr is freeAndroclinium
The errror does not mean that ZooKeeper is not working. It just says the wrong command was attempted. Try echo stat | nc 127.0.0.1 2181 on you host to see if your ZooKeeper is working.Forecast
I added a print screen which shows two cmd windows: 1 - I started Zookeeper and (2) another I pinged it via netcat. Does it mean something usefull to you? Honestly all I want is install Kafka.Do you know if I can ignore the fact that I can get it via curl and go forward?Androclinium
Your stat shows ZooKeeper is working so I'm pretty sure you can ignore it. I probably wasn't clear enough if my answer.Forecast
You are 100% right. I started Kafka and I did a simple test and it is working. I will add it here for future readers.Androclinium

© 2022 - 2024 — McMap. All rights reserved.