Files
pos-system/docs/vi/guides/troubleshooting.md
Ho Ngoc Hai b104fafa85 Refactor auth-service to iam-service and update related documentation
- Renamed auth-service to iam-service across various files for consistency.
- Updated Dockerfiles, deployment configurations, and documentation to reflect the service name change.
- Enhanced testing commands in documentation to point to the new iam-service.
- Removed outdated auth-service files and configurations to streamline the project structure.
- Improved bilingual documentation for clarity on the new service structure and usage.
2025-12-30 20:54:21 +07:00

1.5 KiB

Hướng Dẫn Xử Lý Sự Cố

Các Vấn Đề Thường Gặp

Kết Nối Database Thất Bại

Triệu chứng: Service không thể kết nối database

Giải pháp:

  1. Kiểm tra PostgreSQL có đang chạy: docker ps
  2. Xác minh DATABASE_URL trong .env
  3. Kiểm tra kết nối mạng: docker network ls
  4. Xem logs: docker logs postgres-auth-local

Port Đã Được Sử Dụng

Triệu chứng: Service không khởi động với lỗi port

Giải pháp:

  1. Tìm process đang dùng port: lsof -i :5001
  2. Kill process hoặc thay đổi PORT trong .env
  3. Kiểm tra docker-compose cho port conflicts

Prisma Client Chưa Được Generate

Triệu chứng: Lỗi import cho Prisma Client

Giải pháp:

cd services/iam-service
pnpm prisma generate

Build Failures

Triệu chứng: Lỗi TypeScript hoặc build

Giải pháp:

  1. Xóa build artifacts: ./scripts/utils/cleanup.sh
  2. Cài đặt lại dependencies: pnpm install
  3. Kiểm tra lỗi TypeScript: pnpm typecheck

Traefik Không Routing

Triệu chứng: Lỗi 404 từ Traefik

Giải pháp:

  1. Kiểm tra Traefik dashboard: http://localhost:8080
  2. Xác minh service labels trong docker-compose
  3. Kiểm tra cấu hình routes.yml
  4. Xem Traefik logs: docker logs traefik-local

Tìm Kiếm Trợ Giúp

  1. Kiểm tra service logs: ./scripts/dev/logs.sh <service>
  2. Xem lại GitHub Issues
  3. Liên hệ team lead