ERROR MESSAGES - nself-org/cli GitHub Wiki
This guide explains common error messages you might encounter and how to resolve them.
| Error Type | Command to Fix |
|---|---|
| Port conflicts | nself doctor --fix |
| Container failures |
nself logs <service> then nself restart <service>
|
| Configuration issues | nself config validate --fix |
| Build problems |
docker builder prune -f then nself build
|
| Health check | nself doctor |
Error Message:
โ Container 'postgres' failed to start
Reason: Port 5432 is already in use
Solutions:
-
Find and stop the conflicting process:
# macOS/Linux lsof -ti:5432 | xargs kill -9 # Or for specific services brew services stop postgresql # macOS sudo systemctl stop postgresql # Linux
-
Change the port in
.env.local:# Add to .env.local POSTGRES_PORT=5433 # Then rebuild and restart nself build && nself start
-
Use automatic fix:
nself doctor --fix
Prevention:
- Use
.env.localto override ports that conflict with your system - Run
nself doctorbefore starting services
Error Message:
โ Container 'hasura' failed to start
Reason: Connection to database failed
Solutions:
-
Check logs for detailed error:
nself logs hasura nself logs hasura --tail 100
-
Verify dependencies are running:
nself status docker ps
-
Restart in dependency order:
nself restart postgres sleep 5 nself restart hasura
-
Full rebuild:
nself stop nself build nself start
Common Causes:
- Database not ready when service starts
- Network configuration issues
- Missing environment variables
- Resource constraints (memory/CPU)
Error Message:
โ Required configuration missing
File: .env not found or incomplete
Missing variables:
โข PROJECT_NAME
โข POSTGRES_PASSWORD
โข HASURA_GRAPHQL_ADMIN_SECRET
Solutions:
-
Initialize configuration:
nself init
-
Copy from example:
cp .env.example .env # Edit .env with your values -
Validate and auto-fix:
nself config validate --fix
Required Variables:
-
PROJECT_NAME- Your project identifier -
POSTGRES_PASSWORD- Database password -
HASURA_GRAPHQL_ADMIN_SECRET- Hasura admin secret -
BASE_DOMAIN- Your domain (default: local.nself.org)
Error Message:
โ Permission denied
Cannot access: /var/run/docker.sock
Solutions:
-
Fix file ownership:
sudo chown -R $(whoami) ./ -
Add user to docker group (Linux):
sudo usermod -aG docker $USER # Log out and back in
-
Check Docker is running:
docker info
-
macOS - Restart Docker Desktop:
- Docker Desktop handles permissions automatically
- If issues persist, restart Docker Desktop
Common Causes:
- Docker daemon not running
- User not in docker group (Linux)
- File ownership issues
- Insufficient sudo privileges
Error Message:
โ Network connection failed
Service: hasura
URL: http://localhost:8080
Error: connection refused
Solutions:
-
Check service is running:
docker ps | grep hasura -
Check Docker networking:
docker network ls docker network inspect nself_default
-
Restart Docker networking:
nself stop docker network prune -f nself start
-
Test connectivity:
curl -v http://localhost:8080
Common Causes:
- Service not started
- Port mapping incorrect
- Firewall blocking connections
- VPN interfering with Docker networking
Error Message:
โ Docker is not running
Solutions:
macOS:
# Start Docker Desktop
open -a Docker
# Wait 10-15 seconds for initialization
# Verify
docker infoLinux:
# Start Docker service
sudo systemctl start docker
# Enable on boot
sudo systemctl enable docker
# Verify
docker infoWindows:
- Start Docker Desktop from Start Menu
- Or run:
"C:\Program Files\Docker\Docker\Docker Desktop.exe"
Error Message:
โ Insufficient memory
Available: 2GB
Required: 4GB
Solutions:
-
Close unnecessary applications
-
Increase Docker memory (macOS):
- Docker Desktop โ Settings โ Resources โ Memory
- Recommended: 4GB minimum, 8GB optimal
-
Disable optional services:
# In .env.local MONITORING_ENABLED=false MLFLOW_ENABLED=false REDIS_ENABLED=false -
Check disk space:
df -h . docker system df -
Clean Docker resources:
docker system prune -a --volumes nself clean
Error Message:
โ Database connection failed
Database: PostgreSQL
Error: connection refused
Solutions:
-
Check if database is running:
docker ps | grep postgres nself logs postgres -
Verify connection settings in
.env:POSTGRES_PORT=5432 POSTGRES_USER=postgres POSTGRES_PASSWORD=<your-password> POSTGRES_DB=nhost
-
Check for port conflicts:
lsof -i :5432
-
Restart database:
nself restart postgres sleep 5 nself status
-
Test connection:
docker exec -it ${PROJECT_NAME}_postgres psql -U postgres
Connection URL Format:
postgresql://user:password@localhost:5432/database
Error Message:
โ Build failed for 'custom-service'
Stage: RUN npm install
Error: ENOENT: no such file or directory
Solutions:
-
Check Dockerfile syntax:
cat services/custom-service/Dockerfile
-
Clean build cache:
docker builder prune -f nself build --no-cache
-
Check disk space:
df -h docker system df
-
Rebuild specific service:
docker-compose build custom-service
-
Check Docker daemon logs:
- macOS: Docker Desktop โ Troubleshoot โ View logs
-
Linux:
journalctl -u docker.service
Common Causes:
- Syntax errors in Dockerfile
- Missing files in build context
- Network issues downloading dependencies
- Insufficient disk space
- Build cache corruption
Error Message:
โ Service 'hasura' is unhealthy
Possible solutions:
1. Check service logs for errors
2. Verify dependencies are running
3. Restart the service
Solutions:
-
Check detailed logs:
nself logs hasura --tail 50
-
Inspect container:
docker inspect ${PROJECT_NAME}_hasura -
Check dependencies:
nself status
-
Restart service:
nself restart hasura
-
Monitor resources:
docker stats ${PROJECT_NAME}_hasura
Note: Some services take 30-60 seconds to become healthy after starting.
nself doctornself doctor --verbosenself doctor --fixnself logs <service>
nself logs <service> --tail 100
nself logs <service> --follownself status
nself status --detaileddocker ps -a
docker stats
docker inspect ${PROJECT_NAME}_<service>-
Always run
nself doctorbefore starting- Checks system requirements
- Identifies potential issues
- Suggests fixes
-
Use
.env.localfor customizations- Override ports that conflict
- Set machine-specific values
- Keep
.envclean
-
Monitor resource usage
docker stats df -h free -h # Linux -
Keep Docker updated
docker --version docker compose version
-
Regular cleanup
nself clean docker system prune -a
-
Main docs:
docs/README.md -
Configuration:
docs/configuration/ -
Troubleshooting:
docs/troubleshooting/
nself help
nself <command> --help- GitHub Issues: github.com/nself-org/cli/issues
- Discussions: github.com/nself-org/cli/discussions
All nself error messages follow this format for consistency:
โ [Problem Statement]
Reason: [Specific cause]
Possible solutions:
1. [Primary solution with command]
2. [Alternative solution]
3. [Automatic fix if available]
Run 'nself doctor' for more diagnostics
This format ensures:
- Clear problem statement - What went wrong
- Specific reason - Why it failed
- Actionable solutions - How to fix it (numbered)
- Command examples - Copy-paste ready
- Additional help - Where to get more info
Found an unclear error message? Please:
- Open an issue with the error message
- Describe what was confusing
- Suggest improvements
Error messages are continually improved based on user feedback.