Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-8697

spring-cloud-kubernetes: Can't read secret with name: [null] or labels [{}] in namespace:

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • FIS 2.0
    • FIS 2.0
    • FIS-Fabric8
    • None
    • FIS 2.0 Sprint 6

      I just tested simple discovery application with these dependency versions:

      <spring-cloud-kubernetes-bom-with-platform-deps.version>0.1.0.redhat-000011</spring-cloud-kubernetes-bom-with-platform-deps.version>
      <!-- Spring Boot -->
      <spring-boot.version>1.3.7.RELEASE</spring-boot.version>
      <spring-cloud.version>Brixton.SR5</spring-cloud.version>
      <camel.version>2.18.0.redhat-000032</camel.version>
      <fabric8.version>2.2.0.redhat-000037</fabric8.version>
      <fabric8.maven.plugin.version>3.1.0.redhat-000021</fabric8.maven.plugin.version>
      <version.maven-bundle-plugin>2.3.7</version.maven-bundle-plugin>
      <kubernetes.client.version>1.4.0.redhat-000028</kubernetes.client.version>
      

      and receiving excpetion during start the pod:

      Starting the Java application using /opt/run-java/run-java.sh ...
      exec java -javaagent:/opt/jolokia/jolokia.jar=host=0.0.0.0,user=jolokia,password=RHIKqtDIoAW2nX7bO8V82iblla6F56 -cp . -jar /deployments/spring-cloud-discovery-test-app.jar
      Picked up JAVA_TOOL_OPTIONS: -Duser.home=/home/jboss -Duser.name=jboss
      I> No access restrictor found, access to all MBean is allowed
      Jolokia: Agent started with URL http://10.1.3.4:8778/jolokia/
      04:18:05.279 [background-preinit] INFO  o.h.validator.internal.util.Version - HV000001: Hibernate Validator 5.2.4.Final
      04:18:05.674 [main] INFO  o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@6aceb1a5: startup date [Fri Sep 30 04:18:05 EDT 2016]; root of context hierarchy
      04:18:05.907 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'configurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$3d59a1b2] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      
        .   ____          _            __ _ _
       /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
      ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
       \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
        '  |____| .__|_| |_|_| |_\__, | / / / /
       =========|_|==============|___/=/_/_/_/
       :: Spring Boot ::        (v1.4.1.RELEASE)
      
      04:18:06.403 [main] INFO  o.s.c.b.c.PropertySourceBootstrapConfiguration - Located property source: ConfigMapPropertySource [name='configmap.application.lfuka']
      04:18:06.441 [main] WARN  i.f.s.c.k.c.SecretsPropertySource - Can't read secret with name: [null] or labels [{}] in namespace:[lfuka]. Ignoring
      io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://kubernetes.default.svc/api/v1/namespaces/lfuka/secrets/application. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked..
      	at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:314)
      	at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:265)
      	at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:236)
      	at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:229)
      	at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleGet(OperationSupport.java:225)
      	at io.fabric8.kubernetes.client.dsl.base.BaseOperation.handleGet(BaseOperation.java:590)
      	at io.fabric8.kubernetes.client.dsl.base.BaseOperation.get(BaseOperation.java:165)
      	at io.fabric8.spring.cloud.kubernetes.config.SecretsPropertySource.getSourceData(SecretsPropertySource.java:71)
      	at io.fabric8.spring.cloud.kubernetes.config.SecretsPropertySource.<init>(SecretsPropertySource.java:39)
      	at io.fabric8.spring.cloud.kubernetes.config.SecretsPropertySourceLocator.locate(SecretsPropertySourceLocator.java:39)
      	at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:89)
      	at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:635)
      	at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:349)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
      	at io.fabric8.spring.cloud.kubernetes.discovery.SampleDiscoveryTestApp.main(SampleDiscoveryTestApp.java:64)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:104)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:61)
      	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
      04:18:06.442 [main] INFO  o.s.c.b.c.PropertySourceBootstrapConfiguration - Located property source: SecretsPropertySource [name='secrets.application.lfuka']
      04:18:06.499 [main] INFO  i.f.s.c.k.d.SampleDiscoveryTestApp - The following profiles are active: kubernetes
      04:18:06.514 [main] INFO  o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@12cdcf4: startup date [Fri Sep 30 04:18:06 EDT 2016]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@6aceb1a5
      04:18:07.226 [main] WARN  o.s.c.a.ConfigurationClassPostProcessor - Cannot enhance @Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
      04:18:07.356 [main] INFO  o.s.cloud.context.scope.GenericScope - BeanFactory id=e9188014-1bb5-3281-9fb5-9f662a2f0c9f
      04:18:07.410 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$3d59a1b2] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      04:18:07.554 [main] WARN  o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
      04:18:07.570 [main] ERROR o.s.boot.SpringApplication - Application startup failed
      org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
      	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535)
      	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
      	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
      	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
      	at io.fabric8.spring.cloud.kubernetes.discovery.SampleDiscoveryTestApp.main(SampleDiscoveryTestApp.java:64)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:104)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:61)
      	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
      Caused by: java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
      	at org.apache.catalina.util.LifecycleBase.<clinit>(LifecycleBase.java:37)
      	at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:167)
      	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164)
      	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)
      	... 16 common frames omitted
      Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:178)
      	at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:142)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	... 20 common frames omitted
      java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
      	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:62)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:104)
      	at org.springframework.boot.loader.Launcher.launch(Launcher.java:61)
      	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
      Caused by: java.lang.reflect.InvocationTargetException
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54)
      	... 3 more
      Caused by: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
      	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535)
      	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
      	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
      	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
      	at io.fabric8.spring.cloud.kubernetes.discovery.SampleDiscoveryTestApp.main(SampleDiscoveryTestApp.java:64)
      	... 8 more
      Caused by: java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
      	at org.apache.catalina.util.LifecycleBase.<clinit>(LifecycleBase.java:37)
      	at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:167)
      	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164)
      	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)
      	... 16 more
      Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:178)
      	at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:142)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 20 more
      

              Unassigned Unassigned
              lfuka Libor Fuka
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: