question

Omar-7550 avatar image
0 Votes"
Omar-7550 asked Omar-7550 commented

edge module remains in initial CREATED state after applying new Manifest

A script is being used to apply an initial template where a container is set to stopped followed by another CLI command to apply a new deployment manifest JSON. The second command is applied after a few local system processes conclude.

sudo az iot edge set-modules --hub-name "$IOT_HUB_NAME" --device-id "$DEVICE_ID" --content "$manifestFileStopped" --only-show-error -o table

sudo az iot edge set-modules --hub-name "$IOT_HUB_NAME" --device-id "$DEVICE_ID" --content "$manifestFileRunning" --only-show-error -o table


The second command does not change the state of the container module to running no certain virtual machines. Has anyone else encountered a similar issue?

197058-created.png




azure-iot-hubazure-iot-edgeazure-iot-dps
created.png (90.4 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @Omar-7550,

it seems this smartling... module stays in Created state.

Is it possible to see any log information of this module?

 sudo iotedge logs -f [modulename]
1 Vote 1 ·
Omar-7550 avatar image Omar-7550 SandervandeVelde42 ·

that command was not able to return anything.

sudo docker start [modulename]


mentions bind address in use
197040-already-in-use-copy.png


0 Votes 0 ·

1 Answer

SandervandeVelde42 avatar image
0 Votes"
SandervandeVelde42 answered Omar-7550 commented

Hello @Omar-7550,

it's hard to say why your module does not start as expected without all information (deployment manifest, purpose, code).

It feels like your module is created to ingest data from some source and sends it to the database or the blob storage.

If this is a module you created yourself, make it more defensive regarding the surroundings. If you do not catch exceptions, Docker/Moby will handle the module as crashed and try to restart it (conform to the restart policy).

Next to that, I see this "bind: address already in use" message. So, it seems the container create options are not correct.

Please double-check the Container Create options.

I recommend to start with a simple test module to be sure the code and configuration works as expected (if hope you are familiar with 'baby steps' coding kata).

Regarding killing the process, normally it's not needed in combination with Azure IoT Edge. Modules should be smart/robust enough to handle deployment manifest deployments in a graceful way.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

 #add these lines before applying the new manifest
    
 pid=`pidof process_name`
 kill -9 $pid

https://stackoverflow.com/a/17440677/7117688

1 Vote 1 ·

Thank you. The initial template did not need to open ports for the initial step of data ingestion.

0 Votes 0 ·