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

Update base image to 2022.11.0 #82527

Merged
merged 1 commit into from
Nov 24, 2022
Merged

Conversation

felipecrs
Copy link
Contributor

@felipecrs felipecrs commented Nov 22, 2022

Breaking change

No.

Proposed change

Fixes intermittent s6-overlay error that prevents Home Assistant from starting.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@pvizeli
Copy link
Member

pvizeli commented Nov 24, 2022

Let's handle that on the base image. I created a new release, so we can use a new base image to fix it 👍

@frenck
Copy link
Member

frenck commented Nov 24, 2022

This is not a fix, but a workaround.
IMHO, this should not be possible to run into from S6.

This was acknowledged upstream as well, the last question asked was: If raising it would fix the issue and let him know.

The issue was closed, nobody answered. I suggest we answer his questions and get it adjusted upstream (instead of just patching our end).

@felipecrs
Copy link
Contributor Author

@frenck in fact there are two solutions for this issue:

  1. Convert s6 services to the new s6-rc format
    • This was the solution that the issue author in upstream took.
    • We already discussed about this conversion in the s6 v3 PR for the community add-on base.
      • We decided to keep the s6 legacy services.d
  2. Adjust the timeout as this PR does, for who want to stick with services.d.
    • I'd also say that the default timeout would need to be raised upstream as well, but I think upstream doesn't want to support that much the legacy format. I think I have raised this at some comment for them, will check.

So, our best option is still 2, I guess.

@felipecrs felipecrs changed the title Fix intermittent unable to s6_svstatus_read error Update base image to 2022.11.0 Nov 24, 2022
@felipecrs
Copy link
Contributor Author

@frenck, update:

@frenck
Copy link
Member

frenck commented Nov 24, 2022

@felipecrs You are missing my point in my comment:

image

☝️ No one ever communicated anything about it back. IMHO it is the main reason it doesn't have a better default out of the box.

Ref: just-containers/s6-overlay#460 (comment)

@felipecrs
Copy link
Contributor Author

@frenck I see. Well, that's odd indeed. I'll try to find a way to replicate the issue and test by myself. It's difficult because it's very rare.

@felipecrs
Copy link
Contributor Author

felipecrs commented Nov 24, 2022

Just to be clear, increasing the S6_SERVICES_READYTIME causes no harm and potentially (to be confirmed) fixes the issue. If we confirm later the unlikely case that it does NOT fix the issue, we can remove it from the base images.

@frenck frenck merged commit dfa1ecd into home-assistant:dev Nov 24, 2022
@felipecrs felipecrs deleted the fix-s6-overlay branch November 24, 2022 18:23
@felipecrs
Copy link
Contributor Author

I posted news at just-containers/s6-overlay#460, copying from there:

I wrote a simple script to test it for me:

#!/bin/bash

function test() {
    rm -f "$1"-log.txt
    local attempts=500
    local failures=0
    for i in $(seq 1 $attempts); do
        clear
        echo "S6_SERVICES_READYTIME=${1} - Attempt $i of $attempts"
        set -x
        docker rm -f test
        docker run --name test --env=S6_SERVICES_READYTIME="$1" --rm -d ghcr.io/home-assistant/generic-x86-64-homeassistant:2022.11.4
        sleep 1.25s
        set +x
        if docker logs test 2>&1 |
            tee /dev/stderr |
            grep -q "s6-svwait: fatal: unable to s6_svstatus_read: No such file or directory"; then
            echo "attempt ${i} at $(date)" >> "$1"-log.txt
            failures=$((failures + 1))
            # Bell
            echo -e '\a'
        fi
    done
    echo "Failed ${failures} out of ${attempts} attempts for S6_SERVICES_READYTIME=${1}" >> result.txt
}

test 0

test 5

test 50

Here's the result:

Failed 43 out of 500 attempts for S6_SERVICES_READYTIME=0
Failed 48 out of 500 attempts for S6_SERVICES_READYTIME=5
Failed 0 out of 500 for S6_SERVICES_READYTIME=50

Failures for S6_SERVICES_READYTIME=0:

attempt 1 at Thu Nov 24 20:17:48 -03 2022
attempt 7 at Thu Nov 24 20:18:03 -03 2022
attempt 9 at Thu Nov 24 20:18:08 -03 2022
attempt 12 at Thu Nov 24 20:18:16 -03 2022
attempt 13 at Thu Nov 24 20:18:19 -03 2022
attempt 53 at Thu Nov 24 20:20:13 -03 2022
attempt 58 at Thu Nov 24 20:20:28 -03 2022
attempt 80 at Thu Nov 24 20:21:35 -03 2022
attempt 93 at Thu Nov 24 20:22:44 -03 2022
attempt 114 at Thu Nov 24 20:23:51 -03 2022
attempt 115 at Thu Nov 24 20:23:53 -03 2022
attempt 119 at Thu Nov 24 20:24:03 -03 2022
attempt 135 at Thu Nov 24 20:24:56 -03 2022
attempt 156 at Thu Nov 24 20:25:50 -03 2022
attempt 177 at Thu Nov 24 20:26:43 -03 2022
attempt 202 at Thu Nov 24 20:27:47 -03 2022
attempt 205 at Thu Nov 24 20:27:55 -03 2022
attempt 215 at Thu Nov 24 20:28:21 -03 2022
attempt 228 at Thu Nov 24 20:28:53 -03 2022
attempt 231 at Thu Nov 24 20:29:15 -03 2022
attempt 232 at Thu Nov 24 20:29:31 -03 2022
attempt 235 at Thu Nov 24 20:29:38 -03 2022
attempt 240 at Thu Nov 24 20:29:51 -03 2022
attempt 250 at Thu Nov 24 20:30:17 -03 2022
attempt 259 at Thu Nov 24 20:30:40 -03 2022
attempt 282 at Thu Nov 24 20:32:08 -03 2022
attempt 296 at Thu Nov 24 20:32:44 -03 2022
attempt 330 at Thu Nov 24 20:34:11 -03 2022
attempt 349 at Thu Nov 24 20:34:59 -03 2022
attempt 352 at Thu Nov 24 20:35:07 -03 2022
attempt 359 at Thu Nov 24 20:35:28 -03 2022
attempt 398 at Thu Nov 24 20:37:22 -03 2022
attempt 411 at Thu Nov 24 20:37:55 -03 2022
attempt 417 at Thu Nov 24 20:38:11 -03 2022
attempt 425 at Thu Nov 24 20:38:31 -03 2022
attempt 428 at Thu Nov 24 20:38:39 -03 2022
attempt 434 at Thu Nov 24 20:38:54 -03 2022
attempt 441 at Thu Nov 24 20:39:12 -03 2022
attempt 444 at Thu Nov 24 20:39:19 -03 2022
attempt 461 at Thu Nov 24 20:40:02 -03 2022
attempt 463 at Thu Nov 24 20:40:07 -03 2022
attempt 477 at Thu Nov 24 20:40:43 -03 2022
attempt 497 at Thu Nov 24 20:41:35 -03 2022

Failures for S6_SERVICES_READYTIME=5:

attempt 16 at Thu Nov 24 21:13:33 -03 2022
attempt 21 at Thu Nov 24 21:13:46 -03 2022
attempt 31 at Thu Nov 24 21:14:14 -03 2022
attempt 37 at Thu Nov 24 21:14:30 -03 2022
attempt 38 at Thu Nov 24 21:14:32 -03 2022
attempt 54 at Thu Nov 24 21:15:16 -03 2022
attempt 58 at Thu Nov 24 21:15:26 -03 2022
attempt 59 at Thu Nov 24 21:15:29 -03 2022
attempt 60 at Thu Nov 24 21:15:32 -03 2022
attempt 63 at Thu Nov 24 21:15:40 -03 2022
attempt 65 at Thu Nov 24 21:15:45 -03 2022
attempt 85 at Thu Nov 24 21:16:40 -03 2022
attempt 86 at Thu Nov 24 21:16:42 -03 2022
attempt 96 at Thu Nov 24 21:17:09 -03 2022
attempt 99 at Thu Nov 24 21:17:17 -03 2022
attempt 104 at Thu Nov 24 21:17:29 -03 2022
attempt 110 at Thu Nov 24 21:17:44 -03 2022
attempt 112 at Thu Nov 24 21:17:49 -03 2022
attempt 116 at Thu Nov 24 21:17:59 -03 2022
attempt 124 at Thu Nov 24 21:18:20 -03 2022
attempt 132 at Thu Nov 24 21:18:41 -03 2022
attempt 143 at Thu Nov 24 21:19:27 -03 2022
attempt 154 at Thu Nov 24 21:20:12 -03 2022
attempt 163 at Thu Nov 24 21:20:36 -03 2022
attempt 202 at Thu Nov 24 21:22:38 -03 2022
attempt 231 at Thu Nov 24 21:24:01 -03 2022
attempt 239 at Thu Nov 24 21:24:22 -03 2022
attempt 260 at Thu Nov 24 21:25:59 -03 2022
attempt 267 at Thu Nov 24 21:26:18 -03 2022
attempt 271 at Thu Nov 24 21:26:28 -03 2022
attempt 282 at Thu Nov 24 21:27:11 -03 2022
attempt 298 at Thu Nov 24 21:27:56 -03 2022
attempt 299 at Thu Nov 24 21:27:58 -03 2022
attempt 320 at Thu Nov 24 21:28:53 -03 2022
attempt 325 at Thu Nov 24 21:29:06 -03 2022
attempt 327 at Thu Nov 24 21:29:11 -03 2022
attempt 331 at Thu Nov 24 21:29:22 -03 2022
attempt 333 at Thu Nov 24 21:29:27 -03 2022
attempt 339 at Thu Nov 24 21:29:43 -03 2022
attempt 355 at Thu Nov 24 21:30:37 -03 2022
attempt 385 at Thu Nov 24 21:32:10 -03 2022
attempt 409 at Thu Nov 24 21:33:13 -03 2022
attempt 438 at Thu Nov 24 21:34:30 -03 2022
attempt 439 at Thu Nov 24 21:34:32 -03 2022
attempt 445 at Thu Nov 24 21:34:48 -03 2022
attempt 463 at Thu Nov 24 21:35:34 -03 2022
attempt 479 at Thu Nov 24 21:36:34 -03 2022
attempt 497 at Thu Nov 24 21:37:24 -03 2022

I think this is conclusive, I can safely say that increasing S6_SERVICES_READYTIME is effective.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some times core fails to restart and I have to use SSH to fix
3 participants