https://prefect.io logo
p

pk13055

10/30/2022, 10:29 AM
Hi, I am trying to replicate a local deployment of prefect (incl.
orion
+
agent
) on a remote server. However, I get an error message in the orion logs after changing
PREFECT_ORION_API_HOST
from
0.0.0.0
to
SERVER_IP
. The particular error is:
Copy code
ERROR:    [Errno 99] error while attempting to bind on address ('SERVER_IP', 4200): cannot assign requested address
This does not make sense, since I can specifically access the same
SERVER_IP
through the browser and the particular port has been allowed through the firewall as well. (PS - orion appears to connect for a brief second, and then immediately throws this error and attempts to restart). Additionally, attached below is the relevant section of my `docker-compose.yml`:
Copy code
version: "3.9"
services:
  db:
    image: timescale/timescaledb:latest-pg14
    volumes:
      - $PWD/data/db:/var/lib/postgresql/data
      - $PWD/config/db:/docker-entrypoint-initdb.d/
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready" ]
      interval: 10s
      timeout: 5s
      retries: 5
    environment:
      - POSTGRES_DB=$POSTGRES_DB
      - POSTGRES_USER=$POSTGRES_USER
      - POSTGRES_PASSWORD=$POSTGRES_PASSWORD
    networks:
      - db_network

  orion:
    image: prefecthq/prefect:2.6.3-python3.10
    restart: always
    volumes:
      - $PWD/prefect:/root/.prefect
    entrypoint: [ "prefect", "orion", "start" ]
    environment:
      - PREFECT_ORION_API_HOST=$SERVER_IP
      - PREFECT_ORION_DATABASE_CONNECTION_URL=$PREFECT_DB_URL
    ports:
      - 4200:4200
    depends_on:
      - db
    networks:
      - prefect_network
      - db_network

  agent:
    build: ./prefect
    restart: always
    entrypoint: [ "prefect", "agent", "start", "-q", "main_queue" ]
    environment:
      - PREFECT_API_URL=<http://orion:4200/api>
    networks:
      - prefect_network
      - db_network

  cli:
    build: ./prefect
    entrypoint: "bash"
    working_dir: "/root/flows"
    volumes:
      - "$PWD/prefect/flows:/root/flows"
    environment:
      - PREFECT_API_URL=<http://orion:4200/api>
    networks:
      - prefect_network
      - db_network

networks:
  db_network:
  prefect_network:
1
So using [this](https://prefect-community.slack.com/archives/C0192RWGJQH/p1666655672422609?thread_ts=1666640411.652339&amp;cid=C0192RWGJQH) reference, essentially setting the
PREFECT_ORION_UI_API_URL
to the appropriate value, and keeping
PREFECT_ORION_API_HOST
as
0.0.0.0
solved the issue!
r

Ryan Peden

10/30/2022, 10:06 PM
Thanks for following up! I'm glad to hear that other post helped you solve this.
👍 1
3 Views