Frigate/MQTT not playing nicely together

Hi All,
I have managed to get Frigate up and running and can see the video in Home Assistant.
The problem is i cannot get the entities up and running this is down to me getting a client unknown error, I think.
I am missing something but have been going around in circles.
In Frigate i get
ERROR : Unable to publish to stats: client is not connected
In the Mosquitto Broker i get
2024-02-12 18:46:58: Client closed its connection.
My Frigate config is

mqtt:
  enabled: True
  host: mqtt://core-mosquitto
  port: 1883
  user: homeassistant
  password: mqtt
  topic_prefix: frigate
  client_id: frigate

cameras:
  Driveway:
    enabled: True
    ffmpeg:
      inputs:
        - path: rtsp://username:password&@192.168.1.109:554/stream1/rtsp
          roles:
            - detect
    detect:
      width:  1280
      height:  720
      fps:  5
    record:
      enabled: True
      retain:
        days:  7
        mode: motion
      events:
        retain:
          default:  30
          mode: motion
    snapshots:
      enabled: True
      retain:
        default:  30
objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
  track:
    - person
    - cat
    - car

Any advice greatly appreciated.

your host is wrong, it should not have mqtt://

Changed host to just core-mosquitto and same error unfortunately.

What does frigate log show?

As above i get multiple of these
2024-02-12 21:12:03.323024573 [2024-02-12 21:12:03] frigate.comms.mqtt ERROR : Unable to publish to stats: client is not connected
2024-02-12 21:13:03.489849711 [2024-02-12 21:13:03] frigate.comms.mqtt ERROR : Unable to publish to stats: client is not connected
2024-02-12 21:13:05.320461453 [2024-02-12 21:13:05] frigate.comms.mqtt ERROR : Unable to publish to events: client is not connected
2024-02-12 21:13:05.392628793 [2024-02-12 21:13:05] frigate.comms.mqtt ERROR : Unable to publish to Driveway/person/snapshot: client is not connected
2024-02-12 21:13:05.393926268 [2024-02-12 21:13:05] frigate.comms.mqtt ERROR : Unable to publish to Driveway/person: client is not connected

If mosquito showed disconnections then url was ok

Have you tried restart mosquito? I recently found mosquito stop allowing connections after many month running. Not sure why but password file suddenly need recreate. Not just frigate but my other containers would not connect.

If mqtt not make initial connection at start im not sure frigate will retry so restart may be needed but i cant confirm this

what is the new config

mqtt:
  enabled: True
  host: core-mosquitto
  port: 1883
  user: mqtt-user
  password: mqtt
  topic_prefix: frigate
  client_id: frigate

cameras:
  Driveway:
    enabled: True
    ffmpeg:
      inputs:
        - path: rtsp://username:[email protected]:554/stream1/rtsp
          roles:
            - detect
    detect:
      width:  1280
      height:  720
      fps:  5
    record:
      enabled: True
      retain:
        days:  7
        mode: motion
      events:
        retain:
          default:  30
          mode: motion
    snapshots:
      enabled: True
      retain:
        default:  30
objects:
  # Optional: list of objects to track from labelmap.txt (default: shown below)
  track:
    - person
    - cat
    - car

is frigate running as an addon in home assistant?

Yes it is, i have video, it is recording etc.
It is just not talking to mqtt.
I, maybe wrongly, am assuming that once the config uses the mqtt user it should connect up.
Zigbee2mqtt is working fine with those details.
Also the password in the zigate yml is supposed to be the password for the mqtt-user?
Thanks.

Just an update that is not really an update. Without me changing anything it suddenly started working.
The only thing i did was stop the add on for a couple of hours and start it back up.
So restarts of HA,short stop starts etc did not help but for some reason not having it running for a few hours fixed it. Bizarre.
Thanks for taking the time to reply folks. Much appreciated.