Java web app not responding to HTTP pings on port

afcec 21 Reputation points
2022-02-25T06:58:43.437+00:00

Hello,

I have developed a function app (EventHubTrigger) consuming the events of my Event Hub. I am using Java 11 with Maven and deploying to a Linux app service. Everything works just fine in my computer but it fails when I deploy the application and run it on Azure. The error is the following:

ERROR - Container XXXXXXXXXXX for site YYYYYYYYYY has exited, failing site start2022-02-24T14:24:03.236Z ERROR - Container XXXXXXXXX didn't respond to HTTP pings on port: PP, failing site start. See container logs for debugging.2022-02-24T14:24:03.240Z INFO - Stopping site XXXXXXXXXX because it failed during startup.

I have spent yesterdat the whole day looking for a solution for this issue with no luck. I was initially deploying the application using Azure Web App Maven Plugin, then I changed to Docker using a container registry with the same resuslts.

I have also changed the port from 80, 8080, 3000, 5005, etc... I have exposed properly my port in the Dockerfile when needed and I have also tried to configure PORT and WEBSITES_PORT in the application settings.

My last attempt was to add also another function based on HTTPTrigger just to make sure that the application is listening on a port and nothing changes, same error. I have several other app services running in the same App Service Plan and all of them are running just fine ( API, broker, etc...) although the runtime is Java 8.

As I said, I have checked almost all the similar issues published on the web and tried all the possible alternatives described... Can you please help? Thanks

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,783 questions
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 21,586 Reputation points
    2022-03-02T07:40:21.753+00:00

    Thanks for asking question! If the container couldn't start or exited, There is possibility that Application may be facing any error or exception.

    To narrow down the issue you can check the Docker log, Which is helpful in troubleshooting your site when it doesn't start or if it's restarting.

    There are several ways to access Docker logs.

    • Docker logs appear on the Container Settings page in the portal. (These are truncated, but you can download them by clicking on the Download Logs button.)
    • You can find the Docker log in the /LogFiles directory. You can access this via the Kudu (Advanced Tools) Bash console or by using an FTP client to access it.
    • You can use our API to download the current logs. (See "You can discover and download the latest Docker logs using Kudu" in this post for info on that.) The naming convention for the Docker log is YYYY_MM_DD_RDxxxxxxxxxxxx_docker.log .

    Or Click https://<appname>.scm.azurewesites.net/api/logs/docker words to access your logs and review them by opening the files with the default_docker.log.

    Or

    Click https://<appname>.scm.azurewesites.net/api/logstream to access the LogStream

    You may also leverage diagnostic tool from the Azure Portal and select Application logs ; Container issues; container crash which helps in
    investigating potential reasons why your container failed to start, which could cause deployment and availability issues.

    179153-demo-microsoft-azure.png

    179201-performance-microsoft-azure.png

    Let us know if further query or issue remains.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Manu Philip 18,561 Reputation points MVP
    2022-02-25T09:11:56.78+00:00

    One of the reason you haven't identified could be HTTP 404 (Not Found) error handler is not set to handle any error found during the startup
    Set WEBSITES_PORT as follows from az cli:
    az webapp config appsettings set --resource-group <resource-group-name> --name <webapp-name> --settings WEBSITES_PORT=8000


    If the Answer is helpful, please click "Accept Answer" and upvote it

    0 comments No comments

  2. afcec 21 Reputation points
    2022-03-16T11:55:06.923+00:00

    Hi, it was all due to missing parameters in the application settings. @SnehaAgrawal-MSFT , your comment really helped.

    Now everything is working as expected. Thank you!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.