Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in AzureIoTHubClient_ProcessLoop #388

Open
amolchor20 opened this issue Jan 5, 2024 · 2 comments
Open

Error in AzureIoTHubClient_ProcessLoop #388

amolchor20 opened this issue Jan 5, 2024 · 2 comments

Comments

@amolchor20
Copy link

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Integrate the mbedTLS library in azure middleware to use TLS_send and TLS_recv.
execute the code and connect to IoT hub, wait for AzureIoTHubClient_ProcessLoop function to execute.

Any log messages given by the failure

[2024-01-05_15:29:42:471][ERROR] [TlsTransport] [transport_tls_socket_using_mbedtls.c:904] Failed to read data: mbedTLSError[-8]= : BIGNUM - The buffer is too small to write to.
[2024-01-05_15:29:42:471][ERROR] [MQTT] [core_mqtt_serializer.c:2394] A single byte was not read from the transport: transportStatus=-8.
[2024-01-05_15:29:42:493][ERROR] [MQTT] [core_mqtt.c:1319] Receiving incoming packet length failed. Status=MQTTRecvFailed
[2024-01-05_15:29:42:493][ERROR] [MQTT] [core_mqtt.c:2191] Exiting process loop due to failure: ErrorStatus=MQTTRecvFailed

Expected/desired behavior

It should be process the received data and complete the workflow of data receive from cloud/sender.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
I am working on stm32u585 board and integrated azure middleware.
to work with TLS_send and TLS_recv I have integrated the mbedTLS 3.4.0 in it.

Versions

mbedTLS 3.4.0

Mention any other details that might be useful


Thanks! We'll be in touch soon.

@ericwol-msft
Copy link
Collaborator

This error is coming from the BIGNUM lib in the mbed TLS stack, which is an external component to this repo.

This might be relevant.
https://forums.mbed.com/t/bignum-the-buffer-is-too-small-to-write-to/11693

@amolchor25
Copy link

amolchor25 commented Feb 19, 2024

@ericwol-msft
Thanks for your reply !!
here are the detailed logs:
basically the processloop error is caused by timeout.

[2024-02-19_11:08:15:556]ip4_output_if: call netif->output()
[2024-02-19_11:08:15:582]pbuf_alloc(length=0)
[2024-02-19_11:08:15:582]pbuf_alloc(length=0) == 0x2000e75c
[2024-02-19_11:08:15:582]lwip_recv_tcp: netconn_recv err=-3, 073581.lwip_recv_tcp: p == NULL, error is "Timeout."!
[2024-02-19_11:08:15:582]lwip_recvfrom(0): addr=23.98.104.211 port=8883 len=-1
[2024-02-19_11:08:15:582]in_left: zu, nb_want: zu

[2024-02-19_11:08:15:632][ERROR] [TlsTransport] [transport_tls_socket_using_mbedtls.c:906] Failed to read data: mbedTLSError[-1]= : ERROR - Generic error.

[2024-02-19_11:09:02:097]pbuf_alloc(length=1)
[2024-02-19_11:09:02:097]pbuf_alloc(length=1) == 0x2000e54c
[2024-02-19_11:09:02:097]tcpip_inpkt: PACKET 0x2000e54c/0x20007498
[2024-02-19_11:09:02:097]pbuf_free(0x2000e54c)
[2024-02-19_11:09:02:097]pbuf_free: deallocating 0x2000e54c
[2024-02-19_11:09:02:838][ERROR] [MQTT] [core_mqtt_serializer.c:2394] A single byte was not read from the transport: transportStatus=-1.

[2024-02-19_11:09:16:383]pbuf_alloc(length=1)
[2024-02-19_11:09:16:383]pbuf_alloc(length=1) == 0x2000e54c
[2024-02-19_11:09:16:383]tcpip_inpkt: PACKET 0x2000e54c/0x20007498
[2024-02-19_11:09:16:383]pbuf_free(0x2000e54c)
[2024-02-19_11:09:16:383]pbuf_free: deallocating 0x2000e54c
[2024-02-19_11:09:33:264]pbuf_alloc(length=1)
[2024-02-19_11:09:33:264]pbuf_alloc(length=1) == 0x2000e54c
[2024-02-19_11:09:33:264]tcpip_inpkt: PACKET 0x2000e54c/0x20007498
[2024-02-19_11:09:33:264]pbuf_free(0x2000e54c)
[2024-02-19_11:09:33:264]pbuf_free: deallocating 0x2000e54c
[2024-02-19_11:09:34:541][ERROR] [MQTT] [core_mqtt.c:1319] Receiving incoming packet length failed. Status=MQTTRecvFailed

[2024-02-19_11:09:49:731][ERROR] [MQTT] [core_mqtt.c:2191] Exiting process loop due to failure: ErrorStatus=MQTTRecvFailed

[2024-02-19_11:10:19:922]pbuf_alloc(length=1)
[2024-02-19_11:10:19:922]pbuf_alloc(length=1) == 0x2000e54c
[2024-02-19_11:10:19:922]tcpip_inpkt: PACKET 0x2000e54c/0x20007498
[2024-02-19_11:10:19:922]pbuf_free(0x2000e54c)
[2024-02-19_11:10:19:922]pbuf_free: deallocating 0x2000e54c
[2024-02-19_11:10:20:239]Wait for properties sub ack failed: error=0x00000001

if there is no data from cloud to device, then how the azure middleware will handle the processloop timeout error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants