[URGENT] NodeHub deployment fails - PostgreSQL not available #13

Closed
opened 2026-04-10 20:17:28 +00:00 by Mark · 1 comment
Owner

Issue

Deployment to NodeHub (https://nodehub.tail018ac4.ts.net) fails immediately after container starts.

Error

psycopg2.OperationalError: connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
	Is the server running on that host and accepting TCP/IP connections?

Root Cause

The application expects a PostgreSQL database running at localhost:5432, but NodeHub only deploys single containers - not the full docker-compose stack.

msp_c2 Architecture:

  • docker-compose.yml defines 3 services: backend, frontend, and postgres (db)
  • When deployed to NodeHub, only one container runs
  • No database service is available in the container
  • App crashes trying to connect to localhost:5432

Solutions

  1. Set up PostgreSQL externally (e.g., Supabase, Neon, or self-hosted)
  2. Update DATABASE_URL environment variable to point to external DB
  3. The app should work without local DB

Option 2: Build a self-contained image

  1. Create a Dockerfile that bakes the DB INTO the image (not recommended)
  2. Or use SQLite instead of PostgreSQL for single-container deployment

Option 3: Run on traditional hosting

Use full docker-compose deployment instead of NodeHub.

Immediate Action Required

  1. Provide an external PostgreSQL connection string via DATABASE_URL env var
  2. OR set up a shared PostgreSQL instance on NodeHub server

Verification

Run locally to confirm the fix:

# With external DATABASE_URL
DATABASE_URL=postgresql://user:pass@host:5432/msp_c2 python scripts/seed_demo_data.py

If you'd like NodeHub to support a shared database service, let me know - we could add PostgreSQL as a shared service.

## Issue Deployment to NodeHub (https://nodehub.tail018ac4.ts.net) fails immediately after container starts. ## Error ``` psycopg2.OperationalError: connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections? ``` ## Root Cause The application expects a PostgreSQL database running at `localhost:5432`, but NodeHub only deploys **single containers** - not the full docker-compose stack. **msp_c2 Architecture:** - docker-compose.yml defines 3 services: backend, frontend, and postgres (db) - When deployed to NodeHub, only one container runs - No database service is available in the container - App crashes trying to connect to localhost:5432 ## Solutions ### Option 1: Use a hosted database (Recommended for NodeHub) 1. Set up PostgreSQL externally (e.g., Supabase, Neon, or self-hosted) 2. Update DATABASE_URL environment variable to point to external DB 3. The app should work without local DB ### Option 2: Build a self-contained image 1. Create a Dockerfile that bakes the DB INTO the image (not recommended) 2. Or use SQLite instead of PostgreSQL for single-container deployment ### Option 3: Run on traditional hosting Use full docker-compose deployment instead of NodeHub. ## Immediate Action Required 1. Provide an external PostgreSQL connection string via `DATABASE_URL` env var 2. OR set up a shared PostgreSQL instance on NodeHub server ## Verification Run locally to confirm the fix: ```bash # With external DATABASE_URL DATABASE_URL=postgresql://user:pass@host:5432/msp_c2 python scripts/seed_demo_data.py ``` If you'd like NodeHub to support a shared database service, let me know - we could add PostgreSQL as a shared service.
Author
Owner

Fixed in commit. Closing.

Fixed in commit. Closing.
Mark closed this issue 2026-05-13 00:22:48 +00:00
Sign in to join this conversation.
No description provided.