java.net.ConnectException: Connection refused

JIRA | Igor Galić | 2 years ago
  1. 0

    puppet server's core components all assume that when they talk to the out-side world, they'll be talking IPv4 only. All of our internal machines are IPv6 only, so they resolve things like updates.puppetlabs.com and rubygems.org either directly to IPv6, or indirectly via DNS64 and NAT64. The first symptom of something being off is that puppetserver takes a long time to start up, and we only see in the debug log why: {code} 2015-02-26 17:26:46,048 DEBUG [p.s.v.version-check-core] Could not retrieve update information (http://updates.puppetlabs.com) java.net.SocketException: Network is unreachable at sun.nio.ch.Net.connect0(Native Method) ~[na:1.8.0_31] at sun.nio.ch.Net.connect(Net.java:457) ~[na:1.8.0_31] at sun.nio.ch.Net.connect(Net.java:449) ~[na:1.8.0_31] at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:647) ~[na:1.8.0_31] at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processSessionRequests(DefaultConnectingIOReactor.java:272) ~[puppet-server-release.jar:na] at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:141) ~[puppet-server-release.jar:na] at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348) ~[puppet-server-release.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_31] {code} the second can be seen when trying to install a gem: {code} igalic@puppet01 ~ % sudo -H /usr/bin/puppetserver gem install hiera-file ERROR: Could not find a valid gem 'hiera-file' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SocketError: Network is unreachable (https://rubygems.org/latest_specs.4.8.gz) sudo -H /usr/bin/puppetserver gem install hiera-file 13,43s user 0,31s system 182% cpu 7,511 total igalic@puppet01 ~ % {code} i'd like to be able to tell puppetserver to prefer ipv6. putting that intent in the form of {{JAVA_ARGS="-Xms2g -Xmx2g -Djava.net.preferIPv6Addresses=true"}} into {{/etc/default/puppetserver}} doesn't seem to suffice: startup: {code} 2015-02-26 17:34:56,866 DEBUG [p.s.v.version-check-core] Could not retrieve update information (http://updates.puppetlabs.com) java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_31] at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:716) ~[na:1.8.0_31] at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:173) ~[puppet-server-release.jar:na] at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:147) ~[puppet-server-release.jar:na] at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348) ~[puppet-server-release.jar:na] at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:189) ~[puppet-server-release.jar:na] at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.doExecute(CloseableHttpAsyncClientBase.java:67) ~[puppet-server-release.jar:na] at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.access$000(CloseableHttpAsyncClientBase.java:38) ~[puppet-server-release.jar:na] at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:57) ~[puppet-server-release.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_31] {code} gem: {code} igalic@puppet01 ~ % sudo -H /usr/bin/puppetserver gem install hiera-file ERROR: Could not find a valid gem 'hiera-file' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SocketError: Network is unreachable (https://rubygems.org/latest_specs.4.8.gz) sudo -H /usr/bin/puppetserver gem install hiera-file 13,97s user 0,33s system 187% cpu 7,637 total igalic@puppet01 ~ % {code}

    JIRA | 2 years ago | Igor Galić
    java.net.ConnectException: Connection refused
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Error while deploy mesos cluster

    GitHub | 8 months ago | julykobe
    java.net.ConnectException: Connection refused

  1. RoiOtero 1 times, last 2 weeks ago
  2. nasimk 1064 times, last 2 weeks ago
  3. gehel 8 times, last 1 month ago
  4. rp 1 times, last 1 month ago
  5. poroszd 4 times, last 2 months ago
10 more registered users
85 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.ConnectException

    Connection refused

    at sun.nio.ch.SocketChannelImpl.checkConnect()
  2. Java RT
    SocketChannelImpl.finishConnect
    1. sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)[na:1.8.0_31]
    2. sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:716)[na:1.8.0_31]
    2 frames
  3. Apache HttpCore NIO
    AbstractMultiworkerIOReactor.execute
    1. org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:173)[puppet-server-release.jar:na]
    2. org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:147)[puppet-server-release.jar:na]
    3. org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348)[puppet-server-release.jar:na]
    3 frames
  4. Apache HttpAsyncClient
    CloseableHttpAsyncClientBase$1.run
    1. org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:189)[puppet-server-release.jar:na]
    2. org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.doExecute(CloseableHttpAsyncClientBase.java:67)[puppet-server-release.jar:na]
    3. org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.access$000(CloseableHttpAsyncClientBase.java:38)[puppet-server-release.jar:na]
    4. org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:57)[puppet-server-release.jar:na]
    4 frames
  5. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)[na:1.8.0_31]
    1 frame