Troubleshooting & FAQ
7. Troubleshooting & FAQ
7.1. Common Challenges
Installation Issues
-
Docker Setup Problems
# Error: Port is already in use Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:80 -> 0.0.0.0:0: listen tcp 0.0.0.0:80: bind: address already in use
Solution:
# Find process using the port sudo lsof -i :80 # Stop the process sudo kill -9 <PID>
-
Node.js Version Conflicts
Error: The engine "node" is incompatible with this module
Solution:
# Use nvm to install correct version nvm install 18 nvm use 18 # Or update package.json { "engines": { "node": ">=18.0.0" } }
[!NOTE] πΈ Screenshot Needed: Common installation error messages and solutions
Environment Configuration
-
Missing Environment Variables
Error: Missing required environment variable: STRIPE_SECRET_KEY
Solution:
- Check
.env.example
files - Copy and fill required variables
- Verify variable names match exactly
- Check
-
SSL Certificate Issues
Error: unable to get local issuer certificate
Solution:
# Generate new certificates ./scripts/generate-certs.sh # Or use Let's Encrypt ./scripts/setup-letsencrypt.sh
[!NOTE] πΈ Screenshot Needed: Environment configuration interface
Database Problems
-
Connection Issues
interface DatabaseError { code: string; // e.g., 'ECONNREFUSED' errno: number; // e.g., -61 syscall: string; // e.g., 'connect' address: string; // e.g., '127.0.0.1' port: number; // e.g., 5432 }
Solutions:
- Check database service is running
- Verify connection credentials
- Ensure network connectivity
-
Migration Failures
# Reset database yarn strapi database:reset # Rebuild and restart docker-compose down docker-compose up -d --build
[!NOTE] π Diagram Needed: Database troubleshooting flowchart
7.2. Frequently Asked Questions
General Questions
-
Q: How do I update the system?
# Pull latest changes git pull origin main # Update dependencies yarn install # Rebuild containers docker-compose up -d --build
-
Q: How do I backup my data?
# Database backup
./scripts/backup-db.sh
# Full system backup
./scripts/backup-system.sh
Development Questions
-
Q: How do I create a custom plugin?
# Generate plugin yarn strapi generate:plugin my-plugin # Structure plugins/my-plugin/ βββ config/ βββ controllers/ βββ models/ βββ services/ βββ package.json
-
Q: How do I customize the frontend theme?
// frontend/src/styles/themin.ts
export const theme = {
colors: {
primary: '#007AFF',
// ... other colors
},
// ... other theme properties
};
Security Questions
- Q: How do I implement rate limiting?
- Check the middleware :
backend/src/api/webhook/middlewares/rate-limit.ts
, for the implementation code,// backend/src/api/webhook/middlewares/rate-limit.ts const rateLimiters: Record<RateLimiterType, RateLimiterMemory> = { free: new RateLimiterMemory({ points: 3, // Number of requests duration: 86400, // Per day }), premium: new RateLimiterMemory({ points: 10, // Number of requests duration: 60, // Per day }), enterprise: new RateLimiterMemory({ points: 100, // Number of requests duration: 60, // Per minute }), default: new RateLimiterMemory({ points: 20, // Default number of requests duration: 60, // Default duration per minute }),
- Q: How do I secure API endpoints?
// backend/api/route/config/policies.ts export default { find: ['isAuthenticated', 'rateLimit'], findOne: ['isAuthenticated', 'rateLimit'], create: ['isAuthenticated', 'isAdmin'], update: ['isAuthenticated', 'isAdmin'], delete: ['isAuthenticated', 'isAdmin'], };
Integration Questions
- Q: How do I integrate with external APIs?
// frontend/src/services/api.ts export class ExternalAPIService { constructor(config: APIConfig) { this.baseURL = config.baseURL; this.apiKey = config.apiKey; } async request<T>(endpoint: string): Promise<T> { // Implementation } }
[!NOTE] πΈ Screenshot Needed: FAQ section in documentation portal