Skip to content

[Bug]: SettingsError raised when parsing environment variable observability_exclude_paths in Pydantic settings #1415

@calculus-ask

Description

@calculus-ask

🐞 Bug Summary

When starting the application with Gunicorn, initialization fails due to a pydantic_settings.exceptions.SettingsError triggered while parsing the environment variable observability_exclude_paths. The error originates from Pydantic’s environment settings source during the creation of the Settings instance in mcpgateway/config.py. This indicates that the value provided for observability_exclude_paths is not in the expected format or type (for example, a string instead of a list or JSON array). As a result, the configuration cannot be loaded and the application fails to start.

Pls note the above summary is generated by AI using the logs. I have provided logs in Logs section.


🧩 Affected Component

Select the area of the project impacted:

  • [YES ] mcpgateway - API
  • mcpgateway - UI (admin panel)
  • mcpgateway.wrapper - stdio wrapper
  • Federation or Transports
  • CLI, Makefiles, or shell scripts
  • Container setup (Docker/Podman/Compose)
  • Other (explain below)

🔁 Steps to Reproduce

  1. helm upgrade --install mcp-stack . --namespace mcpgw-rbac --create-namespace=false -f values.yaml --wait --timeout 5m --debug

  2. PLUGINS_ENABLED: "true"

  3. pgadmin:
    enabled: false

  4. mcpFastTimeServer:
    enabled: false

  5. probes:
    readiness:
    type: exec
    command:
    - sh
    - -c
    - pg_isready -U "$POSTGRES_USER"

  6. liveness:
    type: exec
    command:
    - sh
    - -c
    - pg_isready -U "$POSTGRES_USER"


🤔 Expected Behavior


📓 Logs / Error Output

Paste any relevant stack traces or logs here.
⚠️ Do not paste secrets, credentials, or tokens.
Traceback (most recent call last):
File "/app/.venv/lib64/python3.12/site-packages/gunicorn/app/base.py", line 110, in get_config_from_filename
spec.loader.exec_module(mod)
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "/app/gunicorn.config.py", line 19, in
from mcpgateway.config import settings
File "/app/mcpgateway/init.py", line 19, in
from mcpgateway import reverse_proxy, wrapper, translate
File "/app/mcpgateway/reverse_proxy.py", line 67, in
from mcpgateway.services.logging_service import LoggingService
File "/app/mcpgateway/services/init.py", line 15, in
from mcpgateway.services.gateway_service import GatewayError, GatewayService
File "/app/mcpgateway/services/gateway_service.py", line 73, in
from mcpgateway.config import settings
File "/app/mcpgateway/config.py", line 1564, in
settings = get_settings()
^^^^^^^^^^^^^^
File "/app/mcpgateway/config.py", line 1542, in get_settings
cfg = Settings()
^^^^^^^^^^
File "/app/mcpgateway/config.py", line 1457, in init
super().init(**kwargs)
File "/app/.venv/lib64/python3.12/site-packages/pydantic_settings/main.py", line 194, in init
**pydantic_self._settings_build_values(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib64/python3.12/site-packages/pydantic_settings/main.py", line 436, in _settings_build_values
source_state = source()
^^^^^^^^
File "/app/.venv/lib64/python3.12/site-packages/pydantic_settings/sources/base.py", line 498, in call
raise SettingsError(
pydantic_settings.exceptions.SettingsError: error parsing value for field "observability_exclude_paths" from source "EnvSettingsSource"


🧠 Environment Info

You can retrieve most of this from the /version endpoint.

Key Value
version v0.9.0
Runtime e.g. Python 3.11, Gunicorn
Platform / OS e.g. Ubuntu 22.04
Container helm, k8 pods

🧩 Additional Context (optional)

Add any configuration details, flags, or related issues.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriageIssues / Features awaiting triage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions