Skip to content

matter server s6 run script has no default log level #3068

Closed

Description

@karlp

Describe the issue you are experiencing

When running the docker.io/homeassistant/aarch64-addon-matter-server container, it fails to start without an "appropriate" config attached "somewhere". While this is probably handled automagically in homeassistant OS, it's simply a matter of a default log level not being provided here: https://github.com/home-assistant/addons/blob/master/matter_server/rootfs/etc/s6-overlay/s6-rc.d/matter-server/run#L10

The bashio call to fetch a log level needs a default, say, "info" instead of being omitted.

Without this, the server continually restarts

Traceback (most recent call last):
  File "/usr/local/bin/matter-server", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/__main__.py", line 71, in main
    logging.basicConfig(handlers=handlers, level=args.log_level.upper())
  File "/usr/local/lib/python3.11/logging/__init__.py", line 2069, in basicConfig
    root.setLevel(level)
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1464, in setLevel
    self.level = _checkLevel(level)
                 ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 207, in _checkLevel
    raise ValueError("Unknown level: %r" % level)
ValueError: Unknown level: 'NULL'

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Other (e.g., Raspbian/Raspberry Pi OS/Fedora)

Which add-on are you reporting an issue with?

Matter Server

What is the version of the add-on?

docker just calls it "latest" not sure what rev that derives to

Steps to reproduce the issue

1.oh right
2. you made
3. a super form

System Health information

not relevant

Anything in the Supervisor logs that might be useful for us?

already attached

Anything in the add-on logs that might be useful for us?

attached already

Additional information

No response

Activity

  1. agners commented on May 30, 2023

    @agners
    Member

    The add-ons are not designed to be run outside of the context of Supervisor.

  2. trrevvorr commented on Jun 4, 2023

    @trrevvorr

    I also experienced this error:

    Traceback (most recent call last):
      File "/usr/local/bin/matter-server", line 8, in <module>
        sys.exit(main())
                 ^^^^^^
      File "/usr/local/lib/python3.11/site-packages/matter_server/server/__main__.py", line 71, in main
        logging.basicConfig(handlers=handlers, level=args.log_level.upper())
      File "/usr/local/lib/python3.11/logging/__init__.py", line 2069, in basicConfig
        root.setLevel(level)
      File "/usr/local/lib/python3.11/logging/__init__.py", line 1464, in setLevel
        self.level = _checkLevel(level)
                     ^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/logging/__init__.py", line 207, in _checkLevel
        raise ValueError("Unknown level: %r" % level)
    ValueError: Unknown level: 'NULL'
    [08:20:11] INFO: Starting Matter Server...
    parse error: Expected string key before ':' at line 1, column 4
    [08:20:11] ERROR: Unknown HTTP error occured
    parse error: Expected string key before ':' at line 1, column 4
    [08:20:12] ERROR: Unknown HTTP error occured
    parse error: Expected string key before ':' at line 1, column 4
    [08:20:12] ERROR: Unknown HTTP error occured
    [08:20:12] INFO: Successfully send discovery information to Home Assistant.
    

    I'm running HA via Home Assistant OS (which includes the supervisor), so I'm not sure what @agners is saying but it sounds like it might not apply to me.

    Anyway, I was able to get Matter running again with the following steps:

    1. Go to Settings > Add-Ons > Matter Server
    2. Click "Restart" to restart the add on
    3. Go to Settings > Devices & Services > "..." menu on Matter card
    4. Click "Reload" to reload the plugin

    Here's the versions I'm currently running:

    • Home Assistant 2023.5.4
    • Supervisor 2023.04.1
    • Operating System 10.2
    • Frontend 20230503.3
    • Matter Add-On 4.5.1
  3. agners commented on Jun 5, 2023

    @agners
    Member

    @trrevvorr yes indeed, if you are running HAOS this is not expected to happen.

    Can you reproduce this? If so, can you document the exact step and open a new issue?

  4. trrevvorr commented on Jun 6, 2023

    @trrevvorr

    @trrevvorr yes indeed, if you are running HAOS this is not expected to happen.

    Can you reproduce this? If so, can you document the exact step and open a new issue?

    Unfortunately I just noticed this the other day and it hasn’t happened since. It’s possible this started occurring after I installed some updates but I can’t say for sure. I’ll update if it does happen again though.

  5. karlp commented on Jun 28, 2023

    @karlp
    Author

    Fixed by #3118 thanks!

  6. agners commented on Jun 28, 2023

    @agners
    Member

    @karlp this is more a temporary work around since it appears to happen on some Supervised/Supervisor+HAOS systems as well. This work around might go away (or we might add additional configs where we can't provide a sane default).

    For pure Docker/Container installation, please use the official Container images available at https://github.com/home-assistant-libs/python-matter-server/pkgs/container/python-matter-server.

  7. karlp commented on Jun 28, 2023

    @karlp
    Author

    That's definitely worth looking at, those container images didn't exist when I filed this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions