Skip to content

Log file path causes "Read-only file system" error on macOS #9

Description

@hkcvlt

logger-fix.patch

Bug Description

The MCP server fails to start on macOS with the following error:

OSError: [Errno 30] Read-only file system: '/cv_mcp.log'

Root Cause

In src/logger.py:31, the log file is created using a relative path "cv_mcp.log", which is being resolved to the root directory /cv_mcp.log when the
server starts. The root directory is read-only on macOS, causing the initialization to fail.

  file_handler = RotatingFileHandler("cv_mcp.log", maxBytes=10485760, backupCount=5)

Solution

Change the log file path to use an absolute path pointing to the project directory:

from pathlib import Path

# Use project directory for log file
log_file = Path(__file__).parent.parent / "cv_mcp.log"
file_handler = RotatingFileHandler(log_file, maxBytes=10485760, backupCount=5)

Impact

  • Prevents server from starting
  • Affects macOS users (and potentially other Unix-like systems with read-only root)
  • Server crashes immediately on initialization

Environment

  • OS: macOS (Darwin 24.6.0)
  • Python: 3.11.14
  • Error Location: src/logger.py:31

Additional Configuration

SSL Certificate Verification

The server supports an SSL_VERIFY environment variable to control SSL certificate verification when connecting to Commvault servers.

Usage:

Add to your .env file in the project root:

# Disable SSL verification (useful for self-signed certificates or testing)
SSL_VERIFY=false

# Enable SSL verification (default)
SSL_VERIFY=true

Note: The current implementation in setup.py:159 has the SSL verification enabled by default. This corrects this behavior, allowing users to bypass SSL certificate validation when working with Commvault servers that use self-signed certificates or in development/testing/POC environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions