-
Notifications
You must be signed in to change notification settings - Fork 673
7. Troubleshooting
When the project starts, the following containers will run:
coze-loop-app: Backend service
coze-loop-nginx: Nginx proxy
coze-loop-mysql: MySQL database
coze-loop-redis: Redis cache
coze-loop-clickhouse: ClickHouse storage
coze-loop-minio: Object storage
coze-loop-namesrv: RocketMQ nameserver
coze-loop-broker: RocketMQ broker
You can follow the steps below to check the container status.
-
Check whether all containers have started and are in a healthy state.
docker ps -a
-
If any service is in an unhealthy state, you can check the corresponding component's logs to identify the error cause.
docker logs coze-loop-app # Backend service logs docker logs coze-loop-nginx # nginx logs docker logs coze-loop-mysql # mysql logs docker logs coze-loop-redis # redis logs docker logs coze-loop-clickhouse # ck log docker logs coze-loop-minio # minio log docker logs coze-loop-namesrv # rocketmq nameserver log docker logs coze-loop-broker # rocketmq broker log
-
For foundational components, you can refer to the explanations in the docker-compose.yaml file to access the foundational component and review the data. For example:
# mysql, query the data from the user table docker exec -it coze-loop-mysql mysql -u root -pcozeloop-mysql SHOW DATABASES; USE cozeloop-mysql; SHOW TABLES; SELECT * FROM user LIMIT 10; # clickhouse, query the span data docker exec -it coze-loop-clickhouse bash clickhouse-client --host coze-loop-clickhouse --port 9000 --password=cozeloop-clickhouse --database=cozeloop-clickhouse SHOW DATABASES; USE `cozeloop-clickhouse`; SHOW TABLES; SELECT * FROM observability_spans LIMIT 10;
Once all containers have started successfully, the main focus will be on the backend service's running logs. If issues such as API errors arise, we can review the logs of the corresponding service container to check for error logs:
docker logs coze-loop-app
If the API reports an error on the page, you can press F12 to access the browser console, check the corresponding error requests, and retrieve the LogID from the respective header located at x-log-id
. After obtaining the LogID, you can check the logs inside the container. If the API is functioning normally, it is possible that the corresponding logs cannot be found.
Check logs inside the container:
docker logs coze-loop-app | grep {logid}
The server's error definitions are located in the errno directory of each module. If a request returns an error code, you can search for the error code in the project for a quick issue pinpoint, and then use the log query method mentioned above to identify the specific problem.
If you are testing the open-source platform integration via the SDK, you can refer to the SDK's Error codes to perform a quick diagnosis. If it's a service-related issue, review the service logs for detailed analysis.