Skip to content

Logs display out of order #154

@llamafilm

Description

@llamafilm

Problem/Motivation

I noticed unexpected behavior with bashio::log while developing an add-on.

Expected behavior

Bash statements should be executed in order

Actual behavior

bashio::log commands return while previous commands are still running. If I use echo instead it works correctly.

Steps to reproduce

Use this simple script in an add-on:

#!/usr/bin/with-contenv bashio

bashio::log.info "begin"
curl -H "Authorization: Bearer $SUPERVISOR_TOKEN" http://supervisor/core/info
bashio::log.info  "middle"
sleep 5
bashio::log.info  "end"

The log looks like this:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[01:25:20] INFO: begin
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   370  100   370    0     0  37639      0 --:--:-- --:--:-- --:--:-- 41111
[01:25:20] INFO: middle
[01:25:25] INFO: end
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
{"result":"ok","data":{"version":"2024.3.0.dev20240212","version_latest":"2024.3.0.dev20240213","update_available":true,"machine":"qemuarm-64","ip_address":"172.30.32.1","arch":"aarch64","image":"ghcr.io/home-assistant/qemuarm-64-homeassistant","boot":true,"port":8123,"ssl":false,"watchdog":true,"audio_input":null,"audio_output":null,"backups_exclude_database":false}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions