Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserializer error. Seems to be trying to deserialize not serialized data #433

Open
hairyhum opened this issue Feb 1, 2021 · 1 comment

Comments

@hairyhum
Copy link
Contributor

hairyhum commented Feb 1, 2021

I'm occasionally getting the following error on my test servers when starting consumer group manager:

{:error, 
  {
    %RuntimeError{
      message: "Parse error during %Kayrock.ApiVersions.V0.Request{client_id: \"kafka_ex\", correlation_id: 0} response deserializer. Couldn't parse: [%KafkaEx.New.Broker{host: \"<edited>\", node_id: nil, port: 9095, rack: nil, socket: %KafkaEx.Socket{socket: #Port<0.186745>, ssl: false}}]"
    },
    [
      {Kayrock.ApiVersions.V0.Response, :deserialize, 1, [file: 'lib/generated/api_versions.ex', line: 201]}, 
      {KafkaEx.New.Client, :deserialize, 2, [file: 'lib/kafka_ex/new/client.ex', line: 668]}, 
      {KafkaEx.New.Client, :run_client_request, 3, [file: 'lib/kafka_ex/new/client.ex', line: 566]}, 
      {KafkaEx.New.Client, :kayrock_network_request, 4, [file: 'lib/kafka_ex/new/client.ex', line: 541]}, 
      {KafkaEx.New.Client, :get_api_versions, 2, [file: 'lib/kafka_ex/new/client.ex', line: 506]}, 
      {KafkaEx.New.Client, :init, 1, [file: 'lib/kafka_ex/new/client.ex', line: 107]}, 
      {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 365]}, 
      {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 333]}]}}

It seems like it's trying to deserialize already deserialized data.

No idea what could cause that and it goes away mysteriously. But retries don't seem to help.

Any ideas on what could be the reason?

I'm using version 0.11.0 with erlang 20, elixir 1.6.5

@dsienkiewicz
Copy link

I'm having similar issue, not able to mix phx.server nor iex -S mix.
The app is crashing with stack trace:

** (Mix) Could not start application kafka_ex: KafkaEx.start(:normal, []) returned an error: an exception was raised:
    ** (RuntimeError) Parse error during %Kayrock.ApiVersions.V0.Request{client_id: "<edited>", correlation_id: 0} response deserializer. Couldn't parse: [%KafkaEx.New.Broker{host: "localhost", node_id: nil, port: 9092, rack: nil, socket: %KafkaEx.Socket{socket: #Port<0.8>, ssl: false}}]
        (kayrock 0.1.15) lib/generated/api_versions.ex:201: Kayrock.ApiVersions.V0.Response.deserialize/1
        (kafka_ex 0.12.1) lib/kafka_ex/new/client.ex:668: KafkaEx.New.Client.deserialize/2
        (kafka_ex 0.12.1) lib/kafka_ex/new/client.ex:566: KafkaEx.New.Client.run_client_request/3
        (kafka_ex 0.12.1) lib/kafka_ex/new/client.ex:541: KafkaEx.New.Client.kayrock_network_request/4
        (kafka_ex 0.12.1) lib/kafka_ex/new/client.ex:506: KafkaEx.New.Client.get_api_versions/2
        (kafka_ex 0.12.1) lib/kafka_ex/new/client.ex:107: KafkaEx.New.Client.init/1
        (stdlib 4.0.1) gen_server.erl:848: :gen_server.init_it/2
        (stdlib 4.0.1) gen_server.erl:811: :gen_server.init_it/6
        (stdlib 4.0.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

My setup is:
Erlang version:

erl --version
Erlang/OTP 25 [erts-13.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Eshell V13.0.3  (abort with ^G)

Elixir version:

elixir --version
Erlang/OTP 25 [erts-13.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Elixir 1.13.4 (compiled with Erlang/OTP 25)

Issue is not visible if I'm configuring in config/config.ex as kafka_version: "7.0.1". It's happening only if I have kafka_version: "kayrock".

To be clear, that's my docker-compose.yml for starting dependencies:

version: "2"

services:
  zookeeper:
    image: confluentinc/cp-zookeeper:latest.arm64
    container_name: zookeeper
    ports:
      - "2181:2181"
    environment:
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_TICK_TIME: 2000

  kafka-1:
    image: confluentinc/cp-kafka:latest.arm64
    container_name: kafka-1
    ports:
      - "9092:9092"
    depends_on:
      - zookeeper
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_LISTENERS: PLAINTEXT://kafka-1:29092,PLAINTEXT_HOST://localhost:9092
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-1:29092,PLAINTEXT_HOST://localhost:9092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
      KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
      KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants