Troubleshooting

Common Issues

1. Database Connection Errors

Problem: Cannot connect to PostgreSQL/MongoDB

ERROR NOT CONNECTED to the database!

Solutions:

2. Redis Connection Failed

Problem: Redis client connection error

Redis Error - Connection refused

Solutions:

3. Minio Connection Issues

Problem: Cannot connect to Minio

Minio Error - Connection refused

Solutions:

4. File Upload Failures

Problem: Files not uploading or temp directory errors

Solutions:

mkdir -p resources/temp/upload
mkdir -p resources/temp/review
mkdir -p resources/temp/pdf
chmod -R 755 resources/

5. JWT Token Invalid

Problem: Authentication fails with valid-looking token

Solutions:

6. Scheduled Tasks Not Running

Problem: Cron jobs not executing

Solutions:

7. WebSocket Connection Failed

Problem: Chat not working, Socket.IO errors

Solutions:

8. Payment Webhook Not Receiving

Problem: Xendit webhooks not being received

Solutions:

Debugging Tips

  1. Enable Debug Logging

    // In index.js
    const morgan = require('morgan');
    app.use(morgan('combined'));
    
  2. Check Database Queries

    // Sequelize logging enabled by default in development
    // Check console for SQL queries
    
  3. Monitor Process

    pm2 logs onmarket-api
    pm2 monit
    
  4. Check Port Availability

    lsof -i :3610
    netstat -tulpn | grep 3610
    
  5. Test Database Connections

    # PostgreSQL
    psql -h localhost -U onmarket_user -d onmarket_db
    
    # MongoDB
    mongo mongodb://localhost:27017/onmarket
    
    # Redis
    redis-cli -h localhost -p 6379 ping
    

Revision #1
Created 24 February 2026 09:30:08 by ondeliveloper
Updated 24 February 2026 09:30:51 by ondeliveloper