Skip to content

[BUG] ValueError: Level 'debug' does not exist when running basic-memory with Python 3.12+ / macOS #244

@rgazeredo

Description

@rgazeredo

Bug Description

When running basic-memory mcp (version 0.14.2) on macOS with Python 3.12.11, I receive the following error:


ValueError: Level 'debug' does not exist

This error occurs in basic_memory/utils.py during loguru setup, specifically at the call:

logger.add(..., level="debug", ...)

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install basic-memory version 0.14.2 via pip or pipx with Python 3.12.11
  2. Run: basic-memory mcp
  3. The CLI configures loguru logging
  4. Execution fails with a ValueError stating "Level 'debug' does not exist"

Expected Behavior

basic-memory mcp should start the MCP server successfully without raising an exception. The logging configuration should accept a standard log level "DEBUG".


Actual Behavior

Instead of launching, execution fails with the traceback:

ValueError: Level 'debug' does not exist

This happens because loguru does not recognize "debug" (lowercase) as a valid log level name. Its API (logger.add(..., level="...")) expects uppercase strings like "DEBUG" ([GitHub][1], [GitHub][2], [Loguru][3]).


Environment

  • OS: macOS (Apple Silicon)
  • Python version: 3.12.11 (via Homebrew)
  • Basic‑memory version: 0.14.2
  • Installation method: installed via pipx --python /opt/homebrew/bin/python3.12
  • Claude Desktop version (if applicable): N/A

Additional Context

  • No existing issue was found regarding this error in the official repository.
  • loguru requires log level names in uppercase (e.g. "DEBUG"); lowercase "debug" is invalid and triggers ValueError ([Loguru][3]).
  • The issue appears on Python ≥ 3.12, showing incompatibility with lowercase default log level.

Possible Solution

As a workaround, edit basic_memory/utils.py and change:

logger.add(..., level="debug", ...)

to:

logger.add(..., level="DEBUG", ...)

For a long‑term fix, the codebase should normalize log level inputs or default to uppercase. Introducing automated tests for Python 3.12+ would also help prevent this in future releases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions