Skip to content

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

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

Closed
karlp opened this issue May 25, 2023 · 7 comments
Closed

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

karlp opened this issue May 25, 2023 · 7 comments

Comments

@karlp
Copy link

karlp commented May 25, 2023

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

@agners
Copy link
Member

agners commented May 30, 2023

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

@agners agners closed this as completed May 30, 2023
@trrevvorr
Copy link

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

@agners
Copy link
Member

agners commented Jun 5, 2023

@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?

@trrevvorr
Copy link

trrevvorr commented Jun 6, 2023

@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.

@karlp
Copy link
Author

karlp commented Jun 28, 2023

Fixed by #3118 thanks!

@agners
Copy link
Member

agners commented Jun 28, 2023

@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.

@karlp
Copy link
Author

karlp commented Jun 28, 2023

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
Projects
None yet
Development

No branches or pull requests

3 participants