Skip to content

[BUG] A project's .env LOG_LEVEL Interferes with basic-memory #227

@jpmurray

Description

@jpmurray

When adding a new project using uvx basic-memory project add project-name '~/path/project/memory', the process fails if the project's directory contains a dotenv file (ie. : ~/path/project/.env) with a LOG_LEVEL=debug entry. It seems basic-memory reads this environment variable and expects the value to be uppercase, causing an error. I'm personally encountering this with a Laravel project, but I'm expecting a lot more instance could be found of a dotenv file with this value.

This is problematic especially when using it as MCP in editors like Roo Code's mcp.json, as it seems it will run the uvx command in the root of its project, and it then catches said project's .env, failing to start because of the above.

Steps to Reproduce

  1. Create a folder with a .env file (~/path/project/.env)
  2. Add a line to .env: LOG_LEVEL=debug
  3. Add a project : uvx basic-memory project add project-name '~/path/project/memory'
  4. cd ~/path/project && uvx basic-memory project list should be failing.
  5. For my Roo Code example, having a ~/path/project/.roo/mcp.json with basic-memory in it will fail if the LOG_LEVEL value is present and lowercase.

Expected Behavior

basic-memory should not be affected by environment variables defined in a project's .env file, especially if they are unrelated to basic-memory's functionality. The project should be added successfully, regardless of the log level value or casing.

What could be done

Make it so basic-memory accepts the debug string regardless of casing.

Prefix BM's environment variables names could be an option too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions