openclaw - 💡(How to fix) Fix 400 No connected db error when using custom model provider (purepath) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59777Fetched 2026-04-08 02:40:39
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
2
Author
Participants
Timeline (top)
labeled ×1subscribed ×1

Description: OpenClaw consistently returns "400 No connected db" error when using a custom model provider via LiteLLM proxy. The same configuration works perfectly via direct API calls, indicating the issue is in OpenClaw's session management.

Environment:

OpenClaw version: 2026.3.28 Deployment: Docker container Host OS: Ubuntu 22.04 Configuration:

Copy // openclaw.json provider config "purepath": { "baseUrl": "http://172.18.0.2:4000/v1", "apiKey": "sk-litellm-proxy", "api": "openai-completions" } Steps to Reproduce:

Configure LiteLLM proxy on host (port 4000) Add purepath provider to OpenClaw config pointing to LiteLLM Select purepath/puremind-tools model in OpenClaw UI Send any message (e.g., "What is the capital of Nepal?") Error: 400 No connected db Expected Behavior: OpenClaw should connect to LiteLLM proxy and return model response.

Actual Behavior: Error: 400 No connected db (session database error)

Evidence that infrastructure works:

Copy

Direct API call from host works perfectly:

curl -H "Authorization: Bearer sk-litellm-proxy"
http://172.18.0.2:4000/v1/models

Returns: {"data":[{"id":"puremind-tools"}]}

curl -X POST http://172.18.0.2:4000/v1/chat/completions
-H "Authorization: Bearer sk-litellm-proxy"
-H "Content-Type: application/json"
-d '{"model": "puremind-tools", "messages": [{"role": "user", "content": "What is the capital of Nepal?"}]}'

Returns: "The capital of Nepal is Kathmandu."

What we've tried:

Cleared /data/.openclaw/memory/main.sqlite multiple times Restarted OpenClaw gateway multiple times Verified Docker networking (container can reach host IP) Same error persists regardless of session DB resets Logs:

Copy 2026-04-02T11:27:11.543-04:00 [agent/embedded] error=LLM request failed: network connection error. rawError=Connection error.

Error Message

OpenClaw consistently returns "400 No connected db" error when using a custom model provider via LiteLLM proxy. The same configuration works perfectly via direct API calls, indicating the issue is in OpenClaw's session management. Error: 400 No connected db Error: 400 No connected db (session database error) Same error persists regardless of session DB resets 2026-04-02T11:27:11.543-04:00 [agent/embedded] error=LLM request failed: network connection error. rawError=Connection error. Error: 400 No connected db Error: 400 No connected db (session database error) purepath/puremind-tools This is a custom model provider using LiteLLM proxy to Ollama (qwen2.5:3b). The model works perfectly via direct API calls, but OpenClaw's session management throws "400 No connected db" error when attempting to use it through the UI.

Root Cause

Description: OpenClaw consistently returns "400 No connected db" error when using a custom model provider via LiteLLM proxy. The same configuration works perfectly via direct API calls, indicating the issue is in OpenClaw's session management.

Environment:

OpenClaw version: 2026.3.28 Deployment: Docker container Host OS: Ubuntu 22.04 Configuration:

Copy // openclaw.json provider config "purepath": { "baseUrl": "http://172.18.0.2:4000/v1", "apiKey": "sk-litellm-proxy", "api": "openai-completions" } Steps to Reproduce:

Configure LiteLLM proxy on host (port 4000) Add purepath provider to OpenClaw config pointing to LiteLLM Select purepath/puremind-tools model in OpenClaw UI Send any message (e.g., "What is the capital of Nepal?") Error: 400 No connected db Expected Behavior: OpenClaw should connect to LiteLLM proxy and return model response.

Actual Behavior: Error: 400 No connected db (session database error)

Evidence that infrastructure works:

Copy

Direct API call from host works perfectly:

curl -H "Authorization: Bearer sk-litellm-proxy"
http://172.18.0.2:4000/v1/models

Returns: {"data":[{"id":"puremind-tools"}]}

curl -X POST http://172.18.0.2:4000/v1/chat/completions
-H "Authorization: Bearer sk-litellm-proxy"
-H "Content-Type: application/json"
-d '{"model": "puremind-tools", "messages": [{"role": "user", "content": "What is the capital of Nepal?"}]}'

Returns: "The capital of Nepal is Kathmandu."

What we've tried:

Cleared /data/.openclaw/memory/main.sqlite multiple times Restarted OpenClaw gateway multiple times Verified Docker networking (container can reach host IP) Same error persists regardless of session DB resets Logs:

