title: Getting error: java.lang.IllegalStateException: No instances found of configserver (config-server)
body: <p>I'm trying to register a spring-cloud config server with my eureka discovery server, however I'm encountering this error:</p>
  
  <p>java.lang.IllegalStateException: No instances found of configserver (config-server)</p>
  
  <p>application.yml (config-server):</p>
  
  <pre><code>spring:
    application:
      name: config-server
    cloud:
      config:
        server:
          git:
            uri:  https://github.com/danielturato/microservices-config.git
            username: *******
            password: *******
            clone-on-start: true
  
  server:
    port: 8888
  
  eureka:
    instance:
      hostname: localhost
      appname: config-server
    client:
      service-url:
        defaultZone: http://localhost:1111/eureka/
  </code></pre>
  
  <p>bootstrap.yml (eureka-server):</p>
  
  <pre><code>spring:
    application:
      name: eureka-server
  
  server:
    port: 1111
  
  eureka:
    client:
      registerWithEureka: false
      fetchRegistry: false
      service-url:
        defaultZone: http://localhost:1111/eureka/
  </code></pre>
  
  <p>bootstrap.yml (eureka-client):</p>
  
  <pre><code>spring:
    application:
      name: eureka-client
    cloud:
      config:
        discovery:
          enabled: true
          service-id: config-server
  </code></pre>
  
  <p>eureka-client.yml (eureka-client config found on config server repo):</p>
  
  <pre><code>
  eureka:
    client:
      service-url:
        defaultZone: http://localhost:1111/eureka/
  
  server:
    port: 8081
  </code></pre>
  
  <p>The config server itself works as when running, it fetches the config for the eureka client. However, every few mins I receive this error and the config server itself never registers:</p>
  
  <pre><code>java.lang.IllegalStateException: No instances found of configserver (config-server)
      at org.springframework.cloud.config.client.ConfigServerInstanceProvider.getConfigServerInstances(ConfigServerInstanceProvider.java:48) ~[spring-cloud-config-client-2.1.3.RELEASE.jar:2.1.3.RELEASE]
      at org.springframework.cloud.config.client.DiscoveryClientConfigServiceBootstrapConfiguration.refresh(DiscoveryClientConfigServiceBootstrapConfiguration.java:101) [spring-cloud-config-client-2.1.3.RELEASE.jar:2.1.3.RELEASE]
      at org.springframework.cloud.config.client.DiscoveryClientConfigServiceBootstrapConfiguration.heartbeat(DiscoveryClientConfigServiceBootstrapConfiguration.java:92) [spring-cloud-config-client-2.1.3.RELEASE.jar:2.1.3.RELEASE]
      at org.springframework.cloud.config.client.DiscoveryClientConfigServiceBootstrapConfiguration.onApplicationEvent(DiscoveryClientConfigServiceBootstrapConfiguration.java:82) [spring-cloud-config-client-2.1.3.RELEASE.jar:2.1.3.RELEASE]
      at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) [spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]
      at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) [spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]
      at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) [spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402) [spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:408) [spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359) [spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]
      at org.springframework.cloud.netflix.eureka.CloudEurekaClient.onCacheRefreshed(CloudEurekaClient.java:123) [spring-cloud-netflix-eureka-client-2.1.2.RELEASE.jar:2.1.2.RELEASE]
      at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:999) [eureka-client-1.9.12.jar:1.9.12]
      at com.netflix.discovery.DiscoveryClient.refreshRegistry(DiscoveryClient.java:1497) [eureka-client-1.9.12.jar:1.9.12]
      at com.netflix.discovery.DiscoveryClient$CacheRefreshThread.run(DiscoveryClient.java:1464) [eureka-client-1.9.12.jar:1.9.12]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_211]
      at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_211]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_211]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_211]
      at java.lang.Thread.run(Thread.java:748) [na:1.8.0_211]
  </code></pre>
  
  <p>From this error, I maybe wrong, but I feel like there's a problem with the config server however I'm really not sure what's wrong. See above for the application.yml file and see below the Application class &amp; pom file:</p>
  
  <p>ConfigServerApplication:</p>
  
  <pre class="lang-java prettyprint-override"><code>@SpringBootApplication
  @EnableDiscoveryClient
  @EnableConfigServer
  public class ConfigServerApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(ConfigServerApplication.class, args);
      }
  
  }
  </code></pre>
  
  <p>pom.xml for ConfigServer:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.1.8.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
      &lt;groupId&gt;com.danielturato&lt;/groupId&gt;
      &lt;artifactId&gt;config-server&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;config-server&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  
      &lt;properties&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;spring-cloud.version&gt;Greenwich.SR2&lt;/spring-cloud.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-config-server&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-netflix-eureka-client&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
                  &lt;version&gt;${spring-cloud.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>config-server logs:</p>
  
  <pre><code>2019-09-12 17:14:25.311  INFO 1656 --- [           main] c.d.c.ConfigServerApplication            : No active profile set, falling back to default profiles: default
  2019-09-12 17:14:25.983  INFO 1656 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=5638ff1e-e195-3b5c-a934-c721843f315c
  2019-09-12 17:14:26.042  INFO 1656 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$3fdd8981] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  2019-09-12 17:14:26.219  INFO 1656 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8888 (http)
  2019-09-12 17:14:26.237  INFO 1656 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
  2019-09-12 17:14:26.238  INFO 1656 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.24]
  2019-09-12 17:14:26.340  INFO 1656 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
  2019-09-12 17:14:26.340  INFO 1656 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1019 ms
  2019-09-12 17:14:28.719  INFO 1656 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
  2019-09-12 17:14:29.162  INFO 1656 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
  2019-09-12 17:14:29.245  INFO 1656 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8888 (http) with context path ''
  2019-09-12 17:14:29.247  INFO 1656 --- [           main] c.d.c.ConfigServerApplication            : Started ConfigServerApplication in 5.097 seconds (JVM running for 6.359)
  2019-09-12 17:14:47.055  INFO 1656 --- [nio-8888-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
  2019-09-12 17:14:47.055  INFO 1656 --- [nio-8888-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
  2019-09-12 17:14:47.061  INFO 1656 --- [nio-8888-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 6 ms
  2019-09-12 17:14:47.769  INFO 1656 --- [nio-8888-exec-1] o.s.c.c.s.e.NativeEnvironmentRepository  : Adding property source: file:/C:/Users/danie/AppData/Local/Temp/config-repo-6536884673987435552/eureka-client.yml
  </code></pre>
  
  <p>If anyone has any idea what I'm doing wrong, any help would be great. Thanks.</p>
  
  <p><strong>Conclusion</strong></p>
  
  <p>I've come to the conclusion that there was either something wrong with my project files or my computer as I completed an identical project on my laptop and the project ran completely fine. I have no idea what was wrong still</p>