Unexpected packet from server localhost:9000, ::1
Asked Answered
G

4

6

I have installed clickhouse as per the instructions here https://github.com/Altinity/clickhouse-rpm-install.

I have also enabled :: in /etc/clickhouse-server/config.xml.

It started fine as below:

sudo /etc/init.d/clickhouse-server restart Start clickhouse-server service: Path to data directory in /etc/clickhouse-server/config.xml: /var/lib/clickhouse/ DONE

But, when i start client it fails as below:

sudo clickhouse-client ClickHouse client version 1.1.54383. Connecting to localhost:9000. Code: 102. DB::NetException: Unexpected packet from server localhost:9000, ::1 (expected Hello or Exception, got Unknown packet)

Gris answered 23/5, 2018 at 14:8 Comment(0)
G
0

I had to change port in /etc/clickhouse-server/config.xml and pass it as a parameter when launching client as below:

clickhouse-client --port 9011

Gris answered 25/5, 2018 at 16:44 Comment(0)
C
2

Having the following error:

Code: 102. DB::NetException: Unexpected packet from server localhost:9000, ::1 (expected Hello or Exception, got Unknown packet)

means that clickhouse-client got an answer, but an incorrect one, which means that another software (not ClickHouse) is listening on localhost:9000 Highly likely it is php-fpm, because it also has port 9000 as a default one.

You can check what software is listening on port 9000 with the following command:

sudo netstat -antp|grep LIST|grep 9000

As a solution too the issue, you can do something like:

  • change port to listen to for clickhouse
  • change port to listen to for the software, which is currently listening on port 9000
  • shutdown software, which is currently listening on port 9000
Cabinetmaker answered 2/6, 2018 at 10:32 Comment(0)
P
1

I had to add user name default when connecting to clickhouse.

Pteranodon answered 31/5, 2023 at 2:55 Comment(0)
G
0

I had to change port in /etc/clickhouse-server/config.xml and pass it as a parameter when launching client as below:

clickhouse-client --port 9011

Gris answered 25/5, 2018 at 16:44 Comment(0)
F
0

I had the same error when mixing https://clickhouse-driver.readthedocs.io/en/latest/quickstart.html#streaming-results with other queries.

It has nothing to do with other services listening on the same port.

Faubion answered 25/1, 2023 at 20:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.