<@ULVA73B9P> I am using coolify on a GCP VM, I used the template of prefect which was not working wh...
f

Ferdinand Harmel

11 months ago
@Marvin I am using coolify on a GCP VM, I used the template of prefect which was not working when launching with the error :
Can't connect to Server API at <http://127.0.0.1:4200/api>. Check that it's accessible from your machine.
I did some research, and from what I understand, it comes from network issue. But I can't see which one... Here's my docker-compose:
services:
  prefect:
    image: 'prefecthq/prefect:3-latest'
    depends_on:
      postgresql:
        condition: service_healthy
    environment:
      - SERVICE_FQDN_PREFECT_4200
      - 'PREFECT_API_DATABASE_CONNECTION_URL=postgresql+asyncpg://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@postgresql:5432/${POSTGRES_DB:-prefect}'
      - 'PREFECT_API_KEY=${SERVICE_PASSWORD_APIKEY}'
      - 'PREFECT_EXPERIMENTAL_WARN=${PREFECT_EXPERIMENTAL_WARN:-false}'
      - 'PREFECT_EXPERIMENTAL_ENABLE_SCHEDULE_CONCURRENCY=${PREFECT_EXPERIMENTAL_ENABLE_SCHEDULE_CONCURRENCY:-false}'
      - 'PREFECT_RUNNER_SERVER_ENABLE=${PREFECT_RUNNER_SERVER_ENABLE:-false}'
      - 'PREFECT_DEFAULT_WORK_POOL_NAME=${DEFAULT_POOL_NAME:-default}'
      - 'PREFECT_API_URL=<http://0.0.0.0:4200/api>'
      - 'PREFECT_SERVER_API_HOST=127.0.0.1'
      #- 'PREFECT_UI_API_URL=<http://localhost:4200/api>'
      #- 'PREFECT_UI_API_URL=<http://127.0.0.1:4200/api>'
    command:
      - prefect
      - server
      - start
      - '--host'
      - 0.0.0.0
      - '--port'
      - '4200'
    healthcheck:
      test:
        - CMD
        - python
        - '-c'
        - "import requests as r;r.get('<http://127.0.0.1:4200/api/health').raise_for_status(>)"
      interval: 5s
      timeout: 5s
      retries: 3
  postgresql:
    image: 'postgres:16-alpine'
   ...
Also I tried to relate with this issue, but couldn't see the bottom of it https://linen.prefect.io/t/9562601/hi-guys-hope-someone-can-help-me-with-my-current-problem-i-h Under the hood coolify use docker-compose, but it shouldn't interfer since it's in the local network of dockers...
<@ULVA73B9P> trying to have a deployment from docker container but i get this error | Traceba...
k

Kevin Mach

about 1 year ago
@Marvin trying to have a deployment from docker container but i get this error | Traceback (most recent call last): | File "C:\Program Files\Python311\Lib\site-packages\prefect\runner\runner.py", line 483, in execute_flow_run | flow_run = await self._client.read_flow_run(flow_run_id) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "C:\Program Files\Python311\Lib\site-packages\prefect\client\orchestration.py", line 2026, in read_flow_run | response = await self._client.get(f"/flow_runs/{flow_run_id}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "C:\Program Files\Python311\Lib\site-packages\httpx\_client.py", line 1801, in get | return await self.request( | ^^^^^^^^^^^^^^^^^^^ | File "C:\Program Files\Python311\Lib\site-packages\httpx\_client.py", line 1574, in request | return await self.send(request, auth=auth, follow_redirects=follow_redirects) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "C:\Program Files\Python311\Lib\site-packages\prefect\client\base.py", line 330, in send | response = await self._send_with_retry( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "C:\Program Files\Python311\Lib\site-packages\prefect\client\base.py", line 254, in _send_with_retry | response = await send(request, *send_args, **send_kwargs) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "C:\Program Files\Python311\Lib\site-packages\httpx\_client.py", line 1661, in send | response = await self._send_handling_auth( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "C:\Program Files\Python311\Lib\site-packages\httpx\_client.py", line 1689, in _send_handling_auth | response = await self._send_handling_redirects( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "C:\Program Files\Python311\Lib\site-packages\httpx\_client.py", line 1726, in _send_handling_redirects | response = await self._send_single_request(request) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "C:\Program Files\Python311\Lib\site-packages\httpx\_client.py", line 1763, in _send_single_request | response = await transport.handle_async_request(request) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "C:\Program Files\Python311\Lib\site-packages\httpx\_transports\default.py", line 372, in handle_async_request | with map_httpcore_exceptions(): | File "C:\Program Files\Python311\Lib\contextlib.py", line 155, in exit | self.gen.throw(typ, value, traceback) | File "C:\Program Files\Python311\Lib\site-packages\httpx\_transports\default.py", line 86, in map_httpcore_exceptions | raise mapped_exc(message) from exc | httpx.ConnectError: All connection attempts failed