tutorial-develop-for-linux - Container start fails with error 500
See original GitHub issueExpected Behavior
Follow the tutorial at https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux?view=iotedge-1.4. Expect the tutorial to work as expected, and the SampleModule to start on the VM.
Current Behavior
Module is registered on VM, but cannot start. When you check in the Azure Edge Agent logs on the backend, you get the following error:
System.AggregateException: One or more errors occurred. (Error calling prepare update for module SampleModule: registry operation error: pull image “XXXcontainerrepo.azurecr.io/samplemodule:0.0.1-amd64”)
—> Microsoft.Azure.Devices.Edge.Agent.Edgelet.EdgeletCommunicationException- Message:Error calling prepare update for module SampleModule: registry operation error: pull image “XXXcontainerrepo.azurecr.io/samplemodule:0.0.1-amd64”, StatusCode:500, at: at Microsoft.Azure.Devices.Edge.Agent.Edgelet.Version_2021_12_07.ModuleManagementHttpClient.HandleException(Exception exception, String operation) in /mnt/vss/_work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet/version_2021_12_07/ModuleManagementHttpClient.cs:line 235
at Microsoft.Azure.Devices.Edge.Agent.Edgelet.Versioning.ModuleManagementHttpClientVersioned.Execute[T](Func1 func, String operation) in /mnt/vss/_work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet/versioning/ModuleManagementHttpClientVersioned.cs:line 153 at Microsoft.Azure.Devices.Edge.Agent.Edgelet.Version_2021_12_07.ModuleManagementHttpClient.PrepareUpdateAsync(ModuleSpec moduleSpec) in /mnt/vss/_work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet/version_2021_12_07/ModuleManagementHttpClient.cs:line 214 at Microsoft.Azure.Devices.Edge.Agent.Edgelet.ModuleManagementHttpClient.<>c__DisplayClass26_0.<<Throttle>b__0>d.MoveNext() in /mnt/vss/_work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet/ModuleManagementHttpClient.cs:line 139 --- End of stack trace from previous location where exception was thrown --- at Microsoft.Azure.Devices.Edge.Agent.Edgelet.ModuleManagementHttpClient.Throttle[T](Func
1 identityOperation) in /mnt/vss/_work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet/ModuleManagementHttpClient.cs:line 153
at Microsoft.Azure.Devices.Edge.Agent.Core.Commands.GroupCommand.ExecuteAsync(CancellationToken token) in /mnt/vss/_work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/commands/GroupCommand.cs:line 35
at Microsoft.Azure.Devices.Edge.Agent.Core.LoggingCommandFactory.LoggingCommand.ExecuteAsync(CancellationToken token) in /mnt/vss/_work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/LoggingCommandFactory.cs:line 60
at Microsoft.Azure.Devices.Edge.Agent.Core.Commands.GroupCommand.ExecuteAsync(CancellationToken token) in /mnt/vss/_work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/commands/GroupCommand.cs:line 35
at Microsoft.Azure.Devices.Edge.Agent.Core.LoggingCommandFactory.LoggingCommand.ExecuteAsync(CancellationToken token) in /mnt/vss/_work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/LoggingCommandFactory.cs:line 60
at Microsoft.Azure.Devices.Edge.Agent.Core.PlanRunners.OrderedRetryPlanRunner.ExecuteAsync(Int64 deploymentId, Plan plan, CancellationToken token) in /mnt/vss/_work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/planrunners/OrdererdRetryPlanRunner.cs:line 87
This is very weird as I manually authorized inside the VM using docker login, and was able to pull the image successfully even.
Steps to Reproduce
Provide a detailed set of steps to reproduce the bug.
- Follow tutorial at https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux?view=iotedge-1.4.
Context (Environment)
HOST: Ubuntu 20.04LTS Edge IoT Device: VM running Ubuntu 20.04LTS. Setup was done with version 1.4, but the deployment of the containers downgraded it to 1.2.
Output of iotedge check
Showed no error
Click here
<Paste here between the triple backticks>
Device Information
- Host OS [e.g. Ubuntu 18.04, Windows Server IoT 2019]:
- Architecture [e.g. amd64, arm32, arm64]:
- Container OS [e.g. Linux containers, Windows containers]:
Runtime Versions
- aziot-edged [run
iotedge version
]: - Edge Agent [image tag (e.g. 1.0.0)]:
- Edge Hub [image tag (e.g. 1.0.0)]:
- Docker/Moby [run
docker version
]:
Note: when using Windows containers on Windows, run docker -H npipe:////./pipe/iotedge_moby_engine version
instead
Logs
aziot-edged logs
<Paste here between the triple backticks>
edge-agent logs
<Paste here between the triple backticks>
edge-hub logs
<Paste here between the triple backticks>
Additional Information
Please provide any additional information that may be helpful in understanding the issue.
Issue Analytics
- State:
- Created 10 months ago
- Comments:10 (6 by maintainers)
Hello, sorry for being slow. I am still in West Germany, away from my deployment which lives on the machine in Budapest.
I promise, when I come back, I look at it immediately.
On November 23, 2022 12:22:28 AM GMT+01:00, Robert T Jang @.***> wrote:
With best regards Tam HANNA
– Enjoy electronics, 3D printing and cigars? Join more than 21000 followers on my Instagram at http://www.instagram.com/tam.hanna
I seem to have run into the same issue as well. I double checked the registry credentials in my deployment json and the credentials are correct. My heartbeat module is just the generated C# IoT module template with no modifications.
iotedge check output
edgeAgent Logs Excerpt
EDIT: I was able to resolve my issue. I was using version tags with my container images, but I never made a “latest” tag. Thus my container manifest never had an entry it could resolve for latest. I would include the explicit version tag in my IoT Edge deployment but it would just get removed and default to looking for the “latest” tag which didnt exist, thus the 404 error when trying to pull the container. Making sure I tagged the most recent container with both its explicit version and “latest” fixed the issue and I was able to push modules to my IoT edge devices.