Skip to content

fix: sanitize error logs#125

Merged
Evrard-Nil merged 4 commits into
mainfrom
fix/error-log
Oct 31, 2025
Merged

fix: sanitize error logs#125
Evrard-Nil merged 4 commits into
mainfrom
fix/error-log

Conversation

@hanakannzashi
Copy link
Copy Markdown
Member

Removed potential information leakage code from the error log

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR systematically removes detailed error information from logging statements across the codebase to prevent sensitive data exposure in logs. The changes focus on sanitizing error logs while maintaining error details where they are returned to error handlers or included in error responses.

Key changes:

  • Replace map_err(|e| { tracing::error!("message: {}", e); e }) with inspect_err(|_| { tracing::error!("message") })
  • Remove error details from logging statements while preserving them in returned error values
  • Convert unused error bindings from Err(e) to Err(_) where error details are no longer logged

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/services/src/responses/mod.rs Sanitized error logs in response service by removing error details from tracing statements
crates/services/src/mcp/manager.rs Removed detailed error logging when connecting to MCP servers
crates/services/src/inference_provider_pool/mod.rs Made detailed_error_msg unused and removed it from error logging
crates/services/src/completions/mod.rs Sanitized error logs in completion service for attestation and usage recording
crates/services/src/auth/mod.rs Removed error details from logs when creating default org/workspace for new users
crates/services/src/attestation/mod.rs Sanitized error logs in attestation service
crates/database/src/repositories/mcp_connector.rs Changed SQL error logging from error to debug level
crates/database/src/patroni_discovery.rs Removed error details from cluster state refresh logging
crates/database/src/cluster_manager.rs Removed error details from cluster management logging
crates/api/src/routes/*.rs Sanitized error logs across all API routes (workspaces, users, usage, responses, organizations, etc.)
crates/api/src/middleware/*.rs Sanitized error logs in authentication, authorization, and usage middleware
crates/api/src/lib.rs Removed error details from OAuth manager and model discovery initialization logs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/api/src/routes/organizations.rs Outdated
Comment thread crates/services/src/inference_provider_pool/mod.rs Outdated
Comment thread crates/api/src/routes/usage.rs
@think-in-universe think-in-universe changed the title fix: error log fix: sanitize error logs Oct 31, 2025
@Evrard-Nil Evrard-Nil merged commit 8ddf62c into main Oct 31, 2025
1 of 2 checks passed
@PierreLeGuen PierreLeGuen deleted the fix/error-log branch October 31, 2025 16:59
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.

4 participants