diff --git a/birdnet-pipy/CHANGELOG.md b/birdnet-pipy/CHANGELOG.md index fa1934a90..7900234ef 100644 --- a/birdnet-pipy/CHANGELOG.md +++ b/birdnet-pipy/CHANGELOG.md @@ -1,5 +1,8 @@ -## 0.6.6 (2026-04-21) +## 0.6.6-1 (2026-04-23) +- Fix 502 Bad Gateway on ingress: nginx now waits for the API server (port 5002) to be ready before starting. Previously, nginx started immediately while the ML model was still loading, causing all API calls to fail with 502 until the model finished loading. + + - Update to latest version from Suncuss/BirdNET-PiPy (changelog : https://github.com/Suncuss/BirdNET-PiPy/releases) ## 0.6.4 (2026-04-18) diff --git a/birdnet-pipy/config.yaml b/birdnet-pipy/config.yaml index 41af1f822..5ee777787 100644 --- a/birdnet-pipy/config.yaml +++ b/birdnet-pipy/config.yaml @@ -96,4 +96,4 @@ schema: ssl: bool? slug: birdnet-pipy url: https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pipy -version: "0.6.6" +version: "0.6.6-1" diff --git a/birdnet-pipy/rootfs/etc/services.d/nginx/run b/birdnet-pipy/rootfs/etc/services.d/nginx/run index 1653a9529..d9b0e032b 100644 --- a/birdnet-pipy/rootfs/etc/services.d/nginx/run +++ b/birdnet-pipy/rootfs/etc/services.d/nginx/run @@ -2,4 +2,9 @@ # shellcheck shell=bash set -euo pipefail +# Wait for the API server to be ready before exposing the ingress. Without +# this, nginx starts immediately while the model is still loading (can take +# minutes), causing every frontend API call to return a 502 Bad Gateway. +bashio::net.wait_for 5002 127.0.0.1 300 + nginx