Skip to content

fix: handle case-insensitive LOG_LEVEL environment variable - #33

Merged
surrealwolf merged 2 commits into
mainfrom
fix/log-level-case-sensitivity
Jan 12, 2026
Merged

surrealwolf merged 2 commits into
mainfrom
fix/log-level-case-sensitivity

Conversation

@surrealwolf

Copy link
Copy Markdown
Collaborator

Problem

The high-command-mcp pods are in CrashLoopBackOff with the following error:

ValueError: Unknown level: 'info'

The ConfigMap high-command-mcp-config has LOG_LEVEL: info (lowercase), but Python's logging module requires uppercase log levels (e.g., INFO, DEBUG, WARNING, ERROR).

Solution

Convert the LOG_LEVEL environment variable to uppercase before passing it to logging.basicConfig(). This makes the code more robust and handles both lowercase and uppercase log level values gracefully.

Changes

  • Modified highcommand/server.py to convert LOG_LEVEL to uppercase using .upper()
  • This fix handles both "INFO" and "info" (and any other case combination)

Testing

This fix resolves the CrashLoopBackOff issue. The code now accepts:

  • LOG_LEVEL=info (lowercase) ✅
  • LOG_LEVEL=INFO (uppercase) ✅
  • LOG_LEVEL=Info (mixed case) ✅

Note

The ConfigMap is managed by Helm/GitOps, so direct patching won't persist. This code fix is the proper solution as it handles the case-insensitivity issue regardless of how the ConfigMap is configured.

The LOG_LEVEL environment variable from ConfigMaps may be lowercase (e.g., 'info')
but Python's logging module requires uppercase (e.g., 'INFO'). Convert the
log level to uppercase before passing it to logging.basicConfig() to handle
both cases gracefully.

Fixes CrashLoopBackOff issue where pods fail with:
ValueError: Unknown level: 'info'
@surrealwolf
surrealwolf merged commit 1f4f9f4 into main Jan 12, 2026
8 checks passed
@surrealwolf
surrealwolf deleted the fix/log-level-case-sensitivity branch January 12, 2026 00:16
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.

1 participant