NullReferenceException in client logs

NullReferenceException in client logs

If the client isn’t reporting and the log shows this:

2024-08-12T06:27:04 ERROR trigger(10780) << Main << Failed to run action GytpolClient.CliActions.CliActionTrigger. Exception: System.NullReferenceException: Object reference not set to an instance of an object. at GytpolClient.services.StateScanTrigger.UpdateState(ClientStateConfig state, Boolean value) in C:\jenkins\workspace\Windows-Client-Build\agent\src\GytpolClientFW2\services\ServiceState.cs:line 105 at GytpolClient.services.ClientStateProp`1.Set(TValue value) in C:\jenkins\workspace\Windows-Client-Build\agent\src\GytpolClientFW2\services\ServiceState.cs:line 37 at GytpolClient.services.ServiceState.set_ScanTrigger(Boolean value) in C:\jenkins\workspace\Windows-Client-Build\agent\src\GytpolClientFW2\services\ServiceState.cs:line 208 at GytpolClient.CliActions.CliActionTrigger.Run() in C:\jenkins\workspace\Windows-Client-Build\agent\src\GytpolClientFW2\CliActions\CliActionTrigger.cs:line 17 at GytpolClient.Program.Main(String[] args) in C:\jenkins\workspace\Windows-Client-Build\agent\src\GytpolClientFW2\Program.cs:line 92

Please verify that all the files in C:\Program Files\WindowsPowerShell\Modules\gytpol\Config are present.

There should be four files in total, as listed below.

image-20240821-110211.png

Please also ensure that "state.json" is not empty and that "client.json" contains the following information:

{"isTerminal":false,"archiveEnabled":false}

If the "state.json" file is empty or contains NULL values, please delete the file and run the gytpolTask to initiate a scan. The scan should recreate the "state.json" file, and the device should report correctly.