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

NPE when running extension tests when depending on the quarkus-kubernetes-deployment #15555

Closed
metacosm opened this issue Mar 8, 2021 · 4 comments · Fixed by #15565
Closed
Assignees
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@metacosm
Copy link
Contributor

metacosm commented Mar 8, 2021

Describe the bug
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.kubernetes.deployment.VanillaKubernetesProcessor#createDecorators threw an exception: java.lang.NullPointerException
at io.quarkus.kubernetes.deployment.KubernetesCommonHelper.createProject(KubernetesCommonHelper.java:82)
at io.quarkus.kubernetes.deployment.VanillaKubernetesProcessor.createDecorators(VanillaKubernetesProcessor.java:102)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:920)
at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)

    [error]: Build step io.quarkus.kubernetes.deployment.KnativeProcessor#createDecorators threw an exception: java.lang.NullPointerException
    at io.quarkus.kubernetes.deployment.KubernetesCommonHelper.createProject(KubernetesCommonHelper.java:82)
    at io.quarkus.kubernetes.deployment.KnativeProcessor.createDecorators(KnativeProcessor.java:120)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:920)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
    at java.base/java.lang.Thread.run(Thread.java:834)
    at org.jboss.threads.JBossThread.run(JBossThread.java:501)

    [error]: Build step io.quarkus.kubernetes.deployment.OpenshiftProcessor#createDecorators threw an exception: java.lang.NullPointerException
    at io.quarkus.kubernetes.deployment.KubernetesCommonHelper.createProject(KubernetesCommonHelper.java:82)
    at io.quarkus.kubernetes.deployment.OpenshiftProcessor.createDecorators(OpenshiftProcessor.java:130)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:920)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
    at java.base/java.lang.Thread.run(Thread.java:834)
    at org.jboss.threads.JBossThread.run(JBossThread.java:501)

    at io.quarkus.test.QuarkusUnitTest.beforeAll(QuarkusUnitTest.java:504)

Expected behavior
No NPE or an actual error message that explains what's going on and how to fix the issue :)

Actual behavior
An NPE that doesn't really help figure out what's wrong.

To Reproduce

See https://github.com/quarkiverse/quarkus-operator-sdk/runs/2060346668?check_suite_focus=true#step:6:3050

@metacosm metacosm added the kind/bug Something isn't working label Mar 8, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 8, 2021

/cc @geoand

@geoand
Copy link
Contributor

geoand commented Mar 9, 2021

I am pretty sure we used to not run the Kubernetes steps when in test-mode - exactly for reasons like this.
@iocanel was that changed by accident?

@iocanel
Copy link
Contributor

iocanel commented Mar 9, 2021

Definitely not intentionally

geoand added a commit to geoand/quarkus that referenced this issue Mar 9, 2021
In tests, various Build Items are population with the
proper values (like the output target), so it's best
to not run the Kubernetes manifest generation at all
in order to avoid getting NPEs

Fixes: quarkusio#15555
@geoand geoand self-assigned this Mar 9, 2021
@geoand
Copy link
Contributor

geoand commented Mar 9, 2021

#15565 properly disables the manifest generation when running tests

geoand added a commit to geoand/quarkus that referenced this issue Mar 9, 2021
In tests, various Build Items are population with the
proper values (like the output target), so it's best
to not run the Kubernetes manifest generation at all
in order to avoid getting NPEs

Fixes: quarkusio#15555
geoand added a commit to geoand/quarkus that referenced this issue Mar 9, 2021
In tests, various Build Items are population with the
proper values (like the output target), so it's best
to not run the Kubernetes manifest generation at all
in order to avoid getting NPEs

Fixes: quarkusio#15555
iocanel added a commit that referenced this issue Mar 9, 2021
Make disablement of k8s manifest generation in tests declarative
@quarkus-bot quarkus-bot bot added this to the 1.13 - master milestone Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants