Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.35k stars 1.99k forks source link

[BUG] Azure Spring Apps deployment failed with Java 21 #41882

Closed kirankumar994 closed 1 week ago

kirankumar994 commented 1 month ago

Describe the bug I have a spring boot application running with Java 17 which has been to deployed to azure spring apps and it is up and running. Recently, I have upgraded to Java 21 as well as Spring boot version to v3.3.3. The application is up and running on my local machine with latest versions. But, when I try to deploy it to azure spring apps, the deployment is getting failed with message says "InternalServerError".

Later, I tried with simple spring demo application with Java 21. I have faced the same issue. Please find the below screenshots for the same. I am getting an option to select Java 21 runtime, but when I am trying to deploy with Java 21 it is failed. The azure spring apps documentation also says Java 21 is supported. I have created Azure spring apps with Standard plan pay as you go, East US region, FYI. Please help me out what is wrong here. Thanks in advance.

Exception or Stack Trace image

To Reproduce Steps to reproduce the behavior:

Code Snippet Add the code snippet that causes the issue.

Expected behavior The deployemnt should be succeeded as it is shown for other applications with Java 17.

Screenshots Screenshot from 2024-09-17 10-26-58 Screenshot from 2024-09-17 10-26-24 Screenshot from 2024-09-17 10-25-34 Screenshot from 2024-09-17 10-24-42

Setup (please complete the following information):

github-actions[bot] commented 1 month ago

@moarychan @netyyyy @rujche @saragluna

github-actions[bot] commented 1 month ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

saragluna commented 1 month ago

@kirankumar994 Seems like not an issue related to the Spring Cloud Azure library but will ask the Azure Spring Apps folks to help take a look at it.

kirankumar994 commented 1 month ago

Thank you for your reply, @saragluna . Could you please get it resolved as soon as possible as the new release of my application is on hold?

saragluna commented 1 month ago

@kirankumar994 the Azure Spring Apps team is working on it now.

TobiasB91 commented 1 month ago

My company's application is blocked by this bug as well.

saragluna commented 1 month ago

Azure Spring Apps updates that the fix has been out. Could you please help check again?

TobiasB91 commented 1 month ago

Thanks for the quick response! I tried to recreate my app this morning, but even though the InternalServerError is gone I'm not able to start my app. My AppEnvSpringAppConsoleLogs logs "Error occurred during initialization of VM" and "Too small maximum heap".

kirankumar994 commented 1 month ago

Thanks for your reponse, @saragluna . I am able to deploy it with Java 21 only by uploading the jar file directly on the portal.

Screenshot from 2024-10-03 10-08-04

Screenshot from 2024-10-03 10-39-18

But, however the application deployment is still failing from the pipelines. I am using the below plugin to deploy my application to the Azure spring apps. I have also created a separate app to double check the issue, but no luck though. I think it is always taking the default or the first option i.e., Java 11 even though I am giving run time version Java_21 in the plugin. Seems like the plugin issue. When I am trying to deploy with "az spring app deploy" cmd with the respective arguments as below, it is success.

cmd: az spring app deploy -n dms-backend -s dms-apigateway -g plevenn-plm-dev-reg --artifact-path dms-launcher/target/dms-launcher-0.0.1-SNAPSHOT.jar --runtime-version Java_21

image

I am getting the below error when I try to deploy with the below cmd. "mvn azure-spring-apps:deploy"

image (1)

kirankumar994 commented 1 month ago

Hi @saragluna , hope you had a chance to look at my comment. However, I managed to deploy my application with the below cmd in my pipelines.

"az spring app deploy"

Seems like the issue lies on the plugin side where it doesn't have Java 21 runtime version, so it is taking Java 11 by default. Thanks for looking into it.

saragluna commented 1 week ago

Closing this issue now, please reopen it if there is further issue.