Skip to content

Fix sidecar server config loading#26200

Merged
xd4rker merged 4 commits into
masterfrom
fix/sidecar-config-loading
Jun 3, 2026
Merged

Fix sidecar server config loading#26200
xd4rker merged 4 commits into
masterfrom
fix/sidecar-config-loading

Conversation

@xd4rker
Copy link
Copy Markdown
Member

@xd4rker xd4rker commented Jun 2, 2026

Description

This fixes an issue with SidecarPluginConfiguration not being registered as a server config bean. Its sidecar_* settings in graylog.conf were ignored and always fell back to default values.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@xd4rker xd4rker requested a review from a team June 2, 2026 16:10
@xd4rker xd4rker marked this pull request as ready for review June 2, 2026 16:10
@xd4rker xd4rker added the bug label Jun 2, 2026
@patrickmann patrickmann self-requested a review June 3, 2026 06:26
@patrickmann patrickmann self-assigned this Jun 3, 2026
Copy link
Copy Markdown
Contributor

@patrickmann patrickmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch. This is a good targeted fix and we should backport it.

Consider filing a separate issue for follow-up to prevent similar issues going forward:

Title: Detect server config beans that are bound but never parsed from graylog.conf

PR #26200 fixed SidecarPluginConfiguration being ignored: its sidecar_* settings in graylog.conf were never read, and the server silently used defaults. Root cause was that the bean was bound into Guice but never registered with JadConfig, so the parsed values never reached the injected instance.

The failure was silent — there was no test and no startup check that would have caught it. The same gap applies to any PluginConfigBean, not just Sidecar.

Invariant to enforce

For every PluginConfigBean type that gets injected, the instance Guice provides must be the same instance JadConfig populated from graylog.conf. Today a bean can be bound (or JIT-constructed) without ever passing through JadConfig, in which case it silently carries field defaults.

Proposed checks:

  1. Guardrail test. Build the server injector and assert that every bean in the bound Set is also present (by reference) in jadConfig.getConfigurationBeans(). This currently has zero test coverage and would fail loudly if the #26200 fix were reverted.
  2. Targeted startup check. Near the end of bootstrap, diff the bound PluginConfigBean classes against the classes registered with JadConfig and log an ERROR (or fail startup) for any bean that was bound but never parsed. Self-contained; no behavior change for correctly-registered beans.

Out of scope

  • Enabling requireExplicitBindings() on the main injector (separate hardening effort).
  • Unifying the two registration paths (getNodeCommandConfigurationBeans() vs PluginModule.getConfigBeans()) into a single source of truth. Worth a follow-up ticket but more involved due to bootstrap ordering.

@xd4rker xd4rker merged commit 7ed809a into master Jun 3, 2026
23 checks passed
@xd4rker xd4rker deleted the fix/sidecar-config-loading branch June 3, 2026 09:07
xd4rker added a commit that referenced this pull request Jun 3, 2026
* Fix sidecar server config loading

* Add changelog

(cherry picked from commit 7ed809a)
dennisoelkers pushed a commit that referenced this pull request Jun 4, 2026
* Fix sidecar server config loading

* Add changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants