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

MatterServer cannot be started more than once #1009

Open
bkoblenz opened this issue Dec 22, 2024 · 2 comments
Open

MatterServer cannot be started more than once #1009

bkoblenz opened this issue Dec 22, 2024 · 2 comments

Comments

@bkoblenz
Copy link

I am interested in the case where there is a (TBD) bug that requires me to shutdown and restart the MatterServer. I have certainly had plenty during my development. It seems that after the server.stop() and regeneration of the MatterServer object, there is a failure regenerating the chip stack. I have been able to verify this by editing scripts/example.py and putting a loop around the code and hitting ^C to cause the termination of the first iteration, stopping the server and then trying to start the second iteration. The log output shows close to where things run amiss (starting during the shutdown of the first iteration):

2024-12-22 13:00:14 Master-198 aiorun[25935] INFO Entering shutdown phase.
2024-12-22 13:00:14 Master-198 aiorun[25935] INFO Executing provided shutdown_callback.
2024-12-22 13:00:14 Master-198 matter_server.server.server[25935] INFO Stopping the Matter Server...
2024-12-22 13:00:14 Master-198 matter_server.server.stack[25935] INFO Shutting down the Matter stack...
2024-12-22 13:00:14 Master-198 chip.native.CTL[25935] Level 39 Shutting down the stack...
2024-12-22 13:00:14 Master-198 aiorun[25935] INFO Waiting for executor shutdown.
2024-12-22 13:00:14 Master-198 aiorun[25935] INFO Shutting down async generators
2024-12-22 13:00:14 Master-198 aiorun[25935] INFO Closing the loop.
2024-12-22 13:00:14 Master-198 aiorun[25935] INFO Leaving. Bye!
iteration 1
2024-12-22 13:00:14 Master-198 matter_server.server.stack[25935] INFO Initializing CHIP/Matter Controller Stack...
2024-12-22 13:00:14 Master-198 chip.native.DL[25935] Level 39 ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: /tmp/chip_kvs
2024-12-22 13:00:14 Master-198 chip.native.DL[25935] Level 39 ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: /data/chip_factory.ini
2024-12-22 13:00:14 Master-198 chip.native.DL[25935] Level 39 ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: /data/chip_config.ini
2024-12-22 13:00:14 Master-198 chip.native.DL[25935] Level 39 ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: /data/chip_counters.ini
2024-12-22 13:00:14 Master-198 chip.CertificateAuthority[25935] INFO Loading certificate authorities from storage...
Traceback (most recent call last):
File "/home/pi/Irricloud-substation-development/python-matter-server/scripts/example.py", line 78, in
server = MatterServer(
^^^^^^^^^^^^^
File "/home/pi/Irricloud-substation-development/python-matter-server/matter_server/server/server.py", line 140, in init
self.stack = MatterStack(self, bluetooth_adapter_id, enable_server_interactions)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/Irricloud-substation-development/python-matter-server/matter_server/server/stack.py", line 130, in init
self.certificate_authority_manager.LoadAuthoritiesFromStorage()
File "/home/pi/.venv/lib/python3.12/site-packages/chip/CertificateAuthority.py", line 253, in LoadAuthoritiesFromStorage
caList = self._persistentStorage.GetReplKey('caList')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'GetReplKey'

@marcelveldt
Copy link
Contributor

Please provide (a lot) more info because this is way too little for us to understand your goals and issue.
I have never ever seen this issue before so it must be some edge case you trigger.

What dev environment ?
Why are you trying to loop the code around ?
What are you trying to accomplish ?
etc

@bkoblenz
Copy link
Author

bkoblenz commented Jan 2, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants