title: Could not locate PropertySource because of java.net.ConnectException: Connection refused
body: <p>I created a docker image and pushed it to docker hub. Now, I am trying to run it on a remote machine by using <code>docker-compose</code> and I get the following error.</p>
  
  <pre><code>java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
  my-test_1  |    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:132)
  my-test_1  |    at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:93)
  my-test_1  |    at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:567)
  my-test_1  |    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:338)
  my-test_1  |    at org.springframework.boot.SpringApplication.run(SpringApplication.java:301)
  my-test_1  |    at net.ptidej.seodin.SeodinApp.main(SeodinApp.java:68)
  my-test_1  |    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  my-test_1  |    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  my-test_1  |    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  my-test_1  |    at java.lang.reflect.Method.invoke(Method.java:498)
  my-test_1  |    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
  my-test_1  |    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
  my-test_1  |    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
  my-test_1  |    at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59)
  my-test_1  | Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8761/config/seodin/prod/master": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
  my-test_1  |    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:674)
  my-test_1  |    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:621)
  my-test_1  |    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:539)
  my-test_1  |    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:172)
  my-test_1  |    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:93)
  my-test_1  |    ... 13 common frames omitted
  my-test_1  | Caused by: java.net.ConnectException: Connection refused (Connection refused)
  my-test_1  |    at java.net.PlainSocketImpl.socketConnect(Native Method)
  my-test_1  |    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
  my-test_1  |    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
  my-test_1  |    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
  my-test_1  |    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
  my-test_1  |    at java.net.Socket.connect(Socket.java:589)
  my-test_1  |    at java.net.Socket.connect(Socket.java:538)
  my-test_1  |    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
  my-test_1  |    at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
  my-test_1  |    at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
  my-test_1  |    at sun.net.www.http.HttpClient.&lt;init&gt;(HttpClient.java:242)
  my-test_1  |    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
  my-test_1  |    at sun.net.www.http.HttpClient.New(HttpClient.java:357)
  my-test_1  |    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
  my-test_1  |    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
  my-test_1  |    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
  my-test_1  |    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
  my-test_1  |    at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:78)
  my-test_1  |    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
  my-test_1  |    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53)
  my-test_1  |    at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:112)
  my-test_1  |    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$GenericRequestHeaderInterceptor.intercept(ConfigServicePropertySourceLocator.java:237)
  my-test_1  |    at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:88)
  my-test_1  |    at org.springframework.http.client.InterceptingClientHttpRequest.executeInternal(InterceptingClientHttpRequest.java:72)
  my-test_1  |    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
  my-test_1  |    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53)
  my-test_1  |    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:660)
  my-test_1  |    ... 17 common frames omitted
  my-test_1  | 
  </code></pre>
  
  <p>I am guessing it has something to do with ports in one of the config files, but I don't know which one. What is the meaning of this error and where should I look to resolve it? I would appreciate any lead/hint to the problem in the source code/config files. Thank you.</p>