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

Permission Denied error during port binding. #1

Closed
gitfy opened this issue Jul 28, 2011 · 6 comments
Closed

Permission Denied error during port binding. #1

gitfy opened this issue Jul 28, 2011 · 6 comments

Comments

@gitfy
Copy link

gitfy commented Jul 28, 2011

Hi,
I was trying to use the syslog plugin with the winston logger. When i tried to initialize with default parameters, it tries to connect to the udp port 514.

Here i get a Permission denied exception. When i run the node server with sudo mode, it doesn't throw an error, but the connection doesn't get established, so all my messages are queued in the buffer.

I am doing this in my mac. Is there some thing i should be doing which i am missing.

I tried using unix_dgram protocol , but you don't have a option to specify the pid file name in the option list, which is required by the dgram library of node.

Thanks.

@squeeks
Copy link
Contributor

squeeks commented Jul 29, 2011

I quickly hacked in some Unix socket support with my own fork at squeeks/winston-syslog@8d561977391ba300716e , could you please test it out and see if it's working for you? If it works fine I'll clean it up and make a pull request out of it, and if it doesn't, show me how you're using it and we'll see what's going on.

@gitfy
Copy link
Author

gitfy commented Jul 29, 2011

The problems happens my before it reaches your fix. The port binding happens in the connect call.

In this place :
return this.isDgram
? this.socket.bind(this.port, this.host)
: this.socket.connect(this.port, this.host);

@squeeks
Copy link
Contributor

squeeks commented Aug 1, 2011

Sorry about that, I should have trawled through all of it instead of rushing. It'd be great if you could quickly fast-forward your clone (if you made one) to squeeks/winston-syslog@fb09dbb2b53c5f3fc7de as I should have fixed the binding as well. If it works for you, let me know and I'll nag @indexzero with a pull request.

@indexzero
Copy link
Member

Thanks. I'll take a look at this.

@gitfy
Copy link
Author

gitfy commented Aug 1, 2011

I tested the update. I don't get any exception. But i don't see any logs in the system.log file.

I initialized the Sys log addon with no options assumed it will work with default settings. With that i didn't see anything.

Then, i tried with the following options :
"protocol" : 'unix_dgram',
"pid" : "/var/run/syslog.pid"

This also didn't show me any log in the system log. Am i missing any parameters to be passed.

@indexzero
Copy link
Member

@gitfy This has been merged in and should be resolved.

There was one commit which did not make it in from @squeeks fork (https://github.com/squeeks/winston-syslog/commit/e2d24f1dc8db50dca9319e0b537964ddd8844141). Specifically winston should not be a dependency of winston-syslog. For a single "plugin" module it works, but once you have multiple plugin modules all specifying the same dependency you can end up in situations where there is more than one copy of winston installed in your node_modules directory structure.

If you're interested in the discussion going on for npm in this see: https://github.com/isaacs/npm/issues/930

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

3 participants