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

App won't start in OpenShift due to incorrect JAVA_APP_JAR with quarkus-kubernetes-config #28108

Closed
michalvavrik opened this issue Sep 20, 2022 · 5 comments · Fixed by #28122
Closed
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@michalvavrik
Copy link
Member

michalvavrik commented Sep 20, 2022

Describe the bug

Quarkus app won't start in OpenShift as there is JAVA_APP_JAR set to ~ artifact-id-version-runner.jar and no CMD set. In Quarkus 2.12.2.Final there was also set /deployments/artifact-id-version-runner.jar (so not a new behavior), however that was not used as there was cmd that started the app

    Command:
      java
      -jar
      /deployments/quarkus-run.jar

It's consequence of #27733, differs from #28037 in that I added single dependency quarkus-kubernetes-config.

Expected behavior

App should start just fine, e.g. it could set JAVA_APP_JAR to /deployments/quarkus-run.jar or set cmd.
Example of generated openshift.yml with reproducer when k8 config dep is removed: https://github.com/michalvavrik/openshift-quickstart/blob/master/without-troublesome-dep-openshift.yml

Actual behavior

Example of generated openshift.yml with reproducer: https://github.com/michalvavrik/openshift-quickstart/blob/master/troublesome-openshift.yml
App POD in CrashLoopBackOff and exception is logged:

Starting the Java application using /opt/jboss/container/java/run/run-java.sh ...
ERROR No such file /deployments/openshift-quickstart-1.0.0-SNAPSHOT-runner.jar
INFO exec  java -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:+ExitOnOutOfMemoryError -cp "." -jar  
Error: -jar requires jar file specification
Usage: java [options] <mainclass> [args...]
...

How to Reproduce?

Reproducer:

Prerequisity:

  1. OC stuff

Steps to reproduce the behavior:

  1. git clone https://github.com/michalvavrik/openshift-quickstart.git
  2. cd openshift-quickstart
  3. quarkus build
  4. inspect pod

Alternative reproducer: Quarkus QE test suite module contains failing test, clone it, and run mvn clean verify -f config/ -Dit.test=OpenShiftApiServerConfigSecretConfigIT -Dopenshift

Output of uname -a or ver

Linux fedora 5.19.6-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 31 17:58:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.3" 2022-04-19

GraalVM version (if different from Java)

GraalVM CE 22.1.0

Quarkus version or git rev

999-SNAPSHOT & 2.13.0.CR1

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6

Additional information

I think JAVA_APP_JAR that is set through AddEnvVarDecorator is overwritten in Dekorate (just suggestion...).

@michalvavrik michalvavrik added the kind/bug Something isn't working label Sep 20, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 20, 2022

/cc @Sgitario, @geoand, @iocanel

@geoand
Copy link
Contributor

geoand commented Sep 21, 2022

Isn't this similar to one you had reported a few days ago?

@michalvavrik
Copy link
Member Author

michalvavrik commented Sep 21, 2022

@geoand very similar, but that one is fixed. This one, I believe, is due to Dekorate overwriting the env. variable JAVA_APP_JAR. This is not a new behavior as this issue was already in Quarkus 2.12 etc. it's just now we don't have a CMD se the variable is actually used.

Please mention that the issue I opened a few days ago is fixed and arguably in desirable fashion. Had Dekorate respected the variable we set in Quarkus, it would also fix this one - but that's my opinion, please ask @Sgitario and @iocanel .

@michalvavrik
Copy link
Member Author

I didn't know about this scenario, that's why I created new issue now.

@geoand
Copy link
Contributor

geoand commented Sep 21, 2022

Makes sense, I just wanted to clarify.

Sgitario added a commit to Sgitario/quarkus that referenced this issue Sep 21, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet. 

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108
Sgitario added a commit to Sgitario/quarkus that referenced this issue Sep 21, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet. 

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108
Sgitario added a commit to Sgitario/quarkus that referenced this issue Sep 22, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet. 

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108
Sgitario added a commit to Sgitario/quarkus that referenced this issue Sep 22, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet. 

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108
Sgitario added a commit to Sgitario/quarkus that referenced this issue Sep 22, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet. 

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108
Sgitario added a commit to Sgitario/quarkus that referenced this issue Sep 27, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet. 

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108
@quarkus-bot quarkus-bot bot added this to the 2.14 - main milestone Oct 4, 2022
@gsmet gsmet modified the milestones: 2.14 - main, 2.13.1.Final Oct 4, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 4, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet.

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108

(cherry picked from commit 922948b)
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet. 

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet. 

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet. 

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 17, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet. 

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108
tmihalac pushed a commit to tmihalac/quarkus that referenced this issue Oct 27, 2022
Adding dependencies like `quarkus-openshift` and `quarkus-kubernetes-config` might lead into running the kubernetes processor when the JAR file is not correct yet. 

With these changes, we'll get always the correct artifact.
Fix quarkusio#28108
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