If the Server responds with an error/timeout for the configuration call. Sidecar detects this as a 'new' configuration and rewrites the local configuration and restarts the specific agent. In the next iteration it detects the correct configuration again as new configuration and restarts the agent.
Steps to reproduce the problem
Make sure the request for the configuration times out or fails, without an HTTP Status Code or DNS Resolution times out via UDP.
Problem description
If the Server responds with an error/timeout for the configuration call. Sidecar detects this as a 'new' configuration and rewrites the local configuration and restarts the specific agent. In the next iteration it detects the correct configuration again as new configuration and restarts the agent.
Steps to reproduce the problem
Possible Solution
In this Line the Error gets detected from the sidecar, and the error gets logged to file: https://github.com/Graylog2/collector-sidecar/blob/cd538a158832ec48f257598fe44185ccfff84c4c/api/graylog.go#L109-L113
As the resp being nil following condition does not match: https://github.com/Graylog2/collector-sidecar/blob/cd538a158832ec48f257598fe44185ccfff84c4c/api/graylog.go#L115
So the last return statement triggers and returns an 'nil' Error, which leads the calling procedure to 'detect' a new config: https://github.com/Graylog2/collector-sidecar/blob/cd538a158832ec48f257598fe44185ccfff84c4c/api/graylog.go#L136
Logs