Symptom: The service exits with a PostgreSQL connection error on startup.
Causes:
- PostgreSQL is not running
DATABASE_URLis missing or incorrect in the.envfile- The database or user does not exist
Resolution:
- Ensure PostgreSQL is running:
docker compose up -d - Verify the connection string in
.envmatches your PostgreSQL setup - Default connection string:
postgres://stackcraft:stackcraft@localhost:5433/stackcraft
Symptom: EADDRINUSE error on startup.
Causes:
- Another instance of the service or another application is using port 9090 (or 8080 for frontend)
Resolution:
- Stop the other process using the port
- Or set a different port via the
APP_SERVICE_PORTenvironment variable in.env
Symptom: Service starts but cannot connect to the database.
Resolution:
- Copy the example file:
cp .env.example .env - Adjust values if your PostgreSQL setup differs from defaults
Symptom: A managed service shows a stale status that never resolves.
Cause: The backend was restarted while a service operation was in progress. The state was persisted but the process no longer exists.
Resolution: On startup, Stack Craft automatically reconciles stale states. Restart the Stack Craft backend and the stuck service should return to a normal state.
Symptom: Cloning or pulling a repository fails with a git error.
Common causes:
- The repository URL is invalid or inaccessible
- Git is not installed on the system
- Authentication is required but not configured
- The target directory has conflicting content
Resolution:
- Verify the repository URL in the repository settings
- Ensure
gitis available in the systemPATH - For private repositories, ensure SSH keys or credentials are configured
- Check the service logs for the specific git error message
Symptom: A prerequisite shows as "not satisfied" even though the tool is installed.
Common causes:
- The command runs in a restricted environment without access to the full
PATH - The expected version pattern does not match the installed version
Resolution:
- Check the prerequisite configuration (command, expected output pattern)
- Verify the tool is accessible from a clean shell (not just your user profile)
- Review the check output in the prerequisite details for the actual command output
Service stdout/stderr is captured in-memory and available via:
- UI: Navigate to the service detail page and click the "Logs" tab
- API:
GET /api/services/:id/logs?lines=300&search=error - MCP: Use the
get_service_logstool
Note: Service logs are stored in-memory with a limit of 50,000 entries per service. Logs are lost when the Stack Craft backend restarts.
The backend logs to stdout via the FuryStack VerboseConsoleLogger. Log verbosity can be configured via the LOG_LEVEL environment variable (default: verbose). Available levels: verbose, debug, information, warning, error, fatal. In production, pipe stdout to your preferred log aggregator:
# Docker
docker logs <container-id>
# systemd
journalctl -u stack-craft
# File redirect
yarn start:service >> /var/log/stack-craft.log 2>&1Use the health endpoint to verify the service is running and the database is connected:
curl http://localhost:9090/api/system/health
# {"status":"ok","uptime":12345,"version":"1.0.3","database":"connected"}| Variable | Default | Description |
|---|---|---|
DATABASE_URL |
postgres://stackcraft:stackcraft@localhost:5433/stackcraft |
PostgreSQL connection string |
APP_SERVICE_PORT |
9090 |
Backend HTTP server port |
MCP_PORT |
9091 |
MCP server port |
STACK_CRAFT_ENCRYPTION_KEY |
(auto-generated) | Base64-encoded 256-bit key for encrypting sensitive values. If unset, a key file is created in ~/.stack-craft/ |
Symptom: curl: (7) Failed to connect to localhost port 9091: Connection refused
Causes:
- The Stack Craft service is not running
- The MCP server is configured on a different port
Resolution:
- Verify the service is running:
curl http://localhost:9090/api/system/health - Check the
MCP_PORTvalue in your.envfile (default:9091) - Ensure nothing else is occupying the configured port
Symptom: MCP tool calls return 401 Unauthorized or 403 Forbidden.
Cause: The MCP server requires a Bearer token for authentication.
Resolution:
- Open the Stack Craft UI and navigate to User Settings
- Create a new API token
- Configure your MCP client with the token as a Bearer token in the
Authorizationheader
Symptom: MCP tool calls return "Service not found" or "Stack not found".
Causes:
- The service or stack ID/name is incorrect
- The resource was deleted or has not been imported yet
Resolution:
- Use the
list_servicesorlist_stacksMCP tool to verify available resources - Double-check the ID or name passed to the tool
- Import the stack or create the service if it does not exist yet
You can verify the MCP server is listening with:
curl http://localhost:9091/mcp
# Expects 405 Method Not Allowed — the endpoint requires POST with SSEA 405 response confirms the MCP server is running and reachable. Any other response (connection refused, timeout) indicates the server is not available.
Symptom: Services that previously stored encrypted values (e.g. environment variable secrets) show decryption errors or garbled values.
Cause: The STACK_CRAFT_ENCRYPTION_KEY has changed since the values were encrypted. Existing encrypted values become undecryptable with a different key.
Resolution:
- If you still have the old key, restore it in
.envand restart the service - If the old key is lost, you must re-enter all sensitive values (environment secrets, tokens, etc.) through the UI or API
To rotate the encryption key:
- Stop the Stack Craft service
- Update
STACK_CRAFT_ENCRYPTION_KEYin your.envfile with a new base64-encoded 256-bit key - Start the service
- Re-enter all sensitive values (environment secrets, tokens) — they must be re-encrypted with the new key
If the STACK_CRAFT_ENCRYPTION_KEY environment variable is not set, Stack Craft auto-generates a key file at:
~/.stack-craft/encryption.key
This file is created on first startup and reused on subsequent runs. Back up this file to avoid losing access to encrypted values.
Symptom: Encrypted values break after a container restart.
Cause: The auto-generated key file inside the container is lost when the container is recreated.
Resolution:
- Option A: Set the
STACK_CRAFT_ENCRYPTION_KEYenvironment variable explicitly - Option B: Mount the
~/.stack-craft/directory as a volume to persist the key file
Stack Craft exposes two ports that both need to be mapped:
| Port | Protocol | Purpose |
|---|---|---|
9090 |
HTTP/WebSocket | REST API and frontend |
9091 |
HTTP/SSE | MCP server |
In production, always set STACK_CRAFT_ENCRYPTION_KEY explicitly rather than relying on the auto-generated key file. Alternatively, mount ~/.stack-craft/ as a persistent volume.
docker run -d \
--name stack-craft \
-p 9090:9090 \
-p 9091:9091 \
-e DATABASE_URL=postgres://stackcraft:stackcraft@db:5432/stackcraft \
-e STACK_CRAFT_ENCRYPTION_KEY=your-base64-encoded-key \
stack-craft:latest- Check the service logs for detailed error messages
- Use the MCP server (
localhost:9091) with an AI assistant for interactive troubleshooting - File issues at https://github.com/furystack/stack-craft/issues