Skip to content

RIG Fails when KAFKA_SCHEMA_REGISTRY_HOST not set and not running on localhost #202

@chadmott

Description

@chadmott

Summary and context

IF KAFKA_SCHEMA_REGISTRY_HOST is not set, RIG defaults to localhost if there is no schema registry running on localhost, RIG fails to proxy requests and restarts itself

How to reproduce

When I run RIG with these settings:

Run RIG w/o a schema registry

If you point to valid schema registry, it works.

Describe how your clients are set up, whether they connect via SSE or WS, etc.

..I see the following error and/or log output:

Add the log output to help us determine your problem. If possible, reproduce the problem after setting the environment variable LOG_LEVEL to debug.

** (exit) an exception was raised:
    ** (Protocol.UndefinedError) protocol String.Chars not implemented for {%MatchError{term: {:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}}, [{RigKafka.Avro, :__fetch_schema_memoize, 2, [file: 'lib/rig_kafka/avro.ex', line: 80]}, {Memoize.Cache, :do_get_or_run, 3, [file: 'lib/memoize/cache.ex', line: 107]}, {RigKafka.Avro, :decode, 2, [file: 'lib/rig_kafka/avro.ex', line: 20]}, {RigKafka.Client.GroupSubscriber, :handle_message, 4, [file: 'lib/rig_kafka/client.ex', line: 84]}, {:brod_group_subscriber, :handle_messages, 4, [file: 'src/brod_group_subscriber.erl', line: 540]}, {:brod_group_subscriber, :handle_info, 2, [file: 'src/brod_group_subscriber.erl', line: 333]}, {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 637]}, {:gen_server, :handle_msg, 6, [file: 'gen_server.erl', line: 711]}]}. This protocol is implemented for: Atom, BitString, Date, DateTime, Float, Integer, List, NaiveDateTime, Rig.Subscription, Time, URI, Version, Version.Requirement
        (elixir) /usr/local/src/elixir/lib/elixir/lib/string/chars.ex:3: String.Chars.impl_for!/1
        (elixir) /usr/local/src/elixir/lib/elixir/lib/string/chars.ex:22: String.Chars.to_string/1
        (logger) lib/logger/formatter.ex:166: anonymous fn/1 in Logger.Formatter.output/5
        (elixir) lib/enum.ex:1314: Enum."-map/2-lists^map/1-0-"/2
        (elixir) lib/enum.ex:1314: Enum."-map/2-lists^map/1-0-"/2
        (logger) lib/logger/formatter.ex:152: anonymous fn/6 in Logger.Formatter.format/5
        (elixir) lib/enum.ex:1925: Enum."-reduce/3-lists^foldl/2-0-"/3
        (logger) lib/logger/formatter.ex:151: Logger.Formatter.format/5

A clear and concise description of what you expected to happen.

Versions (please complete the following information):**

  • Host OS: RIG docker linux
  • Frontend node supertest
  • RIG version as shown on startup Master

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions