From dabe15839d34ad68dbcf1322c9ebd8eeefa0c98e Mon Sep 17 00:00:00 2001 From: Kevin L'Hereec Date: Wed, 3 Jun 2026 15:56:33 +0200 Subject: [PATCH] fix: handle GPN Fault in DiscoveringParametersState When the CPE responds with a CWMP Fault to GetParameterNames, mark gpnStatus as 'unsupported' and continue to ConfigurationEvaluationState instead of hanging the session. --- app/services/cwmp/main_state_machine.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/services/cwmp/main_state_machine.ts b/app/services/cwmp/main_state_machine.ts index 1fdecc8..729c9cd 100644 --- a/app/services/cwmp/main_state_machine.ts +++ b/app/services/cwmp/main_state_machine.ts @@ -72,6 +72,16 @@ class DiscoveringParametersState extends DeviceState { return { response: await this.processNext(context) } } + // If CPE responded with a Fault, GPN is not supported — skip discovery + if (context.message && !context.message.success) { + logger.info( + { faultData: context.message.data }, + '[DiscoveringParameters] GPN Fault received — marking as unsupported' + ) + context.device.setGpnStatus('unsupported') + return { nextState: new ConfigurationEvaluationState(), response: '' } + } + // Process response and continue if (this.parameterQueue.length > 0) { return { response: await this.processNext(context) }