Investigating 'Connection Refused' Error in DataHub Github Action Full Build Process

Original Slack Thread

Hi, I’m trying to full build datahub code through github action, but somehow metadata-io:test fails producing ‘Connection refused’ during SearchGraphServiceOpenSearchTest. Looks like there is some request for a service from inside to outside, but I’m not sure. I want to know which service or domain the test procedure is trying to connect. Any help would be appriciated !

> Task :metadata-io:test
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12753|12752

https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12754|12753
metadata-io-search > opensearch-testcontainers > com.linkedin.metadata.graph.search.opensearch.SearchGraphServiceOpenSearchTest > setup FAILED
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12755|12754
java.lang.RuntimeException: java.net.ConnectException: Connection refused
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12756|12755
at com.linkedin.metadata.graph.elastic.ElasticSearchGraphService.configure(ElasticSearchGraphService.java:318)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12757|12756
at com.linkedin.metadata.graph.search.SearchGraphServiceTestBase.setup(SearchGraphServiceTestBase.java:66)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12758|12757
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12759|12758
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12760|12759
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12761|12760
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12762|12761
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12763|12762
at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:69)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12764|12763
at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:390)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12765|12764
at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:325)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12766|12765
at org.testng.internal.invokers.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:180)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12767|12766
at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:122)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12768|12767
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12769|12768
at org.testng.TestRunner.privateRun(TestRunner.java:848)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12770|12769
at org.testng.TestRunner.run(TestRunner.java:621)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12771|12770
at org.testng.SuiteRunner.runTest(SuiteRunner.java:443)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12772|12771
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:481)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12773|12772
at org.testng.internal.thread.ThreadUtil.lambda$execute$0(ThreadUtil.java:58)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12774|12773
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12775|12774
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12776|12775
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12777|12776
at java.base/java.lang.Thread.run(Thread.java:840)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12778|12777

https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12779|12778
Caused by:
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12780|12779
java.net.ConnectException: Connection refused
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12781|12780
at org.opensearch.client.RestClient.extractAndWrapCause(RestClient.java:953)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12782|12781
at org.opensearch.client.RestClient.performRequest(RestClient.java:332)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12783|12782
at org.opensearch.client.RestClient.performRequest(RestClient.java:320)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12784|12783
at org.opensearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1918)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12785|12784
at org.opensearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1901)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12786|12785
at org.opensearch.client.IndicesClient.exists(IndicesClient.java:920)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12787|12786
at com.linkedin.metadata.search.elasticsearch.indexbuilder.ESIndexBuilder.buildReindexState(ESIndexBuilder.java:146)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12788|12787
at com.linkedin.metadata.graph.elastic.ElasticSearchGraphService.buildReindexConfigs(ElasticSearchGraphService.java:325)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12789|12788
at com.linkedin.metadata.graph.elastic.ElasticSearchGraphService.configure(ElasticSearchGraphService.java:314)
https://github.sec.samsung.net/bdp/data-knowledge-system-datahub/runs/20544320?check_suite_focus=true#step:12:12790|12789
… 21 more

Are you running on a machine with Docker set up? You said you’re running it through GitHub actions, are you using the ones we have set up or is this a custom CI workflow you have created in a fork?

The connection refused is the service trying to reach out to the test container port, which can happen when Docker is not running or ports are not properly opened.