Freehand for Freight Audit&Payment

Created by Carrie Sobers, Modified on Mon, 2 Feb at 3:34 PM by Carrie Sobers

  1. Common Issues & Symptoms 

  1. Authentication & Authorization Failures 

 

Symptom: API requests return 401 Unauthorized or 403 Forbidden errors. 

 

Diagnostic Steps: 

 

  1. Check JWT token expiration in request headers 

  1. Verify token format: Authorization: Bearer <token> 

  1. Review auth proxy logs for token validation failures 

4. Check user status in Users table (should be ACTIVE ) 

5. Verify role assignments in UserRole table 

6. Check permission configuration in Permission and PermissionGroup tables 

 

Logs to Check: 

 

  Auth service logs: auth-service.log or application logs 

  Look for: Token expired, Invalid token, User not found, Permission denied 

  Check RequestLog table for failed authentication attempts 

 

Common Causes: 

 

Expired JWT tokens (default expiration: 24 hours)

User status is PENDING or INACTIVE

Missing or incorrect role assignments

Permission not granted for requested operation

Token not included in request headers 


Resolution: 

 

 Refresh token via /cm/api/auth/refresh endpoint  Update user status to ACTIVE if pending 

  Assign appropriate roles via /cm/api/users/:userId/roles 

  Verify permission bundles in role configuration 

  Check internal token configuration for service-to-service calls 

 

Verification: 

 

  Retry API request with valid token 

  Check bootstrap API response for user permissions  Verify token in browser DevTools Network tab 

Group 18, Grouped object 

 

  1. Database Connection Failures 

 

Symptom: Services fail to start, or API requests return 500 errors with database connection messages. 

 

Diagnostic Steps: 

 

  1. Verify PostgreSQL service is running 

  1. Check database connection string in environment configuration 

  1. Test database connectivity: psql -h <host> -U <user> -d <database> 

4. Review connection pool settings (max connections, timeout) 

5. Check database server logs for connection errors 

6. Verify network connectivity between service and database 

 

Logs to Check: 

 

  Service startup logs: Error: connect ECONNREFUSED , Connection timeout 

  Sequelize logs: Unable to connect to the database 

  Database server logs: too many connections, authentication failed 

 

Common Causes: 

 

Incorrect connection string (host, port, database name, credentials) Database server is down or unreachable 

Connection pool exhausted (too many open connections) 

 Network firewall blocking database port (default: 5432)  

 Database credentials expired or incorrect 

Resolution: 

 

 Verify DATABASE_URL or individual connection parameters in config  Restart database service if down 

  Increase connection pool size in Sequelize configuration  Check firewall rules for database port access 

  Update database credentials if expired 

  Review and close idle connections 

 

Verification: 

 

Service starts without connection errors

Health check endpoint returns 200 OK 

Database queries execute successfully 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article