Network share not mounting from reboot (Frigate)

I have recently spotted something that is causing issues with Frigate.

I followed the documentation in Frigate to have my recordings placed on my NAS so my local drive isn’t eaten up (500GB SSD. HA is running on Proxmox)

I moved the Frigate DB to /config/
I used HA (Settings → System → Storage → Add Network Storage)
Started up Frigate and it all was working great.

Then I noticed if HA was to reboot in anyway, the mount would not happen as it sees there is an existing fold/file in the location (media/frigate).
Here is the Supervisor Error

ERROR (MainThread) [supervisor.mounts.mount] Cannot mount bind_frigate at /data/media/frigate because it is not empty

What I suspect is happening is during a reboot, HA starts up all the Addons.
Frigate is set to start up on boot.
It attempts to look at the media folder and realises its not there (the mount hasnt taken place by HA) so it creates a directory (now this is created on the local drive!)
Then the mount process I guess kicks in, sees stuff in /media and throws and error.
Frigate is happy so I dont notice it until I see my local drive suddenly filling up.

I have worked around this by making sure I un check “Start on Boot” for Frigate. Then created and automation that waits a few mins for HA to start up and then turns on Frigate giving the Network Drive time to mount.

This is not ideal. Does anyone know if this is “normal”. I assume this a sequence thing for when HA boots up. The mount should happen before any Addons start to avoid this issue and have any addons that use mounted drives not try create their own folders.

same here,
only if there was a sensor for the external storage state.
i’m also making a workarround right now.
how is your code?
my:

alias: frigate restart na 30 ha started
description: “”
triggers:

  • trigger: homeassistant
    event: start
    conditions:
    actions:
  • delay:
    hours: 0
    minutes: 1
    seconds: 0
    milliseconds: 0
  • action: hassio.addon_restart
    metadata: {}
    data:
    addon: ccab4aaf_frigate-fa
    mode: single

Yeah or I dont know how feasible a “proper fix” is but that would be better. Make sure all configured mounts happen before addons are started, as a sort of pre req.

My automation is the same, but I added a 5min delay.