Troubleshooting
Common issues and fixes for Data360 Chat.
Database
Connection refused / cannot connect
- Check: PostgreSQL is running (
pg_isreadyorpsql -l). - Check:
DATABASE_URLorPOSTGRES_*variables are correct. - Check: Database exists:
createdb chatbotif needed. - Docker: Ensure backend uses
db:5432(service name) when in Docker Compose.
Permission denied for table
- Cause: App user may not have grants on new tables.
- Fix: Run migrations with the user that has CREATE/GRANT; migrations using
migration_utilsgrant to the app user. EnsurePOSTGRES_USERmatches the app user when running migrations.
Migration errors
- Check: Database is up to date:
uv run alembic upgrade head. - Check: Migration files are in
backend/alembic/versions/. - Check: Schema matches models; resolve conflicts manually if needed.
CORS and cookies
CORS error in browser
- Cause: Frontend origin not in
CORS_ORIGINS. - Fix: Add the exact frontend URL (e.g.
https://chat.example.com) toCORS_ORIGINS. No trailing slash. No wildcard when using credentials.
Cookies not sent / session lost
- Cause:
COOKIE_DOMAINmay be wrong; or frontend/backend on different origins without correct config. - Fix: Set
COOKIE_DOMAINto the parent domain (e.g..example.com) if frontend and backend share it. Ensure cookies useSecurein production andSameSiteis appropriate.
MCP and LLM
MCP timeout / connection error
- Cause: Data360 MCP server unreachable or slow.
- Fix: Check
MCP_SERVER_URLis correct and the backend can reach it. IncreaseMCP_TIMEOUTandMCP_LOAD_TIMEOUTif needed. For Docker, ensurehost.docker.internalor the correct host is used if MCP runs on the host.
Chat not responding / hanging
- Cause: Missing API keys or wrong LLM configuration.
- Fix: Ensure
backend/.envhasOPENAI_API_KEY(or Azure credentials) andMODEL_PREFIX(e.g.openai/orazure/). Check backend logs for LLM errors.
Docker
404 on first access
- Cause: Stale browser cookies.
- Fix: Use incognito or clear cookies for localhost:3001.
Database errors after volume deletion
- Fix:
docker compose down -vthendocker compose up -d --build.
Missing root .env
- Fix: Create
.envin project root withPOSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DB.
Ports
| Port | Service |
|---|---|
| 3000 / 3001 | Frontend |
| 8001 | Backend |
| 5432 / 5433 | PostgreSQL |
| 6379 | Redis |
If a port is in use, change it in the respective config (e.g. pnpm dev --port 3002, uvicorn --port 8002).