{"record":{"id":"20c30bc2ac3d895e","repo":"conductor-oss/conductor","slug":"io-error-while-connecting-to-addresses","errorCode":null,"errorMessage":"IO error while connecting to <addresses>","messagePattern":"IO error while connecting to <addresses>","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/AMQPConnection.java","lineNumber":131,"sourceCode":"                            @Override\n                            public void handleBlocked(String reason) throws IOException {\n                                LOGGER.error(\n                                        \"Connection {} is blocked. reason: {}\",\n                                        connection.getClientProvidedName(),\n                                        reason);\n                            }\n                        });\n                return connection;\n            } catch (final IOException e) {\n                AMQPRetryPattern retry = retrySettings;\n                if (retry == null) {\n                    final String error =\n                            \"IO error while connecting to \"\n                                    + Arrays.stream(addresses)\n                                            .map(address -> address.toString())\n                                            .collect(Collectors.joining(\",\"));\n                    LOGGER.error(error, e);\n                    throw new RuntimeException(error, e);\n                }\n                try {\n                    retry.continueOrPropogate(e, retryIndex);\n                } catch (Exception ex) {\n                    final String error =\n                            \"Retries completed. IO error while connecting to \"\n                                    + Arrays.stream(addresses)\n                                            .map(address -> address.toString())\n                                            .collect(Collectors.joining(\",\"));\n                    LOGGER.error(error, e);\n                    throw new RuntimeException(error, e);\n                }\n                retryIndex++;\n            } catch (final TimeoutException e) {\n                AMQPRetryPattern retry = retrySettings;\n                if (retry == null) {\n                    final String error =\n                            \"Timeout while connecting to \"","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/AMQPConnection.java#L113-L149","documentation":"createConnection caught an IOException from factory.newConnection and retrySettings is null, so the failure propagates immediately as a RuntimeException instead of being retried. IOException from newConnection means a transport/handshake failure: connection refused, DNS failure, socket reset, or an authentication failure (the rabbitmq-client surfaces bad credentials as IOException).","triggerScenarios":"getOrCreateChannel triggers createConnection; factory.newConnection throws IOException; getInstance was called with a null AMQPRetryPattern (the module is wired without retry configuration), so the catch block takes the no-retry branch and throws.","commonSituations":"Wrong host or port in the AMQPEventQueueProperties config; broker is down or firewalled; incorrect username/password/vhost (auth failure is reported as IOException); DNS cannot resolve the broker host.","solutions":["Verify the broker is reachable at each configured address/port: `nc -zv <host> <port>`.","Confirm username, password and vhost are correct, since the rabbitmq client reports an auth failure as IOException.","Wire an AMQPRetryPattern so transient IO failures are retried instead of failing fast (the no-retry branch only runs when retrySettings is null).","Check DNS resolution for every host in the addresses list."],"exampleFix":"// before: AMQPObservableQueue built with null retry -> fails fast on a flaky broker\nnew AMQPObservableQueue(factory, addresses, useExchange, settings, null, batchSize, pollTimeInMS);\n\n// after: supply a retry pattern so transient IOExceptions are retried\nAMQPRetryPattern retry = new AMQPRetryPattern(limit, duration, type);\nnew AMQPObservableQueue(factory, addresses, useExchange, settings, retry, batchSize, pollTimeInMS);","handlingStrategy":"retry","validationCode":"// Validate each address is resolvable and the port is open before building the queue\nfor (Address a : addresses) {\n    try (java.net.Socket s = new java.net.Socket()) {\n        s.connect(new java.net.InetSocketAddress(a.getHost(), a.getPort()), 2000);\n    } catch (IOException e) {\n        throw new IllegalStateException(\"broker unreachable at \" + a, e);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    amqpConnection.getOrCreateChannel(ConnectionType.SUBSCRIBER, queueName);\n} catch (RuntimeException e) {\n    if (e.getCause() instanceof IOException) {\n        // transport-level failure; back off and retry at the caller layer\n    }\n    throw e;\n}","preventionTips":["Always wire a non-null AMQPRetryPattern so transient IOExceptions are retried instead of failing fast.","Validate broker host/port and credentials in config at deploy time.","Run a startup connectivity check against every configured broker address."],"tags":["amqp","rabbitmq","connection","io","network"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}