0
votes

I have successfully created an Azure Container Instance, which contains two containers. Both of these containers are stored in an Azure Container Registry. Startup goes fine, the images get pulled from the registry and my containers are running. The application that is exposed through one of the containers is accessible via the internet and runs perfectly.

However, after a few days of operation the containers suddenly fail to pull the image from the registry and they terminate with a "failed to pull image" error message in the container's event log. The full error message is as follows:

Failed to restart the container group 'webtikket'. Error: pulling image
"afsprakenkaart.azurecr.io/tikketapi";Successfully pulled image 
"afsprakenkaart.azurecr.io/tikketapi";Created container;Started container;Back-off restarting failed 
container;pulling image "afsprakenkaart.azurecr.io/tikketapi";Successfully pulled image 
"afsprakenkaart.azurecr.io/tikketapi";Created container;Started container;pulling image 
"afsprakenkaart.azurecr.io/tikketapi";Back-off pulling image 
"afsprakenkaart.azurecr.io/tikketapi";pulling image "afsprakenkaart.azurecr.io/tikketapi";Failed to pull 
image "afsprakenkaart.azurecr.io/tikketapi": rpc error: code Unknown desc Error response from daemon: Get https://afsprakenkaart.azurecr.io/v2/tikketapi/manifests/latest: unauthorized: authentication required, 
visit https://aka.ms/acr/authorization for more information.;Back-off pulling image 
"afsprakenkaart.azurecr.io/tikketapi";pulling image "afsprakenkaart.azurecr.io/webtikket";Successfully pulled image "afsprakenkaart.azurecr.io/webtikket";Created container;Started container;pulling image 
"afsprakenkaart.azurecr.io/webtikket";Successfully pulled image 
"afsprakenkaart.azurecr.io/webtikket";Created container;Started container;pulling image 
"afsprakenkaart.azurecr.io/webtikket";Failed to pull image "afsprakenkaart.azurecr.io/webtikket": rpc error: code Unknown desc Error response from daemon: Get 
https://afsprakenkaart.azurecr.io/v2/webtikket/manifests/latest: unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.;Back-off pulling image 
"afsprakenkaart.azurecr.io/webtikket";pulling image "docker/aci-hostnames-sidecar:1.0";Successfully pulled image "docker/aci-hostnames-sidecar:1.0";Created container;Started container;pulling image 
"docker/aci-hostnames-sidecar:1.0";Successfully pulled image "docker/aci-hostnames-sidecar:1.0";Created container;Started container;pulling image "docker/aci-hostnames-sidecar:1.0";Successfully pulled image 
"docker/aci-hostnames-sidecar:1.0";Created container;Started container

Since nothing has changed since creating the container instance and the moment the access errors started I am completely clueless as to what is going on. Restarting the container instance does not solve the problem, it just give me the same error message. Deleting the container instance and creating it anew via the Azure CLI solves the problem for a few days, after which it comes back, but that is obviously not something I want to do every couple of days.

1
Any updates on this question? Does it solve your problem?Charles Xu

1 Answers

0
votes

There is a possible reason that I know about the issue: If you use the service principal to authenticate for the ACR, then maybe the credential expires, so you can check and extend the period. If you use the admin user and password of the ACR. Then maybe it's a bug. And check the credential for ACR in the configuration of the ACI to confirm the problem.