Errno::ECONNREFUSED: Connection refused - connect(2) for "0.0.0.0" port 80

rspec
elasticsearch

#1

Using ElasticSearch and Redis. A few specs that pass locally with rspec fail on Circle with the following error:

Failure/Error: let(:nomination)      { Nomination.create(user: user, url: "http://test.com", approval_ballot: approval_ballot) }
Errno::ECONNREFUSED:
Connection refused - connect(2) for "0.0.0.0" port 80

From what I can tell this is maybe an issue with elasticsearch not running? Any advice would be appreciated.


#2

Should add that I get this error when explicitly stating elasticsearch as a dependency, when installing a specific version of elastic search, or without any declaration that i need elasticsearch.


#3

How exactly are you installing elasticsearch? From what I can tell, you are not using the pre-installed version, are you?


#4

I’ve tried it all three ways. Installing my own version, declaring it in my machine services, and not doing anything at all and letting circle infer the correct version.


#5

Not sure why are you expecting Elasticsearch to listen on the port 80—wasn’t the default port it would listen to 9200, as suggested here?


#6

Agreed, it is very unusual for elasticsearch to run on port 80.


#7

So, after some more poking around, I think what’s happening is that a spec wasn’t properly stubbed. It’s trying to access a varnish configs, that are using port 80, and consequently throwing the error.


#8

Awesome, glad you figured this out!


#9