We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nil
tasker
In the if block below, if tasker is nil, this causes a panic,
if
osconfig/main.go
Lines 247 to 255 in 235ada8
Sep 04 21:02:41 myhost.internal OSConfigAgent[433]: 2024-09-04T21:02:41.6314Z OSConfigAgent Info: Restart required marker file exists, beginning agent shutdown, waiting for tasks to complete. Sep 04 21:02:41 myhost.internal google_osconfig_agent[433]: panic: close of nil channel Sep 04 21:02:41 myhost.internal google_osconfig_agent[433]: goroutine 81 [running]: Sep 04 21:02:41 myhost.internal google_osconfig_agent[433]: github.com/GoogleCloudPlatform/osconfig/tasker.Close() Sep 04 21:02:41 myhost.internal google_osconfig_agent[433]: /tmp/debpackage/google-osconfig-agent-20240501.03/tasker/tasker.go:58 +0x45 Sep 04 21:02:41 myhost.internal google_osconfig_agent[433]: main.runInternalPeriodics({0xf67778, 0xc00051a180}) Sep 04 21:02:41 myhost.internal google_osconfig_agent[433]: /tmp/debpackage/google-osconfig-agent-20240501.03/main.go:249 +0xca Sep 04 21:02:41 myhost.internal google_osconfig_agent[433]: created by main.runServiceLoop in goroutine 1 Sep 04 21:02:41 myhost.internal google_osconfig_agent[433]: /tmp/debpackage/google-osconfig-agent-20240501.03/main.go:267 +0x8d Sep 04 21:02:41 myhost.internal systemd[1]: google-osconfig-agent.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Sep 04 21:02:41 myhost.internal systemd[1]: google-osconfig-agent.service: Failed with result 'exit-code'. Sep 04 21:02:42 myhost.internal systemd[1]: google-osconfig-agent.service: Scheduled restart job, restart counter is at 1. Sep 04 21:02:42 myhost.internal systemd[1]: Stopped google-osconfig-agent.service - Google OSConfig Agent.
Probably to check if tasker is nil before using it, that would at least allow the code to reach the range deferredFuncs and not cause a panic.
range deferredFuncs
That being said, I'm not completely sure how tasker was nil in the first place, which may be the underlying issue.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue
In the
if
block below, iftasker
is nil, this causes a panic,osconfig/main.go
Lines 247 to 255 in 235ada8
Proposed Fix
Probably to check if
tasker
isnil
before using it, that would at least allow the code to reach therange deferredFuncs
and not cause a panic.That being said, I'm not completely sure how
tasker
was nil in the first place, which may be the underlying issue.The text was updated successfully, but these errors were encountered: