"Failed to save" error with esp thing

I’m very new to Mozilla Iot, I have setup a gateway on a pi 3 and have been playing around with making a ‘thing’ with a esp8266. my problem is that when adding the esp to the gateway it gives the error “Failed to save”.
this error only happens sometimes, mostly when I update the code on the esp, and I remove and re-add the esp to the gateway. When I manually go to the esp address (e.g. http://10.0.0.51/things/led ) I get valid json data.

also the gateway can’t auto find the esp (I have to manually add the url) I’m not sure if that is part of the problem.

I’m not sure what could be happening since we swapped to dynamic json buffers. I’m planning to migrate to ArduinoJson 6 which might help. If you can connect to the ESP8266 over serial during the add thing process it might be able to print out some additional debugging information