Share via

Error while running the container apps.

Gaurav Tamkoria 0 Reputation points
2025-03-31T17:07:21.3566667+00:00

I am getting this error while running container app.

"Msg":"Container \u0027ns-dbs-service\u0027 was terminated with exit code \u00271\u0027","Reason":"Error","EventSource":"ContainerAppController","Count":12}

It was running fine till last week and then it stopped with this error suddenly.

Azure Container Apps
Azure Container Apps

An Azure service that provides a general-purpose, serverless container platform.


1 answer

Sort by: Most helpful
  1. Loknathsatyasaivarma Mahali 2,690 Reputation points Moderator
    2025-03-31T20:20:01.55+00:00

    Hello Gaurav Tamkoria,

    Encountering the error 'Container ns-dbs-service was terminated with exit code 1' signals that your application within the container is experiencing a failure. If you run into this error, check these to determine cause, this generic error code points to an abnormal termination, likely stemming from application crashes due to unhandled exceptions, misconfigurations such as incorrect environment variables or startup commands, or resource constraints where the container exceeds its allocated limits.

    To effectively diagnose this issue, your primary focus should be on examining the container's logs. These logs are critical, as they provide detailed error messages and stack traces that reveal the precise cause of the termination. Alongside log analysis, carefully review your container's configuration settings and leverage Azure's diagnostic tools for deeper insights into the container's lifecycle.

    To Access Container Logs: 

    • In Azure portal, In the left-hand navigation, under the "Monitoring" section, select "Log stream" or "Logs". Choose the ns-dbs-service container from the dropdown menu and examine the logs for error messages, stack traces, or warnings that precede the termination. Pay close attention to any database connection errors, file access issues, or application-specific exceptions. 

    To review Recent Revisions and Changes: 

    • In the left-hand navigation, under the "Application" section, select Revisions and review the revision history to identify any recent deployments or configuration changes. If a recent revision correlates with the start of the issue, consider rolling back to a previous, known-good revision. Also in the application section, check the configuration menu, to review environment variables, and container settings. 

    And to check Environment Variables:

    • In the left-hand navigation, under the "Application" section, select Configuration and review the environment variables configured for your container app, then verify that all necessary variables, especially those related to database connections or external services, are correctly set.

    Also, for better understanding please refer to this document.

    Was this answer helpful?


Your answer

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