Assets discovery throws "Unhealthy. Invalid network message signature. Message is corrupted or invalid agent token was specified" when an agent is reinstalled.
Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Assets discovery throws "Unhealthy. Invalid network message signature. Message is corrupted or invalid agent token was specified" when an agent is reinstalled on the same machine.
Environment
Discovery 7.0.2 and higher.
JSM DC and Cloud
Diagnosis
Discovery tool shows an error "Unhealthy. Invalid network message signature. Message is corrupted or invalid agent token was specified" at the agents page on the GUI
Enabling Debug on the discovery tool will have the below logging.
- Open discovery tool
- Go to common tab
- Set the log level to Debug and close the application.
Below traces will be observed at the latest scan logs in the Discovery <Installation directory>\ logs folder. (By default it will be in the path C:\Program Files\Atlassian\Discovery Tools\logs)
[Debug] Stopping AgentClient to xxxx.xxxx.xxxx.xxx:51337. Reason: Invalid network message signature. Message is corrupted or invalid agent token was specified.
[Debug] AgentClient to xxxx.xxxx.xxxx.xxx:51337 connection state change to Disconnected
Cause
On installing discovery agent, the agent sends data to the discovery tool after successful connection by updating the token. Discovery tool retains the agent details in an encrypted file . When reinstalling agent on the same machine using the existing token, discovery will not allow the agent to connect as it already has the agent's info on the encrypted file. This leads to the above error in the logs. This is tracked on JSDSERVER-15438
Solution
Any one of the below solutions can be applied if the agent is reinstalled on the same machine previously configured.
- Retain the agent installation folder or agent.cfg file located in Discovery agent <installation folder> (By default it will be in the path C:\Program Files\Atlassian\Discovery Agent\) and restore it on the same path .
- Creating a new token at discovery.
- This will lead to updating the token at all the agents manually. This is not scalable if there are multiple agents configured at the discovery tool.