Having some problems while trying to Develop IoT Edge modules using Visual Studio Code

Pritam Chanda 45 Reputation points
2024-08-13T06:41:17.9666667+00:00

I was following this doc and then while I was setting up the module in logs these problems were shown:
<6>Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. <6>Microsoft.Hosting.Lifetime[0] Hosting environment: Production <6>Microsoft.Hosting.Lifetime[0] Content root path: /app <4>filtermodule.ModuleBackgroundService[0] Connection changed: Status: Disconnected_Retrying Reason: Communication_Error <6>Microsoft.Hosting.Lifetime[0] Application is shutting down... <4>filtermodule.ModuleBackgroundService[0] Connection changed: Status: Disconnected Reason: Retry_Expired <3>Microsoft.Extensions.Hosting.Internal.Host[9] BackgroundService failed Microsoft.Azure.Devices.Client.Exceptions.IotHubCommunicationException: Transient network error occurred, please retry. ---> DotNetty.Codecs.DecoderException: Exception of type 'DotNetty.Codecs.DecoderException' was thrown. ---> System.AggregateException: One or more errors occurred. (The decryption operation failed, see inner exception.) ---> System.IO.IOException: The decryption operation failed, see inner exception. ---> Interop+OpenSsl+SslException: Decrypt failed with OpenSSL error - SSL_ERROR_SSL. ---> Interop+Crypto+OpenSslCryptographicException: error:0A000119:SSL routines::decryption failed or bad record mac --- End of inner exception stack trace --- at Interop.OpenSsl.Decrypt(SafeSslHandle context, Span1 buffer, SslErrorCode& errorCode) at System.Net.Security.SslStreamPal.DecryptMessage(SafeDeleteSslContext securityContext, Span1 buffer, Int32& offset, Int32& count) --- End of inner exception stack trace --- at System.Net.Security.SslStream.ReadAsyncInternalTIOAdapter at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at System.Threading.Tasks.ValueTask1.GetTaskForValueTaskSource(IValueTaskSource1 t) --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at DotNetty.Handlers.Tls.TlsHandler.Unwrap(IChannelHandlerContext ctx, IByteBuffer packet, Int32 offset, Int32 length, List1 packetLengths, List1 output) at DotNetty.Handlers.Tls.TlsHandler.Decode(IChannelHandlerContext context, IByteBuffer input, List1 output) at DotNetty.Codecs.ByteToMessageDecoder.CallDecode(IChannelHandlerContext context, IByteBuffer input, List1 output) --- End of inner exception stack trace --- at DotNetty.Codecs.ByteToMessageDecoder.CallDecode(IChannelHandlerContext context, IByteBuffer input, List1 output) at DotNetty.Codecs.ByteToMessageDecoder.ChannelRead(IChannelHandlerContext context, Object message) at DotNetty.Transport.Channels.AbstractChannelHandlerContext.InvokeChannelRead(Object msg) --- End of stack trace from previous location --- at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttTransportHandler.OpenInternalAsync(CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttTransportHandler.OpenAsync(CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.OpenAsync(CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass27_0.<<ExecuteWithErrorHandlingAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsyncT --- End of inner exception stack trace --- at Microsoft.Azure.Devices.Client.TransientFaultHandling.RetryPolicy.RunWithRetryAsyncT at Microsoft.Azure.Devices.Client.TransientFaultHandling.RetryPolicy.RunWithRetryAsync(Func1 taskFunc, ShouldRetry shouldRetry, Func2 isTransient, Action3 onRetrying, Boolean fastFirstRetry, CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.OpenInternalAsync(Boolean withRetry, CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(Boolean withRetry, CancellationToken cancellationToken) at filtermodule.ModuleBackgroundService.ExecuteAsync(CancellationToken cancellationToken) in /home/vboxuser/iotedge/modules/filtermodule/ModuleBackgroundService.cs:line 33 at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService) <2>Microsoft.Extensions.Hosting.Internal.Host[10] The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will not be restarted. Microsoft.Azure.Devices.Client.Exceptions.IotHubCommunicationException: Transient network error occurred, please retry. ---> DotNetty.Codecs.DecoderException: Exception of type 'DotNetty.Codecs.DecoderException' was thrown. ---> System.AggregateException: One or more errors occurred. (The decryption operation failed, see inner exception.) ---> System.IO.IOException: The decryption operation failed, see inner exception. ---> Interop+OpenSsl+SslException: Decrypt failed with OpenSSL error - SSL_ERROR_SSL. ---> Interop+Crypto+OpenSslCryptographicException: error:0A000119:SSL routines::decryption failed or bad record mac --- End of inner exception stack trace --- at Interop.OpenSsl.Decrypt(SafeSslHandle context, Span1 buffer, SslErrorCode& errorCode) at System.Net.Security.SslStreamPal.DecryptMessage(SafeDeleteSslContext securityContext, Span1 buffer, Int32& offset, Int32& count) --- End of inner exception stack trace --- at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory1 buffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) at System.Threading.Tasks.ValueTask1.GetTaskForValueTaskSource(IValueTaskSource1 t) --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at DotNetty.Handlers.Tls.TlsHandler.Unwrap(IChannelHandlerContext ctx, IByteBuffer packet, Int32 offset, Int32 length, List1 packetLengths, List1 output) at DotNetty.Handlers.Tls.TlsHandler.Decode(IChannelHandlerContext context, IByteBuffer input, List1 output) at DotNetty.Codecs.ByteToMessageDecoder.CallDecode(IChannelHandlerContext context, IByteBuffer input, List1 output) --- End of inner exception stack trace --- at DotNetty.Codecs.ByteToMessageDecoder.CallDecode(IChannelHandlerContext context, IByteBuffer input, List1 output) at DotNetty.Codecs.ByteToMessageDecoder.ChannelRead(IChannelHandlerContext context, Object message) at DotNetty.Transport.Channels.AbstractChannelHandlerContext.InvokeChannelRead(Object msg) --- End of stack trace from previous location --- at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttTransportHandler.OpenInternalAsync(CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.Transport.Mqtt.MqttTransportHandler.OpenAsync(CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.Transport.ProtocolRoutingDelegatingHandler.OpenAsync(CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass27_0.<<ExecuteWithErrorHandlingAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsyncT --- End of inner exception stack trace --- at Microsoft.Azure.Devices.Client.TransientFaultHandling.RetryPolicy.RunWithRetryAsyncT at Microsoft.Azure.Devices.Client.TransientFaultHandling.RetryPolicy.RunWithRetryAsync(Func1 taskFunc, ShouldRetry shouldRetry, Func2 isTransient, Action`3 onRetrying, Boolean fastFirstRetry, CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.OpenInternalAsync(Boolean withRetry, CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.EnsureOpenedAsync(Boolean withRetry, CancellationToken cancellationToken) at filtermodule.ModuleBackgroundService.ExecuteAsync(CancellationToken cancellationToken) in /home/vboxuser/iotedge/modules/filtermodule/ModuleBackgroundService.cs:line 33 at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService) <6>Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. <6>Microsoft.Hosting.Lifetime[0] Hosting environment: Production <6>Microsoft.Hosting.Lifetime[0] Content root path: /app <4>filtermodule.ModuleBackgroundService[0] Connection changed: Status: Disconnected_Retrying Reason: Communication_Error

For now I am using Ubuntu in VBox as Development machine cross-compiles as ARM64 and target device is Jetson Orin board.

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.
576 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,198 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.