Cloud API, HTTP code 400

Tags: #<Tag:0x00007f1cab179a98>


Hello, this is more of an issue report than a question I guess. The cloud API states that:

400 Bad Request - Your request is not understood by the device, or the requested subresource (variable/function) has not been exposed.

While debugging my app today, it seems that my xenon disconnected from the Cloud, thus the cloud function call I was making failed, with the error log bellow. The status code of the request was HTTP 400,
which is not entirely accurate with this issue I guess ? The xenon was already connected to the Cloud, the previous cloud functions worked as expected and later one, what appears as the disconnection bellow occurred. The xenon’s firmware version was 1.1.0-rc2 and I was using the featherwing ethernet module.

0005581064 [comm.protocol] INFO: rcv'd message type=11
0005611209 [comm.protocol] INFO: message id 582 complete with code 0.00
0005611212 [comm.protocol] INFO: rcv'd message type=13
0005613355 [comm.protocol] INFO: rcv'd message type=11
0005615947 [net.en] INFO: Link down
0005615948 [net.ifapi] INFO: Netif en2 link DOWN
0005615950 [system.nm] INFO: State changed: IP_CONFIGURED -> IFACE_UP
0005615958 [comm] INFO: Forcing a cloud ping
0005615961 [comm.dtls] WARN: mbedtls_ssl_write returned ffffffff
0005615965 [comm.protocol] ERROR: Event loop error 3
0005615967 [system] WARN: Communication loop error, closing cloud socket
0005615970 [system] INFO: Cloud: disconnecting
0005615973 [system] INFO: Cloud: disconnected
0005616464 [net.en] INFO: Link up
0005616465 [net.ifapi] INFO: Netif en2 link UP
0005616467 [system.nm] INFO: State changed: IFACE_UP -> IFACE_LINK_UP
0005616471 [system.nm] INFO: State changed: IFACE_LINK_UP -> IP_CONFIGURED
0005616481 [system.nm] INFO: Checking gateway status with the device cloud
0005616483 [system] INFO: Cloud: connecting
0005616486 [system] INFO: Read Server Address = type:1,domain:$
0005616490 [system] ERROR: Failed to load session data from persistent storage
0005616494 [system] INFO: Discarding session data
0005616508 [hal] INFO: DNS server list changed
0005616775 [system] INFO: Cloud socket=0, connecting to
0005616779 [system] INFO: Cloud socket connected
0005616781 [system] INFO: Starting handshake: presense_announce=0
0005616785 [comm.protocol.handshake] INFO: Establish secure connection
0005616991 [comm.dtls] INFO: (CMPL,RENEG,NO_SESS,ERR) restoreStatus=2
0005617681 [comm.protocol.handshake] INFO: Sending HELLO message
0005617832 [comm.protocol.handshake] INFO: Handshake completed
0005617836 [system] INFO: Send spark/hardware/max_binary event
0005617841 [system] INFO: Send subscriptions
0005617847 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0005617850 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0005617853 [comm] INFO: Sending TIME request
0005617857 [comm.protocol] INFO: Posting 'M' describe message
0005617860 [comm.protocol] ERROR: Channel failed to send message with error-code <0>
0005617864 [comm.protocol] INFO: rcv'd message type=1
0005617866 [system] INFO: Cloud connected
0005617873 [comm] INFO: Forcing a cloud ping
0005617882 [system.nm] INFO: Checking gateway status with the device cloud
0005617985 [comm.protocol] INFO: message id 585 complete with code 0.00
0005617992 [comm.protocol] INFO: rcv'd message type=13
0005618000 [comm.protocol] INFO: message id 586 complete with code 0.00
0005618003 [comm.protocol] INFO: rcv'd message type=13
0005618011 [comm.protocol] INFO: message id 587 complete with code 0.00
0005618014 [comm.protocol] INFO: rcv'd message type=13
0005618023 [comm.protocol] INFO: message id 588 complete with code 0.00
0005618026 [comm.protocol] INFO: rcv'd message type=13
0005618034 [comm.protocol] INFO: message id 589 complete with code 2.05
0005618037 [comm.protocol] INFO: Received TIME response: 1558012115
0005618040 [comm.protocol] INFO: rcv'd message type=12
0005618048 [comm.protocol] INFO: message id 590 complete with code 0.00
0005618051 [comm.protocol] INFO: rcv'd message type=13
0005619288 [comm.protocol] INFO: Posting 'S' describe message
0005619293 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0005619496 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0005619499 [comm.protocol] INFO: rcv'd message type=1
0005619507 [comm.protocol] INFO: Posting 'A' describe message
0005619510 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 4
0005619513 [comm.dtls] INFO: session cmd (CLS,DIS,MOV,LOD,SAV): 3
0005619516 [comm.protocol] INFO: rcv'd message type=1
0005649658 [comm.protocol] INFO: message id 591 complete with code 0.00
0005649662 [comm.protocol] INFO: rcv'd message type=13
0005679807 [comm.protocol] INFO: message id 592 complete with code 0.00
0005679810 [comm.protocol] INFO: rcv'd message type=13
[[A0005709954 [comm.protocol] INFO: message id 593 complete with code 0.00
0005709957 [comm.protocol] INFO: rcv'd message type=13
0005740105 [comm.protocol] INFO: message id 594 complete with code 0.00
0005740108 [comm.protocol] INFO: rcv'd message type=13
0005770252 [comm.protocol] INFO: message id 595 complete with code 0.00
0005770255 [comm.protocol] INFO: rcv'd message type=13
0005800402 [comm.protocol] INFO: message id 596 complete with code 0.00
0005800406 [comm.protocol] INFO: rcv'd message type=13
0005830553 [comm.protocol] INFO: message id 597 complete with code 0.00