Error message: "System.ArgumentException: Could not cast or convert from System.String to Gsx.Robot.Model.ParameterDictionary"

Symptom

  • Robot is unable to scan.

  • This error message is displayed in the Web UI: "Status is partially complete".

  • Robot logs are reporting the following error:

    |INFO|1|Program|-------------------------------------------------------------------
    |INFO|1|Program|Program.Main: Setting up Gsx.Robot Service...
    |INFO|1|Program|Program.Main: Loading Robot Manager options from 'Gsx.Robot.Options.json'
    |INFO|4|RobotService|-------------------------------------------------------------------
    |INFO|4|RobotService|RobotService.Start: Starting Gsx.Robot Service...
    [...]
    Error while executing the job:  Newtonsoft.Json.JsonSerializationException: Error converting value  "[...]"  to type 'Gsx.Robot.Model.ParameterDictionary'. Path '', line 1,  position 1942. ---> System.ArgumentException: Could not cast or  convert from System.String to Gsx.Robot.Model.ParameterDictionary.
    

Root cause of the issue

When installing the GSX Gizmo Robot Manager, a certificate is created and stored in the local computer "Intermediate Certification Authorities" personal certificates store.

The Robot Manager and all its Robots must have access to this certificate in order to be able to decrypt scanning configuration and parameters sent by the Gizmo Scan Configuration service.

When the account running the Gizmo Robot Windows Service does not have local admin rights, it is highly likely it will not have access to the local certificates store. When this is the case, it cannot access the private key required to decrypt parameters, and fails when scanning.

Debugging

Investigate permissions required to access the "localhost" certificate thumbprint stored in the vault for the account used to install the GSX Gizmo Robot Manager.

Workaround

  • Use RDP to access the machine running the GSX Gizmo Robot with a local admin rights account.

  • Create a temporary folder C:\TMP on C:

  • Access the certificates console using the MMC, you can also use CertMgr.

  • Select Computer account.

  • Navigate to Personal store under local computer certificate store.

  • Right-click on "localhost" then select / All Tasks / Export

  • Export the certificate: use the default values offered by the Export Wizard.

  • Save the exported certificate in the C:\TMP folder created above.

  • Access the certificates console using the MMC.

  • Select My user account.

  • Click on Action / All Tasks / Import to import the certificate under personal store current user settings. Use default values offered by the Import Wizard.

  • Restart the GSX Robot Windows Services.

  • Confirm the Robot is now scanning fine.

You can find the thumbprint of the Certificate of the Robot Manager in the registry keys.

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GSX Solutions\Robot Manager