Troubleshooting Common Issues
Quick health check
pm2 list
curl -sk https://localhost/health # nginx → backend health
curl -sk https://localhost/app/api/health
All three services should be online and respond 2xx.
Service won't start
carphacom-backend keeps restarting
pm2 logs carphacom-backend --lines 100
Common causes:
- Port 9000 in use —
lsof -i :9000and kill the squatter. - DB unreachable — check
pg_isready, restartpostgresql. - Missing env var — check the relevant
.envagainst the Environment Variables reference. - Migration failure — see Plugin install failed below.
carphacom-storefront 502 from nginx
Almost always means the storefront PM2 process isn't running or the build is missing.
pm2 restart carphacom-storefront --update-env
ls /opt/carphacom/current/nextjs-storefront/.next || echo "BUILD MISSING"
If build is missing:
cd /opt/carphacom/current/nextjs-storefront
NODE_OPTIONS='--max-old-space-size=2048' npm run build
pm2 restart carphacom-storefront --update-env
Admin login returns 500
Most common cause: the custom admin_users row is missing for your account.
PGPASSWORD=$DB_PASS psql -h localhost -U medusa medusa_store \
-c "SELECT id,email,role,is_active FROM admin_users;"
If your email isn't there, add it:
INSERT INTO admin_users (email, role, is_active, permissions)
VALUES ('admin@yourshop.com', 'admin', true, '["dashboard","comenzi","produse",
"categorii","branduri","inventar","preturi","clienti","promotii","curieri",
"sync_api","facturare","blog","pagini","media","marketing","seo","google",
"securitate","loguri","setari","utilizatori"]'::jsonb);
Plugin install fails
pm2 logs carphacom-backend --lines 200 | grep -E 'plugin|migration|install'
Look for:
- Signature mismatch — Plugin ZIP wasn't signed by an approved vendor key. Re-download.
- Migration error — Look at the SQL error. Often a column collision with an existing table; contact the plugin vendor.
could not determine executable to run— Plugin manifest hasmigrations: truebut the plugin doesn't ship a Medusa migration. Setmigrations: falseincarphacom_mp_version.manifestjsonb on the marketplace side, or as a workaround update it locally.
Storefront shows wrong currency
The visitor's region is detected via cookie + URL prefix. Force-clear:
- Clear cookies for the shop domain.
- Open
https://shop.example.com/<correct-locale>(e.g./ro). - The new region is set and prices update.
If wrong currency persists across all visitors, check Settings → Regions → [region] — maybe the wrong currency is configured.
Slow checkout
# Database slow queries?
PGPASSWORD=$DB_PASS psql -h localhost -U medusa medusa_store \
-c "SELECT pid,state,query_start,query FROM pg_stat_activity WHERE state = 'active';"
# Redis up?
redis-cli ping
Common causes:
- Missing DB indexes after a schema change. Run
VACUUM ANALYZEoncart,cart_line_item,order,customer. - Stripe latency — check
pm2 logsfor slowPOST stripe.comcalls. May be regional; consider a closer Stripe region. - Backend swapping — check
free -h. Add RAM if backend is over 80% utilization.
Where to get help
- Logs:
pm2 logs --lines 500andtail -f /opt/carphacom/shared/logs/*.log. - Community forum:
community.carphacom.com. - Commercial support:
support@carphacom.com(response within 1 business day).