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

Error: IM Error 0x000005C3: General error: 0xc3 (UNSUPPORTED_CLUSTER) #34066

Closed
FIREWORKMBY opened this issue Jun 25, 2024 · 2 comments
Closed

Comments

@FIREWORKMBY
Copy link

Now I am working on the new cluster. When I test command, the chip-tool side error log is as follows,I looked up the possible cause of the error and found that there was no problem with the zap file. Finally, I found that the error was in the code of the cluster server implementation. Through MatterThreadBorderRouterManagementPluginServerInitCallback interface cannot directly to add Instance: : Init () interface, So I added a void emberAfThreadBorderRouterManagementClusterInitCallback (chip: : EndpointId EndpointId); The implementation of the function is as follows,I would like to know what is the reason for the error has no delegate and how to solve it. Could someone give me an answer, thank you!!!

void emberAfThreadBorderRouterManagementClusterInitCallback(chip::EndpointId endpointId)
{ 
   // Nothing to do, the server init routine will be done in Instance::Init()
   Delegate * delegate = GetDelegate(endpointId);
   if (isDelegateNull(delegate, endpointId))
   {
      ChipLogProgress(Zcl, "ThreadBorderRouter has no delegate set for endpoint:%u", endpoint);
       // return;
   }

   // 创建ServerInstance的实例  
   ServerInstance serverInstance(endpointId, delegate); 

   CHIP_ERROR err = serverInstance.Init();
   if (err != CHIP_NO_ERROR)
   {
       ChipLogError(Zcl, "ThreadBorderRouterManagement::serverInstance.Init() error: %" CHIP_ERROR_FORMAT, err.Format());
   }
}

Error:

[1719292433.148006][469915:469915] CHIP:IM: Duplicate command handler registration failed
[1719292433.148012][469915:469915] CHIP:ZCL: ThreadBorderRouterManagement::serverInstance.Init() error: src/app/InteractionModelEngine.cpp:1719: CHIP Error 0x00000003: Incorrect state

Here's the error when you run command with chip-tool:

