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

"0.1.6" - no function clause matching in Nats.Connection.send_packet/2 #47

Closed
ajose01 opened this issue Oct 11, 2018 · 7 comments
Closed

Comments

@ajose01
Copy link

ajose01 commented Oct 11, 2018

I've been scratching my head on this now for a few... tried both with a remote nats and a localhost nats, same error:

23:00:32.175 [error] GenServer #PID<6858.5843.0> terminating
** (FunctionClauseError) no function clause matching in Nats.Connection.send_packet/2
    lib/nats/connection.ex:169: Nats.Connection.send_packet({:write_flush, {:msg, 108, "CONNECT {\"lang\": \"elixir\", \"name\": \"elixir-nats\", \"pedantic\": false, \"verbose\": false, \"version\": \"0.1.4\"}\r\n"}, true, {:packet_flushed, #PID<6858.5843.0>, #Reference<6858.2267846929.1015021569.234781>}}, %{ack_ref: #Reference<6858.2267846929.1015021569.234781>, close_fn: &:gen_tcp.close/1, make_active: true, opts: %{auth: %{}, host: "172.17.0.2", port: 4222, socket_opts: [:binary, {:active, :once}], ssl_opts: [], timeout: 5000, tls_required: false, verbose: false}, ps: nil, send_fn: &:gen_tcp.send/2, sep_writer: true, sock: #Port<6858.1958>, state: :ack_connect, worker: #PID<6858.5842.0>, writer_pid: nil})
    lib/nats/connection.ex:350: Nats.Connection.nats_info/2
    lib/nats/connection.ex:284: Nats.Connection.handle_packet/2
    lib/nats/connection.ex:270: Nats.Connection.transport_input/2
    (stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:711: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Any thoughts?

@aby2503
Copy link

aby2503 commented Oct 12, 2018

I've been scratching my head on this now for a few... tried both with a remote nats and a localhost nats, same error:

23:00:32.175 [error] GenServer #PID<6858.5843.0> terminating
** (FunctionClauseError) no function clause matching in Nats.Connection.send_packet/2
    lib/nats/connection.ex:169: Nats.Connection.send_packet({:write_flush, {:msg, 108, "CONNECT {\"lang\": \"elixir\", \"name\": \"elixir-nats\", \"pedantic\": false, \"verbose\": false, \"version\": \"0.1.4\"}\r\n"}, true, {:packet_flushed, #PID<6858.5843.0>, #Reference<6858.2267846929.1015021569.234781>}}, %{ack_ref: #Reference<6858.2267846929.1015021569.234781>, close_fn: &:gen_tcp.close/1, make_active: true, opts: %{auth: %{}, host: "172.17.0.2", port: 4222, socket_opts: [:binary, {:active, :once}], ssl_opts: [], timeout: 5000, tls_required: false, verbose: false}, ps: nil, send_fn: &:gen_tcp.send/2, sep_writer: true, sock: #Port<6858.1958>, state: :ack_connect, worker: #PID<6858.5842.0>, writer_pid: nil})
    lib/nats/connection.ex:350: Nats.Connection.nats_info/2
    lib/nats/connection.ex:284: Nats.Connection.handle_packet/2
    lib/nats/connection.ex:270: Nats.Connection.transport_input/2
    (stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:711: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Any thoughts?

I had similar error, when updated elixir to 1.7 and erlang to 21 OTP. Try to downgrade versions

@aby2503
Copy link

aby2503 commented Oct 12, 2018

Especially, try to use erlang esl-erlang_20.3-1 and elixir elixir_1.6.6-1

@ryancurtin
Copy link

@ajose01 - I had a chance to look at this today and created a fork with what I believe to be a working version. I ran the code through the formatter so it may be hard to pick up exactly what I changed, but the gist of it is in the following lines:

Basically, there were a bunch of unsafe variables set inside of if blocks / case statements. Once I've verified everything's working correctly I'll add a PR here.

@aby2503
Copy link

aby2503 commented Dec 14, 2018

@ajose01 - I had a chance to look at this today and created a fork with what I believe to be a working version. I ran the code through the formatter so it may be hard to pick up exactly what I changed, but the gist of it is in the following lines:

Basically, there were a bunch of unsafe variables set inside of if blocks / case statements. Once I've verified everything's working correctly I'll add a PR here.

Hello, is the final far ?

@ryancurtin
Copy link

I'll try to get a PR over the weekend - no guarantees for when they merge it though!

@ryancurtin
Copy link

@aby2503 - PR is here

@ColinSullivan1
Copy link
Member

Thank you all for using NATS! Note that this client has largely been unmaintained and so has been deprecated. Moving forward we suggest you migrate to the nats.ex client which will be actively maintained. We'll keep this repository public in case you'd prefer to make a copy to maintain yourselves, but hope you'll have a good experience with the new client. We sincerely apologize for the inconvenience.

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

4 participants