Troubleshooting
This section provides diagnostic handbooks, commands, and standard configurations to troubleshoot and resolve common issues encountered during MatrixHub deployments.
đž 1. MySQL Connection Failureâ
If the backend API server fails to initialize because it cannot reach or connect to the database, follow these diagnostic steps:
Step A: Verify Container Statusâ
If you are running the built-in database via Docker:
# Check if the MySQL database container is running
docker ps | grep matrixhub-mysql
If it is stopped, restart it:
docker restart matrixhub-mysql
Step B: Inspect Database Logsâ
If the container keeps crashing or refusing connections, check the startup logs:
docker logs matrixhub-mysql
Step C: Validate the Connection String (DSN)â
Ensure your environment variable connection DSN string matches your target host and credentials:
# Example verification of database connection string
export MATRIXHUB_DATABASE_DSN="matrixhub:changeme@tcp(127.0.0.1:3306)/matrixhub?charset=utf8mb4&parseTime=true"
đ 2. Local Port occupied / Port Conflictsâ
If services fail to start because local network ports are occupied by other running background processes:
Backend Port Conflicts (Default: 9527 / 3001)â
If the default API server port is occupied, you can change the target listening port inside your configuration file:
- Open
config/config.yaml. - Change the value of
apiServer.portto another open port (e.g.9627).
Frontend Port Conflicts (Default: 5173)â
If the Vite dev server port is occupied, specify a custom port during local frontend execution:
cd ui
pnpm dev --port 3000
đĻ 3. Local Dependency Issuesâ
If compilation fails due to corrupted local modules, lockfiles, or node modules:
Resolving Go Backend Dependency Breakagesâ
Force a clean tidy of Go module hashes and download dependencies:
go mod tidy
go mod download
Resolving Frontend npm/pnpm Module Breakagesâ
Wipe local build files and lockfiles, and run a fresh installation:
cd ui
# Delete local caches
rm -rf node_modules pnpm-lock.yaml
# Run fresh install
pnpm install
đ 4. Service Health Checksâ
Ensure the backend API server is fully functional and loading database tables by querying the health API:
# Curl the standard API health check route
curl -i http://localhost:3001/health
A healthy server will return a 200 OK status response confirming that connections and internal database components are fully alive.