Comments (8)
I ran into this same issue. In my case opening a connection when the port is a string caused this error
configs = [username: "guest", password: "guest", host: "localhost", port: "5673"]
AMQP.Connection.open(configs)
** (FunctionClauseError) no function clause matching in :amqp_gen_connection.terminate/2
(amqp_client) /Users/bmrsny/Projects/rolodex/deps/amqp_client/src/amqp_gen_connection.erl:239: :amqp_gen_connection.terminate({:function_clause, [{:inet_tcp, :getserv, ["5673"], [file: 'inet_tcp.erl', line: 55]}, {:gen_tcp, :connect1, 4, [file: 'gen_tcp.erl', line: 158]}, {:gen_tcp, :connect, 4, [file: 'gen_tcp.erl', line: 145]}, {:amqp_network_connection, :do_connect, 4, [file: '/Users/bmrsny/Projects/rolodex/deps/amqp_client/src/amqp_network_connection.erl', line: 132]}, {:amqp_gen_connection, :handle_call, 3, [file: '/Users/bmrsny/Projects/rolodex/deps/amqp_client/src/amqp_gen_connection.erl', line: 171]}, {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 636]}, {:gen_server, :handle_msg, 6, [file: 'gen_server.erl', line: 665]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}, {#PID<0.651.0>, {:amqp_params_network, "guest", "guest", "/", 'localhost', "5673", 0, 0, 0, :infinity, :none, [&:amqp_auth_mechanisms.plain/3, &:amqp_auth_mechanisms.amqplain/3], [], []}})
where as an Integer works as expected
configs = [username: "guest", password: "guest", host: "localhost", port: 5673]
AMQP.Connection.open(configs)
{:ok, %AMQP.Connection{pid: #PID<0.658.0>}}
from amqp.
Whoah that is pretty ugly. Let me try to format that a bit
from amqp.
{{:function_clause,
[
{:amqp_gen_connection, :terminate,
[
{:function_clause,
[
{:inet_dns, :encode_labels,
[
<<"LONG BINARY">>,
{4,
{["brisk-bear", "rmq", "cloudamqp", "com", "", "home"], 12, nil,
{["rmq", "cloudamqp", "com", "", "home"], 23,
{["cloudamqp", "com", "", "home"], 27, nil,
{["com", "", "home"], 37, nil, nil}}, nil}}},
41,
["", "home"]
], [file: 'inet_dns.erl', line: 694]},
{:inet_dns, :encode_name, 4, [file: 'inet_dns.erl', line: 675]},
{:inet_dns, :encode_query_section, 3, [file: 'inet_dns.erl', line: 269]},
{:inet_dns, :encode, 1, [file: 'inet_dns.erl', line: 240]},
{:inet_res, :make_query, 5, [file: 'inet_res.erl', line: 670]},
{:inet_res, :make_query, 4, [file: 'inet_res.erl', line: 638]},
{:inet_res, :res_query, 6, [file: 'inet_res.erl', line: 622]},
{:inet_res, :res_getby_query, 4, [file: 'inet_res.erl', line: 589]}
]},
{pid,
{:amqp_params_network, "device_863", "BINARYTOKEN", "vbzcxsqr",
'brisk-bear.rmq.cloudamqp.com', 5672, 0, 0, 0, :infinity, :none,
[&:amqp_auth_mechanisms.plain/3, &:amqp_auth_mechanisms.amqplain/3], [], []}}
], [file: 'src/amqp_gen_connection.erl', line: 239]},
{:gen_server, :try_terminate, 3, [file: 'gen_server.erl', line: 648]},
{:gen_server, :terminate, 10, [file: 'gen_server.erl', line: 833]},
{:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}
]}, {:gen_server, :call, [pid, :connect, :infinity]}}
from amqp.
I don't think that is what is happening to me, but i'll make sure to check this out.
from amqp.
Hi. Can you provide a sample code(including mix.lock) and steps to reproduce the issue? Would be helpful to know the environment too (OS, RabbitMQ version, Elixir version etc.)
from amqp.
I haven't been able to reproduce this personally. I received it in a bug report. A particular user get this exception for some reason. FWIW,
"amqp": {:hex, :amqp, "1.0.0-pre.2", "952180aac9b3a1faea96522f589327e8286457b8bd0fd84bf0560e06d02f5a5a", [], [{:amqp_client, "~> 3.6.8", [hex: :amqp_client, repo: "hexpm", optional: false]}, {:rabbit_common, "~> 3.6.8", [hex: :rabbit_common, repo: "hexpm", optional: false]}], "hexpm"},
"amqp_client": {:hex, :amqp_client, "3.6.12", "dfdfe7be661feb96ece404092a47431a73797ad412959732d940f96f80290da0", [], [{:rabbit_common, "3.6.12", [hex: :rabbit_common, repo: "hexpm", optional: false]}], "hexpm"}
The device is running elixir 1.5.1 and OTP 20.1, connecting to RabbitMQ 3.6.12, Erlang 19.3.
here is how i'm opening the connection to rabbit.
opts = [
host: "brisk-bear.rmq.cloudamqp.com",
username: "device_863",
password: "BASE64ENCODED JSON WEB TOKEN",
virtual_host: "vbzcxsqr"]
AMQP.Connection.open(opts)
Also i just looked at the Erlang source described in that stack trace And it looks like my issue is caused by the token being to large.
from amqp.
This doesn't seem to be an issue with the amqp
lib. Hopefully this can help someone else tho. 👍
from amqp.
Actually, upon further inspection, it doesn't seem to have to do with my token, but one of the dns labels?
iex(farmbot@farmbot-52db)25> args
[
"LONG BINARY",
{4,
{["brisk-bear", "rmq", "cloudamqp", "com", "", "home"], 12, nil,
{["rmq", "cloudamqp", "com", "", "home"], 23,
{["cloudamqp", "com", "", "home"], 27, nil,
{["com", "", "home"], 37, nil, nil}}, nil}}},
41,
["", "home"]
]
iex(farmbot@farmbot-52db)26> [bin, comp0, pos, labels] = args
[
"LONG BINARY",
{4,
{["brisk-bear", "rmq", "cloudamqp", "com", "", "home"], 12, nil,
{["rmq", "cloudamqp", "com", "", "home"], 23,
{["cloudamqp", "com", "", "home"], 27, nil,
{["com", "", "home"], 37, nil, nil}}, nil}}},
41,
["", "home"]
]
the pattern match for labels
requires each item in the list to be greater than or equal to 1 bytes. ""
is obviously only zero bytes so it doesn't match that pattern.
from amqp.
Related Issues (20)
- Application.Connection has a missing case clause on line 113 HOT 1
- where to find documentation HOT 3
- AMQP.Basic.get/3 option no_ack: true not working HOT 2
- Enabling transactional mode for channels? HOT 1
- FunctionClauseError no function clause matching in AMQP.Connection.open/1
- Support amqp_client 3.9.1
- unable to compile: cannot find or invoke local basic_credit_drained/0 inside match HOT 2
- unexpected_delivery_and_no_default_consumer and abandoned consumers HOT 3
- Are streams supported? HOT 3
- Unhandeled Genserver event HOT 1
- Support for streams HOT 1
- How would one approach having tests alongside this library? HOT 2
- There should be some guide on how we could write proper unit tests for this HOT 1
- No feedback when RabbitMQ is unreachable HOT 1
- AMQP issue crashes GenServer irrespective of multiple error handlers. HOT 1
- websocket support HOT 3
- OTP 26 HOT 1
- Issue compiling with Elixir 1.15 (ssl_verify_fun)
- AMQP.Connection doesn't pick the default SSL configuration HOT 1
- Why aren't channels closed when no longer needed? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amqp.