-
Notifications
You must be signed in to change notification settings - Fork 26
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
(FunctionClauseError) no function clause matching in anonymous fn/1 in Socket.arguments/1 when creating Producer #21
Comments
Hey there, can you try using |
@MaxPower15 First of all, thank you for the quick response. Did that, now the error changed and I see something in the nsq logs.
And the nsq logs output:
|
Ah, that's no fun. Can you tell me what version of nsq you're running, the command you started it with, and the version of the NSQ closes the connection when it runs into anything that it considers invalid and the point where it's failing for you is the first place we try to |
If it helps, my IDENTIFY output when running the tests here is like
So that should be an example of a valid config, at least on v0.3.8. |
@MaxPower15 So my nsq version is My socket version is: Tried downgrading socket to 0.3.8 just in case. But no luck, same error 😞 |
Gotcha, thanks for testing. I just updated to 1.0.0-compat and was able to reproduce. I'll let you know what I find and hopefully push up a fix soon. |
We're currently using |
Hmm, scratch that repro I thought I found, sorry. The consumer specs are failing for 1.0.0-compat, but the error I saw for the producer was just caused by the test closing down a dependent process a little early. It had already passed though. I'm going to look into the issues with the consumer and hope to have a fix for that. EDIT: These are all because we used the /put endpoint instead of /pub in our tests. Easy fix at least. SECOND EDIT: Bah, I just had old code locally, heh. Others already fixed this. @malcolmrebughini Are you able to test without docker by any chance? Or perhaps debug that piece a little further? I'm wondering if there's a port forwarding issue, or something like that; maybe when NSQ tries to
That is, NSQ says what kind of error it is (i.e. Could you let me know the exact commandline args you've used to install/start nsq so I can test the same way locally? |
There seems to be something wrong with the application I'm writing. Cloned this repo and all tests passed. With my app tried running a local nsq and still the same error (Just running This is an api made with Phoenix, when a certain endpoint its hit a message is sent to NSQ. I don't know if there should be any issues with this (elixir newbie here). Anyways, I'll make a barebones example of what I'm trying to accomplish to share with you in the next couple of days. Thank you for all your help! |
Ah, cool, thanks for testing that!
Yeah, it's hard to say without knowing all the details of the API, but what I'd usually expect for that use case is that you add an This explains the pattern I'm thinking of. https://www.amberbit.com/blog/2016/5/13/process-name-registration-in-elixir/ I mention that because it sounds like the producer you're creating is a dependent process of a phoenix request, which means it gets killed when the request process terminates. Anyway, this issue prompted me to publish version 1.0.4 and it seems like things are basically working, so I'll close this issue. Thanks! |
I should mention, feel free to post on this thread for help/advice and
potentially reopen if you can find a reproducible issue. Good luck!
…On Sun, Nov 26, 2017 at 9:06 PM Malcolm Rebughini ***@***.***> wrote:
There seems to be something wrong with the application I'm writing. Cloned
this repo and all tests passed.
With my app tried running a local nsq and still the same error (Just
running nsqd with the default configuration).
This is an api made with Phoenix, when a certain endpoint its hit a
message is sent to NSQ. I don't know if there should be any issues with
this (elixir newbie here).
Anyways, I'll make a barebones example of what I'm trying to accomplish to
share with you in the next couple of days.
Thank you for all your help!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAeJqKitun_o_XB_SrR62v9i39MxfNQQks5s6hk9gaJpZM4Qq76E>
.
|
Hey @MaxPower15 , sorry to bother you again. I've made a quick example, that actually just adds 5 lines to a barebones Phoenix app. If you go to Any ideas on what I did wrong or what could be happening? A million thanks! |
Ah, thanks for putting that up, that's helpful. Assuming you're running just one instance of nsqd on the default port (4150), I think it's because you've got two nsqds configured to connect: one on 4150 and one on 4151. The default nsqd starts listening for TCP on 4150 and HTTP for 4151. And the config for nsqds is meant only to target the TCP ports. Anyway, with that in mind, does it work for you if you change the nsqd config line at https://github.com/malcolmrebughini/phoenix-nsq-example/blob/53767c3a0e385e86f5e372397aa6d28d7e50bb32/lib/phoenix_nsq/application.ex#L18 to this? nsqds: ["127.0.0.1:4150"] |
It was that! Let's say that I'm not feeling smart after this 😬 Thanks a lot for your help! |
No worries, nsq port configs still get me years on, haha. Cheers! |
As soon as this is called:
The following error is thrown:
Running Elixir 1.5.2, Erlang/OTP 20.
{:elixir_nsq, "~> 1.0.3"},
The text was updated successfully, but these errors were encountered: