rschooley

rschooley

How can I debug issues using an erlang lib?

I am trying out rabbit streams but am having some issues using the Lake library.

I am getting a malformed error from inside the library:

[error] GenServer #PID<0.656.0> terminating
** (CaseClauseError) no case clause matching: {:error, {:malformed, <<65, 77, 81, 80, 0, 0, 9, 1>>}}
    (lake 0.1.2) /Users/me/projects/my-app/deps/lake/src/lake_raw_connection.erl:36: :lake_raw_connection.peer_properties/1
    (lake 0.1.2) /Users/me/projects/my-app/deps/lake/src/lake_raw_connection.erl:24: :lake_raw_connection.connect1/6
    (lake 0.1.2) /Users/me/projects/my-app/deps/lake/src/lake_raw_connection.erl:9: :lake_raw_connection.connect/6
    (lake 0.1.2) /Users/me/projects/my-app/deps/lake/src/lake_connection.erl:35: :lake_connection.connect/6
...

How do I decode this value to debug the issue? The value doesn’t look particularly long, is this even a useful error message? Is there another way I can troubleshoot this issue?

Calling code for background:

    result = :lake.connect(
      'localhost',
      5672,
      'guest',
      'guest',
      '/'
    )

I thought it might be an issue passing binaries/strings instead of char lists, but have tried <<"localhost">>, 'localhost', String.to_charlist("localhost"), etc but the called function arguments match so I don’t think it is that.

Marked As Solved

derek-zhou

derek-zhou

Look at the source. It says it received some data it cannot recognize. Are you sure you are using the right port (5672)?

Google tells me that 5672 is the RabbitMQ port and 5552 is the RabbitMQ Streaming port

Also Liked

al2o3cr

al2o3cr

This is the four characters AMQP followed by a version number - it’s the header from AMQP v0.9.1; that’s not the protocol that lake wants to speak.

+1 for @derek-zhou’s suggestion that the wrong port is being used.

Where Next?

Popular in Questions Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; someth...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement