<@ULVA73B9P> I have a self-hosted version of prefe...
# ask-marvin
e
@Marvin I have a self-hosted version of prefect server deployed with the following docker-compose. It worked with the image prefecthq/prefect:2-python3.10, but no more with the image prefecthq/prefect:3-latest version Now in the UI I have the following error : "Can't connect to Server API at http://0.0.0.0:4200. Check that it's accessible from your machine." How can I fix it ? services: server: container_name: prefect-server image: prefecthq/prefect:3-latest restart: unless-stopped volumes: - ./server:/root/.prefect - /home/data/flows:/opt/prefect/flows entrypoint: ["prefect", "server", "start"] environment: - PREFECT_SERVER_API_HOST=0.0.0.0 - PREFECT_API_DATABASE_CONNECTION_URL=postgresql+asyncpg://postgres:postgres@db:5432/prefect ports: - 4200:4200 depends_on: - db
m
It seems your issue stems from changes in how Prefect 3.x operates compared to Prefect 2.x, particularly regarding self-hosted servers. 1. API Configuration: Prefect 3.x requires some configuration changes. Ensure that your Prefect API URL is correctly set. You might need to adjust your Docker configuration to acknowledge the Prefect server's API URL. Consider using
<http://localhost:4200>
or
http://<real-ip-address>:4200
instead of
<http://0.0.0.0:4200>
. 2. Environment Variables: Double-check your environment variables. Ensure that
PREFECT_API_DATABASE_CONNECTION_URL
and any others are correctly configured. 3. Networking: Ensure that the ports are correctly mapped and that there is no firewall or networking issue blocking the connection to the API. 4. Docker Compose Configuration: According to the Prefect 3.x documentation, self-hosting a Prefect server instance might require additional configurations. It's helpful to refer to the latest Prefect 3.x self-host documentation for specific setup requirements. 5. Downgrade Option: If immediate resolution is needed, consider reverting to the Prefect 2.x image by changing
image: prefecthq/prefect:2-python3.10
in your
docker-compose.yml
file. You can follow detailed examples from Prefect's guides on self-hosting for both versions to adjust your setup accordingly: - Prefect 2.x host guide - Prefect 3.x self-host guide By checking these configurations, you should be able to resolve the connectivity issue.