The Container instance is running but the container cannot find the image even though it exists and was working before

Ondřej Synek 1 Reputation point
2022-12-20T13:05:40.247+00:00

I have a Container instance in Azure that uses an image from Container registries. Right now I am facing an issue with running. The Container instance status was "Running" but the container state was "waiting". I got stuck at 332 restart attempts with an error message that the image was not found. But inside the registries, I can see the image, and if I stop the instance and turn it on again everything is working but I want this to happen automatically.

My question is how to solve this issue and if it is possible to trigger the alert when the container state is not "running".
I can now see and set up alerts only for the Container instance itself.

Thank you for any help on this topic.

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
508 questions
Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
757 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. srbhatta-MSFT 8,586 Reputation points Microsoft Employee
    2022-12-20T14:29:36.733+00:00

    Hello @Ondřej Synek ,
    Welcome to Microsoft QnA.
    It sounds like you are experiencing an issue with your container instance in Azure where the container is unable to find the image it is trying to run, even though the image exists and was previously working. This issue could be caused by a variety of factors, including problems with the container registry or issues with the container configuration.

    To troubleshoot this issue, there are a few steps you can try:

    1. Check the container registry to ensure that the image is available and the tag is correct.
    2. Check the container configuration to ensure that the correct image and tag are specified in the configuration.
    3. Check the container logs for any error messages or other information that may help identify the cause of the issue.
    4. Check the container instance to ensure that it has the necessary resources (e.g. CPU, memory, etc.) to run the container.

    As for setting up alerts for the container state, it is currently not possible to set up alerts for the container state directly in Azure. However, you can set up alerts for the container instance itself and specify the conditions under which the alert should be triggered (e.g. when the instance is down or in an unhealthy state). You can then set up the alert to notify you via email or other notification methods, so that you can take appropriate action to resolve the issue.

    For further queries, feel free to reach back to me and tag me in your response.

    ----------

    Please accept as answer if the above information is helpful.


  2. Lj-MSFT 81 Reputation points Microsoft Employee
    2022-12-20T15:53:10.52+00:00

    @Ondřej Synek : Thank you for your response.

    Kindly let me know if this is the only container running from that image, or if there are multiple containers, and if this is the only container facing this issue or other containers are facing this too. The attempt here is to isolate this issue as narrowly as possible.

    Also, kindly run az container logs --resource-group myResourceGroup --name mycontainer and share the output.

    Regards,
    Lj

    0 comments No comments

  3. Ondřej Synek 1 Reputation point
    2022-12-21T02:49:47.583+00:00

    Hi @Lj-MSFT ,

    It is the only container running from this image.
    Inside the logs, I have only my internal logs from the application. Nothing regarding the container itself.

    As I said, it is strange that it was running okay from August but on the 7th of December it decided to restart by itself, and on restart policy, it never found the image until I stopped the Container instance manually and start it again.

    272616-bez-nazvu.png

    272713-bez-nazvu2.png

    0 comments No comments

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.