The IoT Edge Module is in Backoff state

Sibeesh Venu 21 Reputation points
2020-08-04T16:53:30.913+00:00

I have developed a module and built the image for arm64v8 architecture as my Edge device is running in Raspberry Pi 4. I got the file deployment.arm64v8.json in the config folder correctly. But when I right-click on the device in Visual Studio Code and select Create Deployment for Single Device, the modules are getting added, but one of the modules is showing Backoff state. What could be the problem here, and was strictly following this doc.

89305276-bf276c80-d66e-11ea-8fd5-9faf53d22e2f.png

Current Behavior

Only one module "SendTelemetry" is in Backoff state.

Device Information

Host OS: Raspberry OS
Architecture: Arm64v8
Container OS: Linux containers

Runtime Versions

iotedged: iotedge 1.0.9.4
Edge Agent [image tag (e.g. 1.0.0)]:
Edge Hub [image tag (e.g. 1.0.0)]:
Docker/Moby [run docker version]:

89305954-8dfb6c00-d66f-11ea-9341-52dba5755188.png

Am I missing anything here?

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
373 questions
Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
525 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,093 questions
0 comments No comments
{count} votes

Accepted answer
  1. QuantumCache 20,021 Reputation points
    2020-08-04T20:27:30.893+00:00

    Hello @Sibeesh Venu , Thanks for reaching out to us!.
    Below is the same thread:

    Related to: https://github.com/Azure/iotedge/issues/3353

    Are you able to debug your module on your Dev Machine before deploying it?

    So before we deploy our module, we make sure it is working properly, for this, we have tools provided by Microsoft that need to be installed on VS2019 or VS Code.

    Please follow this document, I always make use of this,

    Use Visual Studio 2019 to develop and debug modules for Azure IoT Edge

    Use Visual Studio Code to develop and debug modules for Azure IoT Edge

    Below is my sample VS2019 IDE snap, where I have the SendTelemetry module, always do debug before deploying it on my Raspberry Pi 3.

    15587-image.png

    Update 08/07/2020
    Thanks to Sibeesh Venu who posted the entire resolution from his research on this issue, worked with the Microsoft team, and posted the complete resolution on Stackoverflow.

    Below is the Quote:

    There were a couple of issues where I was doing wrong. First thing is that I was trying to build an arm64 image in my 64 bit Windows Dev Machine and then deploy the image to the arm32 Raspbian OS, which will never work. You can see the version and other details by running the below commands.

    enter image description here

    If it says aarch64 then it is 64 bit. If it says armv7l then it is 32 bit. In my case, it is arm71. So now I had to build an arm32 container images on my 64 bit Windows Host machine and use it on my Raspberry Pi 4. According to this doc, it is definitely possible.

    You can build ARM32 and ARM64 images on x64 machines, but you will not be able to run them

    Running was not my problem, as I just had to build the image and I will use it in my Raspberry Pi. To make it work, I had to change my Dockerfile.arm32v7, specifically the first line where we pull the base image

    FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build-env  
    WORKDIR /app  
      
    COPY *.csproj ./  
    RUN dotnet restore  
      
    COPY . ./  
    RUN dotnet publish -c Release -o out  
      
    FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm32v7  
    WORKDIR /app  
    COPY --from=build-env /app/out ./  
      
    RUN useradd -ms /bin/bash moduleuser  
    USER moduleuser  
      
    ENTRYPOINT ["dotnet", "SendTelemetry.dll"]  
    

    The "build-env" image should be the same architecture as the host OS, the final image should be the target OS architecture. Once I made the changes to the docker file, I changed the version in the module.json file inside my module folder so that the new image with a new tag will be added to the Container Registry when I use the option Build and Push IoT Edge Solution after right-clicking deployment.template.json, and then I used Create Deployment for Single Device option after right-clicking on the device name in Visual Studio Code. And then when I monitor the device (Start Monitoring Built-in Event Endpoint option), I am getting this output.

    16406-image.png

    0 comments No comments

0 additional answers

Sort by: Most helpful