Copy 2026-04-02T11:27:11.543-04:00 [agent/embedded] error=LLM request failed: network connection error. rawError=Connection error.

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Description: OpenClaw consistently returns "400 No connected db" error when using a custom model provider via LiteLLM proxy. The same configuration works perfectly via direct API calls, indicating the issue is in OpenClaw's session management.

Environment:

OpenClaw version: 2026.3.28 Deployment: Docker container Host OS: Ubuntu 22.04 Configuration:

Copy // openclaw.json provider config "purepath": { "baseUrl": "http://172.18.0.2:4000/v1", "apiKey": "sk-litellm-proxy", "api": "openai-completions" } Steps to Reproduce:

Configure LiteLLM proxy on host (port 4000) Add purepath provider to OpenClaw config pointing to LiteLLM Select purepath/puremind-tools model in OpenClaw UI Send any message (e.g., "What is the capital of Nepal?") Error: 400 No connected db Expected Behavior: OpenClaw should connect to LiteLLM proxy and return model response.

Actual Behavior: Error: 400 No connected db (session database error)

Evidence that infrastructure works:

Copy

Direct API call from host works perfectly:

curl -H "Authorization: Bearer sk-litellm-proxy"
http://172.18.0.2:4000/v1/models

Returns: {"data":[{"id":"puremind-tools"}]}

curl -X POST http://172.18.0.2:4000/v1/chat/completions
-H "Authorization: Bearer sk-litellm-proxy"
-H "Content-Type: application/json"
-d '{"model": "puremind-tools", "messages": [{"role": "user", "content": "What is the capital of Nepal?"}]}'

Returns: "The capital of Nepal is Kathmandu."

What we've tried:

Cleared /data/.openclaw/memory/main.sqlite multiple times Restarted OpenClaw gateway multiple times Verified Docker networking (container can reach host IP) Same error persists regardless of session DB resets Logs:

Copy 2026-04-02T11:27:11.543-04:00 [agent/embedded] error=LLM request failed: network connection error. rawError=Connection error.

Steps to reproduce

Steps to Reproduce:

Configure LiteLLM proxy on host (port 4000) Add purepath provider to OpenClaw config pointing to LiteLLM Select purepath/puremind-tools model in OpenClaw UI Send any message (e.g., "What is the capital of Nepal?") Error: 400 No connected db Expected Behavior: OpenClaw should connect to LiteLLM proxy and return model response.

Expected behavior

Expected Behavior: OpenClaw should connect to LiteLLM proxy and return model response.

Actual behavior

Actual Behavior: Error: 400 No connected db (session database error)

OpenClaw version

OpenClaw version: 2026.3.28

Operating system

Deployment: Docker container Host OS: Ubuntu 22.04

Install method

No response

Model

purepath/puremind-tools This is a custom model provider using LiteLLM proxy to Ollama (qwen2.5:3b). The model works perfectly via direct API calls, but OpenClaw's session management throws "400 No connected db" error when attempting to use it through the UI.

Provider / routing chain

openclaw (docker) -> litellm (host:172.18.0.2:4000) -> ollama (host:localhost:11434)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

  • Verify the session database connection settings in OpenClaw to ensure it can connect to the LiteLLM proxy correctly, as the issue seems to stem from OpenClaw's session management.

Guidance

  • Check the OpenClaw configuration file (openclaw.json) to ensure the purepath provider settings are correctly configured, especially the baseUrl and apiKey.
  • Verify that the LiteLLM proxy is correctly set up and accessible at http://172.18.0.2:4000/v1 from within the Docker container running OpenClaw.
  • Review the OpenClaw logs for any specific error messages related to database connections or session management that might provide more insight into the issue.
  • Consider testing the connection to the LiteLLM proxy from within the OpenClaw Docker container to ensure network connectivity is not the issue.

Example

No specific code example is provided due to the lack of direct code references in the issue, but ensuring the openclaw.json is correctly formatted and the LiteLLM proxy is accessible is key.

Notes

The issue seems to be related to how OpenClaw manages sessions when using a custom model provider via the LiteLLM proxy. Given that direct API calls work, the problem likely lies in OpenClaw's configuration or its interaction with the LiteLLM proxy.

Recommendation

  • Apply workaround: Temporarily bypass OpenClaw's session management or adjust its configuration to correctly connect to the LiteLLM proxy, as the direct API calls have proven the infrastructure works. This could involve adjusting the openclaw.json configuration or how OpenClaw interacts with the session database.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Expected Behavior: OpenClaw should connect to LiteLLM proxy and return model response.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING