Code 400, message Bad request version ('18.0} from Network Load Balancer

0

My problem is that I am in the process of moving from the IoT-Core/Lambda services to a ECS docker doing containing a Mosquitto broker. This is because AWS IoT-Core does not support basic authentication and we really need this to be supported - our IoT devices have very limited resources, so we struggle very much to perform the encryption you require on the IoT-Core service. Now I have setup the docker and implemented the network load balancer, but sometimes (only sometimes) the load balancer fails to handle a simple JSON message. The MQTT message I am sending is always the same, but sometimes the load balancer fails with "code 400, message Bad request version" and other times everything is fine. When I am sending the messages directly to the Containers public IP things are always working. Also when I have the exact same docker running on my localhost and there things are also working fine. So, I think this is a problem caused by the load balancer and I am out of ideas on how solve this?

Log from where the load balancer rejets the message: 2022-10-28 06:50:3410.0.0.196 - - [28/Oct/2022 04:50:34] code 400, message Bad request version ('18.0}')8a1c1c7e0e5d4353ac68e974ce4adb99 10.0.0.196 - - [28/Oct/2022 04:50:34] code 400, message Bad request version ('18.0}') 2022-10-28 06:50:3410.0.0.196 - - [28/Oct/2022 04:50:34] "2MQTTÂ< publisherdmrfOOgG5%@2hSV8DOF1nPa80Ócanister/outgoing{"clientid": "786523DB50583837372E3120FF181243", "elapsedHours": 1, "powerUpCounter": 1, "pressure": 1024, "valveState": 1, "stepPressureTarget": 1000, "rtcTemp": 21.0, "batteryVoltage": 18.0}" 400 -8a1c1c7e0e5d4353ac68e974ce4adb99 10.0.0.196 - - [28/Oct/2022 04:50:34] "2MQTTÂ< publisherdmrfOOgG5%@2hSV8DOF1nPa80Ócanister/outgoing{"clientid": "786523DB50583837372E3120FF181243", "elapsedHours": 1, "powerUpCounter": 1, "pressure": 1024, "valveState": 1, "stepPressureTarget": 1000, "rtcTemp": 21.0, "batteryVoltage": 18.0}" 400 -

gefragt vor 2 Jahren450 Aufrufe
1 Antwort
0
Akzeptierte Antwort

Found the problem: I had configured both port 80 and port 1883 targets in the target group, so sometimes the MQTT messages were routed to port 80 on the container. I had a HTTPServer running on port 80 in the container, which was logging the problem.

beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen