Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a warn/error when kubernetes-config can't read target resource. #32763

Closed
2 of 3 tasks
iocanel opened this issue Apr 19, 2023 · 2 comments · Fixed by #33731
Closed
2 of 3 tasks

Provide a warn/error when kubernetes-config can't read target resource. #32763

iocanel opened this issue Apr 19, 2023 · 2 comments · Fixed by #33731
Assignees
Labels
Milestone

Comments

@iocanel
Copy link
Contributor

iocanel commented Apr 19, 2023

Description

It has been reported that in some cases kubernetes-config might fail silently to read the target kubenretes resource.
We need to at least provided a detailed explanation on why this happens.

Scenarios to check

  • resource does not exist
  • insufficient permission to read resource
  • client can't reach API server

Client can't each the API sever

The error message below does not make it very clear on what is going on.

2023-05-31 14:45:53,390 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile [dev]): io.netty.channel.ConnectTimeoutException: connection timed out: /10.0.0.2:8081
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261)
	at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:833)

The actual stack trace that is getting shortened is:

java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
	at io.quarkus.runtime.Application.start(Application.java:101)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:104)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.RuntimeException: Unable to obtain configuration for Secret objects from Kubernetes API Server at: http://10.0.0.2:8081/
	at io.quarkus.kubernetes.config.runtime.KubernetesConfigSourceProvider.getSecretConfigSources(KubernetesConfigSourceProvider.java:130)
	at io.quarkus.kubernetes.config.runtime.KubernetesConfigSourceProvider.getConfigSources(KubernetesConfigSourceProvider.java:54)
	at io.quarkus.runtime.configuration.ConfigUtils.addSourceProvider(ConfigUtils.java:225)
	at io.quarkus.runtime.configuration.ConfigUtils.addSourceProviders(ConfigUtils.java:239)
	at io.quarkus.runtime.generated.Config.readConfig(Unknown Source)
	at io.quarkus.deployment.steps.RuntimeConfigSetup.deploy(Unknown Source)
	... 13 more
Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Operation: [get]  for kind: [Secret]  with name: [postgresql]  in namespace: [default]  failed.
	at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:159)
	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.requireFromServer(BaseOperation.java:191)
	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.get(BaseOperation.java:142)
	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.get(BaseOperation.java:93)
	at io.quarkus.kubernetes.config.runtime.KubernetesConfigSourceProvider.getSecretConfigSources(KubernetesConfigSourceProvider.java:116)
	... 18 more
Caused by: java.io.IOException: connection timed out: /10.0.0.2:8081
	at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.waitForResult(OperationSupport.java:514)
	at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.handleResponse(OperationSupport.java:534)
	at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.handleGet(OperationSupport.java:481)
	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.handleGet(BaseOperation.java:745)
	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.requireFromServer(BaseOperation.java:186)
	... 21 more
Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /10.0.0.2:8081
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261)
	at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
@iocanel iocanel added the kind/enhancement New feature or request label Apr 19, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 19, 2023

/cc @Sgitario (kubernetes), @geoand (kubernetes)

@geoand
Copy link
Contributor

geoand commented Apr 19, 2023

@iocanel are you going to handle this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants