Started Matter Server.
(MainThread) INFO [matter_server.server.stack] Initializing CHIP/Matter Logging...
(MainThread) INFO [matter_server.server.stack] Initializing CHIP/Matter Controller Stack...
(MainThread) DEBUG [matter_server.server.stack] Using storage file: /var/lib/matter-server/chip.json - Bluetooth commissioning enabled: NO
[1741533508.087392][2017658:2017658] CHIP:CTL: Setting attestation nonce to random value
[1741533508.087416][2017658:2017658] CHIP:CTL: Setting CSR nonce to random value
[1741533508.087860][2017658:2017658] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_kvs
[1741533508.152061][2017658:2017658] CHIP:DL: Wrote settings to /tmp/chip_kvs
[1741533508.152194][2017658:2017658] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_factory.ini
[1741533508.152233][2017658:2017658] CHIP:DL: Failed to create temp file /data/chip_factory.ini-BoBS9C: Permission denied
And then dies.
The /var/lib/matter-server folder/symlink did not exist before.
Afterwards permissions look like this:
Since the unit uses DynamicUser=true the /var/lib/matter-server/folder is symlinked and always chowned to the random user when the systemd unit starts. And BindPaths=/var/lib/matter-server:/data binds /data to that folder.
So why does the user not have write permission to that folder? And since everything is created automatically from systemd why do no others face that issue?
Any ideas? Or an idea how to debug this?
matter-server.service: Failed to set up mount namespacing: /nix/store: No such file or directory
matter-server.service: Failed at step NAMESPACE spawning /nix/store/lpk47l0bwrgxzik2vsy46z4nzs2nb7yp-python3.12-python-matter-server-7.0.1/bin/matter-server: No such file or directory
But a comment mentions it is solved differently. I will dig deeper.
Update: this fix works indeed! But only all changes not just switch off dynamic user. Thx!