Error : ENOTFOUND
Closed this issue · 14 comments
Hello. I've been trying to set RSS puppy up. I'm getting { [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' }
and I have no idea what's referring to. Here's config file:
{
"feeds": [ "https://globenewswire.com/Rss/search/XwXK98ZDWLc8N4m3FssORcAcOHv2hsB6FxDQQN3Yc3oAyuPrMfAte0Pc9aqo_dXL"
],
"throttling": {
"monitorFrequency": 8000,
"oldFeedThreshold": 30,
"maxConcurrent": 10,
"concurrentInterval": 1000
},
"dbconfig": {
"user": "rsspuppy",
"password": "pwhere",
"url": "127.0.0.1",
"port": 5432,
"dbname": "rsspuppy",
"initScript": "./monitor/init-feed-db.sql"
},
"outputs": [
{
"file": "./outputs/debug-logger.js",
"config": {
"showOldFeedMessages": true
}
}
],
"exitOnError": true
}
Also, it'd be nice if there was more documentation available
Hey, sorry this is giving you trouble, the documentation definitely needs to be better.
So I copied your config over and I think the error is RSS Puppy not being able to connect to your local database. It's super opaque, we should really catch that error and report something more reasonable. Are you sure the db is running and listening on the (default) port 5432?
I got your config to work by doing this:
- in one terminal window
postgres -D /usr/local/var/postgres
- in a second terminal:
createuser --password rsspuppy
creatdb rsspuppy
- inside the rss puppy directory
node run.js
Hi. Thanks for replying. It's up and running according to netstat
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
I also tried running it with mysql (since you've said it might work in some other issue) and a I'm getting same error.
You think it can be caused by somewhat outdated debian packages?
npm WARN engine hawk@3.1.3: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine hoek@2.16.3: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine boom@2.10.1: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node": "0.10.29","npm":"1.4.21"})
That's possible, did you try updating things?
I'm trying to think of the quickest way to debug... Inside of monitor.js
on line 22 there's a call to buildDBConnectionString
. Maybe right below that you can try console.log(dbconfig.connectionString)
to see what it produced? And maybe test to see if that connection string works for your db setup?
I have updated everything and added outputted connectionstring to console. Here's result:
postgres://rsspuppy:pwd_here@127.0.0.1:5432/rsspuppy
Wed May 04 2016 05:19:00 GMT+0000 (UTC) Error:
{ [Error: getaddrinfo ENOTFOUND rsspuppy rsspuppy:5432]
code: 'ENOTFOUND',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'rsspuppy',
host: 'rsspuppy',
port: 5432 }
Tried connecting with next command psql -h 127.0.0.1 -p 5432 -U rsspuppy rsspuppy
and it worked. So psql is definitely up an running.
Oh! I think the answer might have been hidden in that password! Was there a space in there?
I think a space or other symbol is causing it to incorrectly parse the url. Probably there's a way for me to escape passwords, I'm not sure, but could you try with something simple like "abc" just to test?
I just created a user with that password and got the exact same error (sorry, I wasn't trying to steal your pw, but github emailed it to me. I'll delete the email / user and I definitely won't remember it heh)
Checking to see if I can escape the pw in the connection string
Pretty sure it was /
in the password which was causing this and yes, some password escaping would be nice.
Also, don't worry, I regenerated password after mistakingly posting it but it's not like you can do anything with that anyway 😛
Now time to figure out how to make the data accessible from outside of aws instance in say json format,
I just pushed a commit that url encodes the username and password, sorry for all that pain >.<
Ok, headed to sleep here, but let me know if you have other problems!
(ok, actually pushed one more commit that just encodes everything that could possibly cause a problem)
Thanks for you help. My client seems to be very happy with the potential of the tool you've created so thanks on his behalf as well.
Question is, how do I leave monitor running on the aws instance?
P.S. How lucky it was to have both postgre and mysql random gerated passwords to have / :laughing:
Good night
So there are a couple pretty easy ways to do that. If you're working with an ec2 instance and want full control, probably the simplest (and my personal favorite) is to make an upstart script: http://kvz.io/blog/2009/12/15/run-nodejs-as-a-service-on-ubuntu-karmic/
Or if you want to use elastic beanstock (easier in some ways to manage, but harder to test things / get access to logs), I recommend looking at the edgar-monitor repo (which uses rss-puppy to watch the sec's edgar filings database basically). You can tweak the dockerfile here: https://github.com/buzzfeed-openlab/edgar-monitor/blob/master/Dockerfile and make a little aws runner file like here: https://github.com/buzzfeed-openlab/edgar-monitor/blob/master/Dockerrun.aws.json
By the way... If you're allowed to tell me anything about what you're working on for the client you mentioned, I'd be super curious! My email is WestleyArgentum@gmail.com
Oh, I guess I'll start up script for debian.
Unfortunately, at this point I can't talk about what's being developed but when it's done and launched (target is 1st july iirc), I'll let you know.
@Igor-Yavych out of curiosity, was the project you worked on launched? I'd love to know more :)