-
Notifications
You must be signed in to change notification settings - Fork 88
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
Comments
Please provide (a lot) more info because this is way too little for us to understand your goals and issue. What dev environment ? |
This is definitely a dev environment setup and is not impacting me. I
just wanted to understand failure cases with the server or client and
making sure I could restart them in such a case.
fwiw, the error is in the chip library and, in my case, I do not have
that built directly but installed via snap. That may or may not be
part of the issue and I could retry (in a while) with a clean build.
But, I tried to give you an easy way to replicate the problem in your
environment.
In particular, I edited the scripts/example.py which starts the server
and client, and when interrupted (ie, ^C) exits.
I put that body (shown below) in a stupid loop so after the ^C, it
would reestablish the server and client. It was during that
reestablishment, that the error is shown.
for i in range(2):
print('iteration',i)
# Init server
server = MatterServer(
args.storage_path,
DEFAULT_VENDOR_ID,
DEFAULT_FABRIC_ID,
...
async def handle_stop(loop: asyncio.AbstractEventLoop):
"""Handle server stop."""
await server.stop()
# run the server
run(run_matter(), shutdown_callback=handle_stop)
Does that make enough sense for you to reproduce?
…On Tue, Dec 31, 2024 at 12:45 AM Marcel van der Veldt ***@***.***> wrote:
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
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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'
The text was updated successfully, but these errors were encountered: