Skip to content

fix: initialise tracing once to prevent knightverse-core startup panic - #1532

Open
Bigtura wants to merge 1 commit into
OpenKnight-Foundation:mainfrom
Bigtura:fix/issue-1396-be-131-knightverse-core-binary-panics-at
Open

Bigtura wants to merge 1 commit into
OpenKnight-Foundation:mainfrom
Bigtura:fix/issue-1396-be-131-knightverse-core-binary-panics-at

Conversation

@Bigtura

@Bigtura Bigtura commented Oct 21, 2026

Copy link
Copy Markdown

Overview

This PR fixes a startup panic in the knightverse-core binary caused by initialising the global tracing subscriber twice. Tracing is now initialised in a single place, and the library uses try_init() so a second registration no longer panics.

Related Issue

Changes

🔧 Tracing Initialisation Fix

  • [MODIFY] backend/src/main.rs

    • Removed the duplicate tracing_subscriber::fmt().init() call so the binary no longer registers a global subscriber before delegating to the library entry point.
  • [MODIFY] backend/modules/api/src/server.rs

    • Switched the library's tracing setup to try_init() so it tolerates an already-registered global subscriber instead of panicking.

Verification Results

cargo build -p api
✅ Builds successfully

cargo run -p api
✅ Binary starts without the double-init panic
Acceptance Criteria Status
Initialise tracing in one place (use try_init() in the library) ✅ Duplicate init removed from main.rs; library uses try_init()
Make the binary start successfully in CI ✅ Binary starts without the global-subscriber panic

Closes #1396

@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@Bigtura Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Bigtura
Bigtura force-pushed the fix/issue-1396-be-131-knightverse-core-binary-panics-at branch from 62be37a to e709120 Compare October 22, 2026 00:17

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BE-131: knightverse-core Binary Panics at Startup by Initialising Tracing Twice

1 participant