[1719286450.592008][469442:469444] CHIP:EM: Found matching exchange: 25205i, Delegate: 0x7f1e0c00ba28
[1719286450.592023][469442:469444] CHIP:EM: Rxd Ack; Removing MessageCounter:14268477 from Retrans Table on exchange 25205i
[1719286450.592055][469442:469444] CHIP:SC: Success status report received. Session was established
[1719286450.593516][469442:469444] CHIP:SC: SecureSession[0x7f1e0c003a40, LSID:33451]: State change 'kEstablishing' --> 'kActive'
[1719286450.593566][469442:469444] CHIP:IN: SecureSession[0x7f1e0c003a40]: Activated - Type:2 LSID:33451
[1719286450.593573][469442:469444] CHIP:IN: New secure session activated for device <000000000000004F, 1>, LSID:33451 PSID:49425!
[1719286450.593583][469442:469444] CHIP:DIS: OperationalSessionSetup[1:000000000000004F]: State change 4 --> 5
[1719286450.593613][469442:469444] CHIP:TOO: Sending cluster (0x00000452) command (0x00000000) on endpoint 2
[1719286450.593649][469442:469444] CHIP:DMG: ICR moving to [AddingComm]
[1719286450.593702][469442:469444] CHIP:DMG: ICR moving to [AddedComma]
[1719286450.593836][469442:469444] CHIP:EM: <<< [E:25206i S:33451 M:161521723] (S) Msg TX to 1:000000000000004F [FA7A] [UDP:[fe80::f816:3eff:fe45:563b%ens3]:5540] --- Type 0001:08 (IM:InvokeCommandRequest)
[1719286450.593946][469442:469444] CHIP:DMG: ICR moving to [AwaitingRe]
[1719286450.594066][469442:469444] CHIP:EM: <<< [E:25205i S:0 M:14268478 (Ack:121697891)] (U) Msg TX to 0:0000000000000000 [0000] [UDP:[fe80::f816:3eff:fe45:563b%ens3]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck)
[1719286450.594151][469442:469444] CHIP:EM: Flushed pending ack for MessageCounter:121697891 on exchange 25205i
[1719286450.595026][469442:469444] CHIP:EM: >>> [E:25206i S:33451 M:188740989 (Ack:161521723)] (S) Msg RX from 1:000000000000004F [FA7A] --- Type 0001:09 (IM:InvokeCommandResponse)
[1719286450.595048][469442:469444] CHIP:EM: Found matching exchange: 25206i, Delegate: 0x7f1e0c0082b8
[1719286450.595059][469442:469444] CHIP:EM: Rxd Ack; Removing MessageCounter:161521723 from Retrans Table on exchange 25206i
[1719286450.595070][469442:469444] CHIP:DMG: ICR moving to [ResponseRe]
[1719286450.595092][469442:469444] CHIP:DMG: InvokeResponseMessage =
[1719286450.595111][469442:469444] CHIP:DMG: {
[1719286450.595118][469442:469444] CHIP:DMG:    suppressResponse = false,
[1719286450.595124][469442:469444] CHIP:DMG:    InvokeResponseIBs =
[1719286450.595137][469442:469444] CHIP:DMG:    [
[1719286450.595147][469442:469444] CHIP:DMG:            InvokeResponseIB =
[1719286450.595158][469442:469444] CHIP:DMG:            {
[1719286450.595163][469442:469444] CHIP:DMG:                    CommandStatusIB =
[1719286450.595170][469442:469444] CHIP:DMG:                    {
[1719286450.595175][469442:469444] CHIP:DMG:                            CommandPathIB =
[1719286450.595183][469442:469444] CHIP:DMG:                            {
[1719286450.595189][469442:469444] CHIP:DMG:                                    EndpointId = 0x2,
[1719286450.595201][469442:469444] CHIP:DMG:                                    ClusterId = 0x452,
[1719286450.595207][469442:469444] CHIP:DMG:                                    CommandId = 0x0,
[1719286450.595213][469442:469444] CHIP:DMG:                            },
[1719286450.595224][469442:469444] CHIP:DMG:
[1719286450.595239][469442:469444] CHIP:DMG:                            StatusIB =
[1719286450.595247][469442:469444] CHIP:DMG:                            {
[1719286450.595254][469442:469444] CHIP:DMG:                                    status = 0xc3 (UNSUPPORTED_CLUSTER),
[1719286450.595267][469442:469444] CHIP:DMG:                            },
[1719286450.595275][469442:469444] CHIP:DMG:
[1719286450.595280][469442:469444] CHIP:DMG:                    },
[1719286450.595290][469442:469444] CHIP:DMG:
[1719286450.595294][469442:469444] CHIP:DMG:            },
[1719286450.595304][469442:469444] CHIP:DMG:
[1719286450.595308][469442:469444] CHIP:DMG:    ],
[1719286450.595319][469442:469444] CHIP:DMG:
[1719286450.595331][469442:469444] CHIP:DMG:    InteractionModelRevision = 11
[1719286450.595345][469442:469444] CHIP:DMG: },
[1719286450.595397][469442:469444] CHIP:DMG: Received Command Response Status for Endpoint=2 Cluster=0x0000_0452 Command=0x0000_0000 Status=0xc3
[1719286450.595408][469442:469444] CHIP:TOO: Error: IM Error 0x000005C3: General error: 0xc3 (UNSUPPORTED_CLUSTER)
[1719286450.595435][469442:469444] CHIP:DMG: ICR moving to [AwaitingDe]
[1719286450.595531][469442:469444] CHIP:EM: <<< [E:25206i S:33451 M:161521724 (Ack:188740989)] (S) Msg TX to 1:000000000000004F [FA7A] [UDP:[fe80::f816:3eff:fe45:563b%ens3]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck)
[1719286450.595592][469442:469444] CHIP:EM: Flushed pending ack for MessageCounter:188740989 on exchange 25206i
[1719286450.595703][469442:469442] CHIP:CTL: Shutting down the commissioner
[1719286450.595778][469442:469442] CHIP:CTL: Shutting down the controller
[1719286450.595803][469442:469442] CHIP:IN: Expiring all sessions for fabric 0x1!!
[1719286450.595821][469442:469442] CHIP:IN: SecureSession[0x7f1e0c003a40]: MarkForEviction Type:2 LSID:33451
[1719286450.595836][469442:469442] CHIP:SC: SecureSession[0x7f1e0c003a40, LSID:33451]: State change 'kActive' --> 'kPendingEviction'
[1719286450.595848][469442:469442] CHIP:IN: SecureSession[0x7f1e0c003a40]: Released - Type:2 LSID:33451
[1719286450.595863][469442:469442] CHIP:FP: Forgetting fabric 0x1
[1719286450.595885][469442:469442] CHIP:TS: Pending Last Known Good Time: 2023-10-14T01:16:48
[1719286450.595996][469442:469442] CHIP:TS: Previous Last Known Good Time: 2023-10-14T01:16:48
[1719286450.596012][469442:469442] CHIP:TS: Reverted Last Known Good Time to previous value
[1719286450.596037][469442:469442] CHIP:CTL: Shutting down the commissioner
[1719286450.596070][469442:469442] CHIP:CTL: Shutting down the controller
[1719286450.596086][469442:469442] CHIP:CTL: Shutting down the System State, this will teardown the CHIP Stack
[1719286450.596185][469442:469442] CHIP:DMG: All ReadHandler-s are clean, clear GlobalDirtySet
[1719286450.596262][469442:469442] CHIP:FP: Shutting down FabricTable
[1719286450.596281][469442:469442] CHIP:TS: Pending Last Known Good Time: 2023-10-14T01:16:48
[1719286450.596346][469442:469442] CHIP:TS: Previous Last Known Good Time: 2023-10-14T01:16:48
[1719286450.596360][469442:469442] CHIP:TS: Reverted Last Known Good Time to previous value
[1719286450.596469][469442:469442] CHIP:DL: writing settings to file (/tmp/chip_counters.ini-na4n12)
[1719286450.596696][469442:469442] CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini)
[1719286450.596724][469442:469442] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0)
[1719286450.596746][469442:469442] CHIP:DL: Inet Layer shutdown
[1719286450.596751][469442:469442] CHIP:DL: BLE Layer shutdown
[1719286450.596962][469442:469442] CHIP:DL: System Layer shutdown
[1719286450.597153][469442:469442] CHIP:TOO: Run command failure: IM Error 0x000005C3: General error: 0xc3 (UNSUPPORTED_CLUSTER)
@wqx6
Copy link
Contributor

wqx6 commented Jun 26, 2024

You should not create the server instance which's life is within emberAfThreadBorderRouterManagementClusterInitCallback(), and the error log shows that the command handler with the same cluster ID has been registered. Do you call the ServerInstance::Init() function at other place?

Maybe you can refer to this #34043.

@bzbarsky-apple
Copy link
Contributor

@FIREWORKMBY It's really hard to say what's going on here given the small snippet missing larger context, but yes, @wqx6 points out a clear bug in the above code. Past that, I suggest creating a draft PR with the full code involved and asking for help on Slack in the tsg-tt-software-development channel as needed.

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

3 participants