Skip to content

fix(jans-fido2): avoid spurious cluster ConfigurationException in metrics aggregation#14222

Draft
imran-ishaq wants to merge 1 commit into
mainfrom
jans-fido2-metrics-cluster-node-single-node-detection
Draft

fix(jans-fido2): avoid spurious cluster ConfigurationException in metrics aggregation#14222
imran-ishaq wants to merge 1 commit into
mainfrom
jans-fido2-metrics-cluster-node-single-node-detection

Conversation

@imran-ishaq

@imran-ishaq imran-ishaq commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Prepare

Description

Target issue

closes #14221

Implementation Details

Single-node FIDO2 deployments logged an io.jans.exception.ConfigurationException: ou=node is not configured in static configuration of AS (jansConfStatic). with a full stack trace on every metrics aggregation run (hourly/daily/weekly/monthly), making a healthy deployment look broken.

Root cause: Fido2MetricsAggregationScheduler.initializeClusterEnvironment() flagged the deployment as a cluster whenever the Fido2ClusterNodeService CDI bean was present — which is always, since it is @ApplicationScoped. But cluster coordination requires ou=node in jansConfStatic, which is absent in the default single-node setup. Every cluster call (getClusterNodesLive() via startPeriodicLockUpdates()) then threw the exception, which was logged at ERROR level with a full stack trace. Aggregation still completed via existing fallbacks, so this was misleading log noise rather than a functional failure.

Fix:

  1. initializeClusterEnvironment() now checks getBaseClusterNodeDn() up front. If ou=node is unconfigured (blank), it runs in single-node mode and never makes cluster calls, so the exception is never thrown. It emits a clean INFO line: FIDO2 metrics aggregation in SINGLE-NODE mode (ou=node not configured).
  2. startPeriodicLockUpdates() now logs a concise one-line warn (message only) instead of error with a full stack trace, since the single-node fallback already handles the condition gracefully.

No functional change: cluster deployments (with ou=node configured) keep full distributed locking exactly as before; single-node deployments produce the same aggregation result, just without the misleading stack trace. Only one file changed: jans-fido2/server/src/main/java/io/jans/fido2/service/metric/Fido2MetricsAggregationScheduler.java.


Test and Document the changes

  • Static code analysis has been run locally and issues have been fixed
  • Relevant unit and integration tests have been added/updated
  • Relevant documentation has been updated if any (i.e. user guides, installation and configuration guides, technical design docs etc)

Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with docs: to indicate documentation changes or if the below checklist is not selected.

  • I confirm that there is no impact on the docs due to the code changes in this PR.

…rics aggregation

Signed-off-by: imran <imranishaq7071@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: eb8271b0-4bc1-4aab-8712-9cfaa2396e99

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jans-fido2-metrics-cluster-node-single-node-detection

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mo-auto mo-auto added comp-jans-fido2 Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality labels Jun 5, 2026
@imran-ishaq imran-ishaq changed the title fix(jans-fido2): avoid spurious cluster ConfigurationException in met… fix(jans-fido2): avoid spurious cluster ConfigurationException in metrics aggregation Jun 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

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

Labels

comp-jans-fido2 Component affected by issue or PR kind-bug Issue or PR is a bug in existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(jans-fido2): metrics aggregation logs spurious "ou=node is not configured" ConfigurationException in single-node mode

2 participants