Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [Birdnet-go] Crashed add-on after update: "99-run.sh exiting 2" #1687

Closed
Maarc opened this issue Dec 29, 2024 · 4 comments
Closed

🐛 [Birdnet-go] Crashed add-on after update: "99-run.sh exiting 2" #1687

Maarc opened this issue Dec 29, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Maarc
Copy link

Maarc commented Dec 29, 2024

Description

After updating my beloved birdnet-go installation, the add-on could not start anymore.

Here is the end of the starting log file:

/etc/cont-init.d/32-nginx_ingress.sh: executing
Adapting for ingress
/etc/cont-init.d/33-mariadb.sh: executing
/etc/cont-init.d/33-mqtt.sh: executing
/etc/cont-init.d/99-run.sh: executing
/etc/cont-init.d/99-run.sh: line 8: conditional binary operator expected
Error : /etc/cont-init.d/99-run.sh exiting 2
Everything started!
Termination signal received, forwarding to subprocesses...
Terminating child PID 337
Terminating child PID 3917
Failed to terminate PID 3917
All subprocesses terminated. Exiting.

The previous version was working like a charm on my machine. I guess it is related to this change.

Reproduction steps

1. Update the birdnet-go add-on to the latest version.
2. Restart the add-on

Addon Logs

/etc/cont-init.d/00-global_var.sh: executing
BIRDSONGS_FOLDER='/config/clips'
COMMAND='realtime'
Timezone set from Etc/UTC to Europe/Berlin
/etc/cont-init.d/00-local_mounts.sh: executing
/etc/cont-init.d/00-smb_mounts.sh: executing
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config_env.yaml directory
Load environment variables from /config/config_env.yaml if existing
If accessing the file with filebrowser it should be mapped to /addon_configs/db21ed7f_birdnet-go/config_env.yaml
---------------------------------------------------------
Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables
TZ='Europe/Paris'
/etc/cont-init.d/01-custom_script.sh: executing
Execute /addon_configs/db21ed7f_birdnet-go/birdnet-go.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/01-structure.sh: executing
[07:43:14] INFO: Correct config for defaults
... database location is /config/birdnet.db
... audio clips saved to /config/clips
# BirdNET-Go configuration
debug: false # print debug messages, can help with problem solving
# Node specific settings
main:
    name: BirdNET-Go # name of node, can be used to identify source of notes
    timeas24h: true # true for 24-hour time format, false for 12-hour time format
    log:
        enabled: true # true to enable log file
        path: birdnet.log # path to log file
        rotation: daily # daily, weekly or size
        maxsize: 1048576 # max size in bytes for size rotation
        rotationday: 0 # day of the week for weekly rotation, 0 = Sunday
# BirdNET model specific settings
birdnet:
    sensitivity: !!float 1 # sigmoid sensitivity, 0.1 to 1.5
    threshold: 0.8 # threshold for prediction confidence to report, 0.0 to 1.0
    overlap: 1.5 # overlap between chunks, 0.0 to 2.9
    threads: 4 # 0 to use all available CPU threads
    locale: de # language to use for labels
    latitude: !!float 48.6489 # latitude of recording location for prediction filtering
    longitude: !!float 9.2142 # longitude of recording location for prediction filtering
    rangefilter:
        model: latest # model to use for range filter: "latest" or "legacy" for previous model
        threshold: 0.01 # rangefilter species occurrence threshold
# Realtime processing settings
realtime:
    interval: 10 # duplicate prediction interval in seconds
    processingtime: true # true to report processing time for each prediction
    audio:
        source: "sysdefault" # audio source to use for analysis
        export:
            enabled: false # true to export audio clips containing indentified bird calls
            debug: false # true to enable audio export debug messages
            path: /config/clips # path to audio clip export directory
            type: wav # only wav supported for now
            retention:
                policy: none # retention policy: none, age or usage
                maxage: 20d # age policy: maximum age of clips to keep before starting evictions
                maxusage: 80% # usage policy: percentage of disk usage to trigger eviction        
                minclips: 10 # minumum number of clips per species to keep before starting evictions
    dynamicthreshold:
        enabled: true # true to enable dynamic confidence threshold
        trigger: 0.90 # dynamic threshold is activated on detections at this confidence level
        min: 0.20 # dynamic threshold will not go lower than this
        validhours: 24 # number of hours to consider for dynamic confidence
    rtsp:
        transport: tcp # RTSP Transport Protocol
        urls: # RTSP stream URLs
            - rtsps://192.18.18.18:9001/abcdefgh
    log:
        enabled: false # true to enable OBS chat log
        path: birdnet.txt # path to OBS chat log
    birdweather:
        enabled: false # true to enable birdweather uploads
        locationaccuracy: 500 # accuracy of location in meters
        debug: true # true to enable birdweather api debug mode
        id: '' # birdweather ID
    openweather:
        enabled: false
        apikey: "" # OpenWeather API key
        endpoint: "https://api.openweathermap.org/data/2.5/weather" # OpenWeather API endpoint
        units: metric # metric or imperial
        language: en # language code
    mqtt:
        enabled: true
        broker: tcp://192.18.18.18:9883
        topic: birdnet_topic
    privacyfilter: # Privacy filter prevents audio clip saving if human voice 
        enabled: true # is detected durin audio capture
        confidence: 0.5 # threshold for human voice detection
    dogbarkfilter:
        enabled: true
        confidence: 0.5 # confidence threshold for dog bark detection
        remember: 5 # number of minutes to remember dog barks
    telemetry:
        enabled: false # true to enable Prometheus compatible telemetry endpoint
        listen: "0.0.0.0:8090" # IP address and port to listen on
webserver:
    enabled: true # true to enable web server
    port: 8080 # port for web server
    autotls: false # true to enable auto TLS
    log:
        enabled: false # true to enable log file
        path: webui.log # path to log file
        rotation: daily # daily, weekly or size
        maxsize: 1048576 # max size in bytes for size rotation
        rotationday: 0 # day of the week for weekly rotation, 0 = Sunday
# Ouput settings
output:
    file:
        enabled: true # true to enable file output for file and directory analysis
        path: output/ # path to output directory
        type: table # ouput format, Raven table or csv
    # Only one database is supported at a time
    # if both are enabled, SQLite will be used.
    sqlite:
        enabled: true # true to enable sqlite output
        path: /config/birdnet.db # path to sqlite database
    mysql:
        enabled: false # true to enable mysql output
        username: masked # mysql database username
        password: masked # mysql database user password
        database: masked # mysql database name
        host: 192.18.18.18 # mysql database host
        port: 6606 # mysql database port
/etc/cont-init.d/32-nginx_ingress.sh: executing
Adapting for ingress
/etc/cont-init.d/33-mariadb.sh: executing
/etc/cont-init.d/33-mqtt.sh: executing
/etc/cont-init.d/99-run.sh: executing
/etc/cont-init.d/99-run.sh: line 8: conditional binary operator expected
Error : /etc/cont-init.d/99-run.sh exiting 2
Everything started!
Termination signal received, forwarding to subprocesses...
Terminating child PID 337
Terminating child PID 3917
Failed to terminate PID 3917
All subprocesses terminated. Exiting.

Architecture

amd64

OS

HAos

@Maarc Maarc added the bug Something isn't working label Dec 29, 2024
@Maarc
Copy link
Author

Maarc commented Dec 29, 2024

It looks like the following line is the problematic one according to shellcheck

if [[ "$(uname -m)" = "x86_64" && ! grep -q "avx2" /proc/cpuinfo ]]; then
^-- SC1009 (info): The mentioned syntax error was in this if expression.
   ^-- SC1073 (error): Couldn't parse this test expression. Fix to allow more checks.
                                                   ^-- SC1072 (error): Expected test to end here (don't wrap commands in []/[[]]). Fix any mentioned problems and try again.
                                                   ^-- SC1076 (error): Trying to do math? Use e.g. [[ $((i/2+7)) -ge 18 ]].

Something like this could likely fix it:

if [[ "$(uname -m)" = "x86_64" ]] && ! grep -q "avx2" /proc/cpuinfo; then

I just need to find a way to the test my changes.

@alexbelgium
Copy link
Owner

Ah thanks! Indeed I've still left the code but actually it now supports avx2. I'll remove it thanks

alexbelgium added a commit that referenced this issue Dec 29, 2024
@alexbelgium
Copy link
Owner

New version pushed!

@Maarc
Copy link
Author

Maarc commented Dec 29, 2024

Thank you for your quick responsiveness and for the fix, @alexbelgium. It works for me.

@Maarc Maarc closed this as completed Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants