-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Spring Boot 2.7.8 application cannot be reached in Azure #33974
Comments
Thanks for the report. Unfortunately, if no HTTP requests are reaching the container then don't think we'll be able to help as Spring Boot isn't responsible for deciding if requests should be routed to the container. It's Azure that makes this routing decision. It may be that something has changed in 2.7.8 that's affecting this decision, but without knowing the precise details of how Azure behaves, there's nothing we can do here. Please reach out to Microsoft for some support on the Azure side. If they identify why requests aren't being routed to the application and it is caused by Spring Boot, please comment here and we can re-open the issue and take another look. |
Hi @wilkinsona , |
Hello @Telamon-m, |
Sorry, I misunderstood what you meant by "No http request reaches the spring container". If the suggestion from @bclozel does not help, please describe the problem as precisely as possible and provide an example of an HTTP request-response exchange showing the exact details (URI, headers, body, and so on) of both the request and response. |
I'm facing the same issue (also Spring Boot 2.7.7 to Spring Boot 2.7.8, no other changes). I use spring-actuator and as an example this fails:
Response:
|
@marcomima I guess the request you're sharing is from the point of view of the client? It would be interesting to see the same from the server's perspective. Could you add to your application a simple Servlet filter that logs the One more thing, could you try downgrading to Tomcat 9.0.70 with the following in your build.gradle or pom.xml file? ext['tomcat.version'] = '9.0.70' <properties>
<tomcat.version>9.0.70</tomcat.version>
</properties> Trying these options should help us narrow down where the problem comes from. |
@bclozel Yes, it was from the clients view, I haven't configured any specific Servlet mappings. Downgrading to Tomcat 9.0.70 makes the application work again! |
We We have now switched to the current version 3.4.8 which does not have this issue. |
@marcomima the fact that Tomcat 9.0.70 works with Spring Boot 2.7.8 leads me to think that this is indeed a Java agent issue - probably an instrumentation not being compatible with a Tomcat change. If the request is not even reaching a Servlet Filter and there is not specific Servlet mapping setup, this looks really out of Spring Boot's control. Can you have a look at the java launch command, maybe another agent is being applied? @derkoe thanks for letting us know, this is indeed consistent with the symptoms here. @Telamon-m could you provide the information I've requested here, but for your case? |
Yes, there was Azure also adding the Java-Agent. After turning that off it works just fine with the latest (3.4.8) java-agent: |
Thanks very much, @marcomima. @Telamon-m Does this work for you too? |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
@marcomima I am not using a docker image, but I directly deploy to a "java app" and I am encountering the same issue. It works with 2.7.7 but not with 2.7.8. How can we use your fix in an app? |
@florentbo have you checked the java -jar and what parameters are passed in to the app.jar? If there is no java-agent there it looks like another issue altogether |
@marcomima where can I configure this java -jar execution? stages:
|
@florentbo I don't know your environment and how java app work in Azure and how the application is started. Maybe in the logs of the Deployment Center you'll find the start of the application? |
There are over 3000 people watching this repository who may be receiving a notification for every comment on this issue. As such, unfortunately, it's not a good place to diagnose Azure's behavior and the details of how it deploys an app. In the absence of any follow up from @Telamon-m and all the evidence pointing towards this being a Java agent problem that's out of Spring Boot's control, I am going to close this issue. @florentbo you may want to reach out to Microsoft support to learn how they configure the JVM and how you can ensure that either no agent is used or that the agent is up-to-date. |
Hi @wilkinsona , |
Hello, for information for others having this issue, I encountered this with an older version of opentelemetry agent. |
I experienced the same problem when upgrading my Azure Web App Service from using Spring Boot 2.5.5 to 3.0.4 |
Thank you, you saved my day! |
So this whole Java 17 thing on Azure has been quite an experience. We dealt with the 404 issue for some time by disabling app insights (which is obviously not a good thing), then when the 3.4.x agent got released that finally got fixed, but now we are fighting logging issues that were not there with Java 11, so am curious if anyone else is seeing the same behavior as us. We are using the codeless agent and with Java 11 all that was required was to include the following dependencies in our deployment. The logging framework we are using is the slf4j implementation from lombok. <dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-spring-boot-starter</artifactId>
<version>2.6.4</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-logging-logback</artifactId>
<version>2.6.4</version>
</dependency> With that all our app logs ended up as expected in Log Analytics. However, with Java 17 and the 3.4.10 agent, in order for our app logs to make it to Log Analytics, we now need to also include at a minimum the following logback.xml in our deployment as well: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<appender name="aiAppender"
class="com.microsoft.applicationinsights.logback.ApplicationInsightsAppender">
</appender>
<root level="info">
<appender-ref ref="aiAppender" />
</root>
</configuration> This is no big deal, but what we are also observing which is much more impactful is that with the 3.4.10 agent, the "cloud_RoleName" field and some others as well are not get populated anymore in log analytics. We have multiple apps leveraging the same application insights resource and the cloud_RoleName is the one field that allowed us to write queries that would filter just the app logs you were interested in. With Java 11 and the older agents, the cloud_RoleName was automatically populated for us. I am curious if anyone else is observing this and should I create an issue for this? |
I was tired to configure our logs like this and so we pushed the logs on ELK following these 2 repos: |
@my3sons looks like Java 18 support was added in agent 3.3.1 so you could try downgrading and see if that fixes your role name problem https://github.com/microsoft/ApplicationInsights-Java/releases/tag/3.3.1 I would suggest either submitting an issue in their GitHub project or send a pr to fix it yourself. I’ve sent PRs to Microsoft and they’ve merged them. |
@florentbo: Just for your information: You can change the Application Insights Java Agent version under the configuration of the App Service. For me it was ~3 and together with Spring Boot 2.7.9 the App Service didn't serve any traffic to my application. After updating the agent version to 3.4.10 it worked again. |
@sbarsbar1, as already mentioned. I update the agent version to 3.4.10 it worked again. No 404. But no more logs :( |
I have a similar issue. When updating tomcat to 9.0.73, requests started to return 404 when using Application Insights auto instrumentation. When I turned it off, requests started working again. Reverting tomcat to older version 9.0.70 or disabling insights completely seems to help so there is some kind of issue using newer tomcat and older insights. If my App Service currently has set "ApplicationInsightsAgent_EXTENSION_VERSION": "~3", which seems to default to insights agent 3.2.11 as of this writing. Updating this value to 3.4.10 initially seemed to work, but I think that simply made so that insights is not added at all. When inspecting startup logs, i could see that the agent was injected when using ~3 but not when using 3.4.10. I then read in the docs that this app config only controls if its windows or linux?
It seems to be that ìn order to actual control the version, you will have to download the agent "manually" with a shell script or similar in the container. Or wait until Microsoft updates the default agent version in App Services application insights auto instrumentation. Sadly, there is no way to control the version using app config. |
Is there a way to specify this
@antgustech, Could you share with us how did you manage to find out this piece of information? |
Yes, got confirmation from Azure support. There are 3 possible solutions: 1.It is possible to download and upload a newer agent to app service and then injecting it with startup command. I simply reverted our tomcat change as I don't have time to deal with this right now. |
In my case was a bit different, which could be confused with this problem. Spring boot generates a .war that I could execute with java -jar app.war, but in deployment in GitHub Actions, I changed their name to app.jar to upload as a single file, this caused the 404 error. To solve this I deploy the war into a zip with |
I'm using Spring boot within a Docker image on Azure (App Service).
After upgrading from Spring Boot 2.7.7 to 2.7.8 no request reaches the spring container any more, Tomcat responds with 404 to all requests.
The strange thing is that everything is working locally within the IDE as well as when running the Docker image locally: The exact same image with the same env variables as in Azure is running locally.
Within the Azure App Service the application starts successfully, however absolutely no request is processed. Even actuators are not reachable. Tomcat responds with a 404 to every request.
After downgrading my app to 2.7.7 everything works again in Azure App Service. (The Spring Boot downgrade was the only change.)
I attached the logfiles where you can see that the application was started successfully, however there is no more log produced, except from scheduled tasks. No http request reaches the spring container.
Spring Boot 2.7.8 issue.log
The text was updated successfully, but these errors were encountered: