project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.39k stars 1.98k forks source link

[BUG] Python controller build is limited with 254 fabrics #33026

Open Saravana-kr22 opened 5 months ago

Saravana-kr22 commented 5 months ago

Reproduction steps

I am python as controller to stress test the dut for multi-admin scenarios , Where i found that with current sdk only 254 fabrics (controllers) can be build with the certificate_authority_manager function in the matter_testing_support file

if i try to build the fabric beyond 254 i got the error as below:

Traceback (most recent call last): File "/home/ubuntu/connectedhomeip/src/python_testing/Matter_QA/Scripts/ReliabilityScripts/TC_Multi_admin.py", line 69, in build_controller th = th_fabric_admin.NewController(thNodeId) File "/home/ubuntu/connectedhomeip/no/lib/python3.10/site-packages/chip/FabricAdmin.py", line 101, in NewController controller = ChipDeviceCtrl.ChipDeviceController( File "/home/ubuntu/connectedhomeip/no/lib/python3.10/site-packages/chip/ChipDeviceCtrl.py", line 1774, in init ).raise_on_error() File "/home/ubuntu/connectedhomeip/no/lib/python3.10/site-packages/chip/native/init.py", line 87, in raise_on_error raise self.to_exception() chip.exceptions.ChipStackError: src/credentials/PersistentStorageOpCertStore.cpp:220: CHIP Error 0x00000003: Incorrect state

The python script i used to run this stress test : https://github.com/CHIP-Specifications/matter-qa/blob/main/src/matter_qa/scripts/reliability_scripts/TC_Multiadmin.py

Bug prevalence

Whenever i do this

GitHub hash of the SDK that was being used

3cb83827fc6d46d66fc34ca0a39b54dff2170c00

Platform

python

Anything else?

Reference log: cadmin_build_failure_log.txt

bzbarsky-apple commented 5 months ago

Each fabric on a given device requires a unique fabric index, and those are allowed to be in the range 1-254 per spec.

cecille commented 5 months ago

I think they're removing them from the device, but you can only mint 254 fabrics on the test harness side because they never get deleted, just shut down.

bzbarsky-apple commented 5 months ago

Well, why are they not being deleted? That's broken, clearly, and needs to be fixed.