Troubleshoot the deployed server

Troubleshooting tips for your ZenML deployment

In this document, we will go over some common issues that you might face when deploying ZenML and how to solve them.

Viewing logs

Analyzing logs is a great way to debug issues. Depending on whether you have a Kubernetes (using Helm or zenml deploy) or a Docker deployment, you can view the logs in different ways.

If you are using Kubernetes, you can view the logs of the ZenML server using the following method:

Check all pods that are running your ZenML deployment.

kubectl -n <KUBERNETES_NAMESPACE> get pods

If you see that the pods aren't running, you can use the command below to get the logs for all pods at once.

kubectl -n <KUBERNETES_NAMESPACE> logs -l app.kubernetes.io/name=zenml

Note that the error can either be from the zenml-db-init container that connects to the MySQL database or from the zenml container that runs the server code. If the get pods command shows that the pod is failing in the Init state then use zenml-db-init as the container name, otherwise use zenml.

kubectl -n <KUBERNETES_NAMESPACE> logs -l app.kubernetes.io/name=zenml -c <CONTAINER_NAME>

You can also use the --tail flag to limit the number of lines to show or the --follow flag to follow the logs in real-time.

If you are using Docker, you can view the logs of the ZenML server using the following method:

If you used the zenml up --docker CLI command to deploy the Docker ZenML server, you can check the logs with the command:Copyzenml logs -f

If you used the docker run command to manually deploy the Docker ZenML server, you can check the logs with the command:Copydocker logs zenml -f

If you used the docker compose command to manually deploy the Docker ZenML server, you can check the logs with the command:Copydocker compose -p zenml logs -f

Fixing database connection problems