New Docker Deployment - Mosquitto and DB issues #4487
Unanswered
Ithrial
asked this question in
Getting started
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello. I did a fresh deployment tonight and I've ran into some issues. I've been systematically working thru but I've hit a wall because I've ran into the limits of my knowledge.
Started with deploying on a Docker Host managed by Portainer - that didnt work because the Docker Host's Portainer agent is bound to 9001 by default. When deploying the Container, Mosquitto trys to bind itself also to 9001 and errors out. I tried setting the compose to 9002:9001 for mosquitto, splitting out the internal and external ports. It got me thru the deployment but Teslamate could connect to Mosquitto.
So I removed Portainer out of the mix and deployed a stand alone Docker host without Portainer, installed Docker/Compose and pulled. Everything ran good and Mosquitto bound to 9001. Good. Then I checked the logs:
2025-01-09 17:54:42.310 [warning] [Tortoise311] Connection failed: {:connection_refused, ~c"mosquitto", 1883}, %{port: 1883, status: :down, protocol: "MQTT", host: ~c"mosquitto", protocol_version: 4, keep_alive: 60, transport: Tortoise311.Transport.Tcp, client_id: "TESLAMATE_302E3539383", subscriptions: %Tortoise311.Package.Subscribe{META: %Tortoise311.Package.Meta{opcode: 8, flags: 2}, identifier: nil, topics: []}, clean_session: true}. Retrying in 30000 msecs.
Ok the connection is refused on 1883, which was the other port declared by Mosquitto in the compose fine. No problem. Got into the container, checked the mosquitto configuration fine and the 1883 listener was commented out. Uncommented and set the access level. Restarted both Mosquitto and Teslamate and it looks like connectivity is good. Have not received a warning on the Teslamate container after the reboot.
Logged into Grafana after a few minutes of deploying and waking up the MY to see if anything was coming over - I know that it'll take a bit because the car needs to be driving to stream data (and its currently snowing very much here. But the current battery level did come over showing my 80%. Cool looks like its working. Then I noticed some DB errors:
Status: 500. Message: db query error: pq: invalid input syntax for type json.
Should I be worried about this? I'm not a DBA but I know what to check for - checked version and Postgres 14.5 was deployed, which is a current supported version. So I turned to ChatGPT and just dumped the log asking for a TLDR and got this:
The issue you’re encountering seems related to queries attempting to parse JSON data within the PostgreSQL database. The error "invalid input syntax for type json" suggests that the queries are trying to work with improperly formatted or missing JSON data.
Any thoughts or is this DB issue a self resolving thing once more data starts flowing in after a few drives? Also should I have had to go do the 1883 Port Listener thing?
Thanks for the amazing work and I cant wait to start getting in to the analytics of my MY!
Beta Was this translation helpful? Give feedback.
All reactions