Troubleshooting
Common issues when installing, configuring, or deploying LaunchKit Pro. For deeper context see Deployment Gotchas.
Database not_configured on /health
Symptoms: Health JSON shows database not_configured or connection errors.
Fix:
- Set valid
DATABASE_URLin backend.env - Ensure PostgreSQL is running
- Run
npx prisma generateandnpx prisma migrate deploy - Restart the API
User denied access on database (P1010)
Symptoms: Prisma error P1010; migrations or API fail.
Fix:
- Create DB owned by app user (see Database Setup)
- Grant schema privileges:
GRANT ALL ON SCHEMA public TO launchkit_user; - Verify
DATABASE_URLusername, password, database name, host, and port - In pgAdmin: database name ≠ password — use separate fields
P3014 shadow database error
Symptoms: prisma migrate dev fails with P3014.
Fix:
- Buyers / install: use
npx prisma migrate deploy— notmigrate dev - Developers: grant PostgreSQL
CREATEDBto dev user, or configure Prisma shadow DB URL
See Database Setup.
nest: not found (backend build)
Symptoms: sh: 1: nest: not found during npm run build.
Fix: Run full npm ci before build. Do not use npm ci --omit=dev first. After successful build, production may run npm prune --omit=dev.
See Deployment Gotchas.
/auth/register returns 500
Symptoms: Registration fails during fresh install.
Fix:
- Read backend terminal logs (first step)
- Confirm
JWT_ACCESS_SECRETandJWT_REFRESH_SECRETare set (not empty) - Confirm
npx prisma migrate deploysucceeded - Verify
DATABASE_URLand DB permissions (P1010) - Compare
.envwith Environment Variables
Frontend cannot call backend
Symptoms: Login/register network errors; API unreachable from browser.
Fix:
- Backend running?
curl http://localhost:4000/health NEXT_PUBLIC_API_URLmatches backend (e.g.http://localhost:4000)- Backend
FRONTEND_URLmatches browser origin (e.g.http://localhost:3000) - Rebuild frontend after changing
NEXT_PUBLIC_* - No mixed HTTP/HTTPS (HTTPS page calling HTTP API)
AI provider and generation
Provider selected but API key missing
Symptoms: GET /ai/provider-status shows configured: false or generation fails with a configuration message.
Fix:
- Confirm
AI_PROVIDERmatches the key you set (OPENAI→OPENAI_API_KEY,GEMINI→GEMINI_API_KEY) - Or switch back to
AI_PROVIDER=MOCKfor local testing without keys - Restart the API after env changes
Mock mode works but real provider fails
Symptoms: Mock generations succeed; OpenAI/Gemini requests fail.
Fix:
- Verify the API key in your provider dashboard (valid, not expired, billing enabled)
- Check
AI_OPENAI_MODEL/AI_GEMINI_MODELnames - Read backend logs for sanitized provider errors
- Confirm outbound HTTPS from your server is allowed
Demo account generation blocked
Symptoms: HTTP 403 with message containing Demo account restriction.
Expected: Public demo accounts cannot trigger real AI to protect provider credits.
Fix:
- Demo users can still browse AI UI and view sample history
- Use a registered non-demo account to test real generation
- Adjust
AI_DEMO_RESTRICTED_EMAILS/AI_DEMO_BLOCK_REAL_GENERATIONin server env if running your own demo policy
Test account limit reached
Symptoms: Error message contains Test account AI limit reached.
Fix:
- Use an admin or normal account for additional testing
- Or raise
AI_TEST_USER_MONTHLY_LIMITin server env - Confirm the email is listed in
AI_TEST_USER_EMAILS
AI route returns 404
Symptoms: /ai/generate, /ai/history, or similar return 404.
Fix:
- Confirm backend is updated and AI module is registered
- Run
npx prisma migrate deployfor AI migrations - Static routes (
/ai/provider-status,/ai/templates) must be declared before dynamic:paramroutes in NestJS controllers
See AI Module.
CORS / API URL mismatch
Symptoms: Browser blocks requests; login fails with network error.
Fix:
- Set frontend
NEXT_PUBLIC_API_URLto exact backend origin - Set backend
FRONTEND_URLto exact frontend origin - Add extra browser origins (staging/preview) to
CORS_ALLOWED_ORIGINScomma-separated list - Restart both services after env changes
- In production, use HTTPS URLs consistently
Prisma migration errors (general)
Symptoms: Migration fails, tables missing.
Fix:
- Verify PostgreSQL is running and
DATABASE_URLis correct - Run
npx prisma generate - Buyers / production:
npx prisma migrate deploy - Developers changing schema:
npx prisma migrate dev(may need CREATEDB) - Check DB user permissions
Redis not configured / queues
Symptoms: /health shows Redis not_configured; queue errors when enabled.
Fix:
- Simple install:
QUEUES_ENABLED=false— Redis optional; ignore Redis in health if not using queues - With queues: set
REDIS_URL=redis://127.0.0.1:6379, start Redis, setQUEUES_ENABLED=true, restart API - Misconfiguration:
QUEUES_ENABLED=truewithout running Redis causes queue worker errors — revert tofalseor fix Redis
See Redis & Queues.
401 Unauthorized
Symptoms: API returns 401 on protected routes.
Fix:
- Send
Authorization: Bearer <accessToken>header - Refresh token or log in again if expired
JWT_ACCESS_SECRETchange invalidates existing tokens- Clear frontend session storage and re-login
403 Permission denied
Symptoms: Authenticated but action rejected.
Fix:
- Check workspace role (OWNER/ADMIN/MEMBER/VIEWER)
- Verify plan includes feature (e.g. API keys on Lite plan)
- Demo mode may block action — check
GET /demo/me - Admin routes require platform
ADMINrole
Upload 413 error
Symptoms: Nginx or server rejects large uploads.
Fix:
- Increase Nginx
client_max_body_size - Align
MAX_UPLOAD_SIZE_MB(backend) and plan limits - Frontend
NEXT_PUBLIC_MAX_UPLOAD_SIZE_MBis pre-validation only - Profile avatars are cropped to 512×512 client-side — workspace file uploads may still hit limits
Avatar visible at direct URL but not in app
Symptoms: Opening https://api.yourdomain.com/uploads/avatars/... works in a new tab, but the dashboard profile or topbar shows initials or a broken image.
Cause: Cross-origin resource policy or CORS mismatch between app origin (app.yourdomain.com) and API origin (api.yourdomain.com).
Fix:
- Confirm
NEXT_PUBLIC_API_URLmatches the API origin serving/uploads - Ensure the API serves static uploads with cross-origin-friendly headers for browser
<img>tags - Rebuild frontend after changing
NEXT_PUBLIC_* - Hard-refresh or clear cache after avatar upload
NEXT_PUBLIC_API_URL mismatch
Symptoms: Frontend loads but API calls or avatar URLs point to the wrong host.
Fix:
- Set
NEXT_PUBLIC_API_URL=https://api.yourdomain.com(exact API origin, no trailing path) - Rebuild frontend:
npm run build - Match backend
FRONTEND_URLto the app origin
API docs not loading
Symptoms: /api-docs blank or 404.
Fix:
- Confirm
API_DOCS_ENABLED=true(orfalseif intentionally disabled) - Check
API_DOCS_PATH(defaultapi-docs) andAPI_DOCS_JSON_PATH - If protected mode: verify reverse-proxy basic auth credentials
- Production/demo: use protected or disabled — see API Documentation
File upload path issues
Symptoms: Upload fails in production; permission errors.
Fix:
- Ensure
LOCAL_UPLOAD_DIRexists and API user can write - Use absolute path in production if needed
- Check disk space
Email mock logs only
Symptoms: No real emails received.
Expected: EMAIL_PROVIDER=MOCK writes to email logs.
Fix for real email: Switch provider and configure SMTP/Resend/Gmail in server env only.
Swagger authorize fails
Fix: Use fresh token from login; Bearer scheme; token not expired.
Still stuck?
- Check
GET /healthand admin system status (if admin) - Review backend logs during failed register/login
- Compare
.envagainst Environment Variables - Deployment Gotchas
- Installation checklist