xmidt-org / talaria

The Xmidt routing agent.
Apache License 2.0
10 stars 19 forks source link

including transaction uuid field to scytale causes device to timeout #153

Open ilawjr opened 3 years ago

ilawjr commented 3 years ago

Including X-Xmidt-Transaction-Uuid and omitting the X-Xmidt-Source header in a direct request to Scytale can cause our simulators to timeout and and talaria to return a 504.

curl -X POST \ https://$scytaleurl:443/api/v2/device \ -H 'authorization: $auth' \ -H 'content-type: application/json' \ -H 'x-webpa-device-name: $testmac/config' \ -H 'x-xmidt-content-type: application/json' \ -H 'x-xmidt-message-type: 3' \ -H 'x-xmidt-transaction-uuid: postman-1234' \ -d ' {"command":"GET","names":["Device.DeviceInfo.X_CISCO_COM_FirmwareName"]}'

From side discussion with Joel, link map is in talaria.

Note: if you included X-Xmidt-Source, but omit X-Xmidt-Transaction-Uuid then you get a 200 return code, but an empty body. tldr; have the uuid and missing source -> 504 missing uuid and have source -> 200 (no body) have the uuid and have source -> 200 + body missing uuid and missing source - > 200 (no body)

schmidtw commented 3 years ago

Is the x-xmidt-transaction-uuid value unique per message sent?

joe94 commented 3 years ago

Talaria assumes this UUID is unique per message and device (ok to use the same UUID when sending a message to different devices).

kristinapathak commented 2 years ago

Talked with @schmidtw and according to the wrp spec both source and uuid are required so we should return a 400 instead of accepting malformed wrps.

kristinapathak commented 2 years ago

This relies on https://github.com/xmidt-org/wrp-go/issues/25 being fixed.