Fix issue with the agent service on windows stuck in starting state
@@ -68,10 +68,9 @@ func start(log logger.T, instanceIDPtr *string, regionPtr *string, shouldCheckHi
// Do a health check before starting the agent.
// Health check would include creating a health module and sending empty health pings to the service.
// If response is positive, start the agent, else retry and eventually back off (hibernate/passive mode).
- status, err := healthModule.GetAgentState()
- if shouldCheckHibernation && status == health.Passive {
+ if status, hibernationErr := healthModule.GetAgentState(); shouldCheckHibernation && status == health.Passive {
//Starting hibernate mode
- context.Log().Info("Entering SSM Agent hibernate - ", err)
+ context.Log().Info("Entering SSM Agent hibernate - ", hibernationErr)
go func() {
hibernateState.ExecuteHibernation()
err = startAgent(ssmAgent, context, log, instanceIDPtr, regionPtr)
