Msgbroker Azure IotEdge errors with multiple configs deepstream-app

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Both
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only) 4.4
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs) bugs
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing) Using deepstream-app5 with multiple configs with -c -c. It works perfectly using multiple msgbrokers when i test using ampq but when I use azure edge I get the below error:

Error: Time:Tue Oct  6 22:54:44 2020 File:/home/nvidia/azure/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:tlsio_openssl_init Line:1059 Failed to install static locks in OpenSSL!
Error: Time:Tue Oct  6 22:54:44 2020 File:/home/nvidia/azure/azure-iot-sdk-c/iothub_client/src/iothub.c Func:IoTHub_Init Line:16 Platform initialization failed
nvds_msgapi_connect: Failed to initialize the platform.

This is shown after the second msgbroker tries to start.

Error: Time:Tue Oct  6 22:54:44 2020 File:/home/nvidia/azure/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:openssl_static_locks_install Line:532 Locks already initialized
Error: Time:Tue Oct  6 22:54:44 2020 File:/home/nvidia/azure/azure-iot-sdk-c/c-utility/adapters/tlsio_openssl.c Func:tlsio_openssl_init Line:1059 Failed to install static locks in OpenSSL!
Error: Time:Tue Oct  6 22:54:44 2020 File:/home/nvidia/azure/azure-iot-sdk-c/iothub_client/src/iothub.c Func:IoTHub_Init Line:16 Platform initialization failed
nvds_msgapi_connect: Failed to initialize the platform.

That is the full error

Appears to be the same as this issue https://github.com/Azure/azure-iot-sdk-c/issues/276, will need to share the IoTHub Client handle from first broker to the second one.

Looking at the two azure libraries, module and device client, it appears that device client has the ability to share the connection using

----------------
#share-connection=1
Uncomment the field share-connection in cfg_azure.txt and set its value to 1
if you need to generate a connection signature. This signature is a unique string
which is generated by parsing all the azure connection related params
used for making a connection
Uncommenting this field signifies that the connection created can be shared
with other components within the same process.

I have tried and this has no effect in module library. Anyone from Nvidia able to comment on if this feature is able to be ported to module as well as device client?

Hi,
Sorry for a late reply.
Are you saying device client support share-connection, but module client do not?
and we do not support this feature in module client, will check if it’a a valid feature and if we will support.

Yeah device client support share-connection but module does not

Azure module client works only when the app is run from inside a docker environment. The Azure iotedge connection string is specified within /etc/iotedge/config.yaml and not within a deepstream config. So as such, share-conneciton option in DS config doesn’t have any effect on Azure iotedge. Rather all the DS based dockers running on the system use the same Azure connection string specified in the /etc/iotedge/config.yaml file and hence they all share just 1 azure connection string. azure module client(iot edge) connection string is by default shared with all the containers using azure module client.

Yeah so the issue is if you have one Deepstream Docker but want to run the deepstream-app with multiple configs using -c -c , you get the above errors. In the meantime I did just create a different deepstream docker for each config