o

    Ovo Ojameruaye

    9 months ago
    Hi everyone, I am running prefect server on my linux and I want someone else in my team to be able view the UI on their own machine. Typically to do this, I simply share <IP>:<port_number> and this works like a charm (I do this with airflow and streamlit while testing). We are on the same network. I tried the same for prefect (<IP>:8080) but it can't be reached. I am still learning about prefect and not sure why this behavior is different. Would appreciate any help Update: I tried to start a local agent from a different machine and I get
    ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
    . I can't tell if this is related. I created a config.toml file
    # base configuration directory 
    home_dir = "C:/Users/XXX/.prefect"
    
    backend = "server"
    
    [server]
    host = "<http://XXXXXX>"
    port = "4200"
    host_port = "4200"
    endpoint = "${server.host}:${server.port}"
    I am certain the server is running on the host ip address
    Anna Geller

    Anna Geller

    9 months ago
    @Ovo Ojameruaye the easiest way to share the UI with your team would be to sign up for Prefect Cloud and invite your teammates. We have a completely free tier with 20,000 free task runs each month. What do you mean by saying “on my linux” - is this some VM on prem/cloud or just your laptop? The connection error happened most likely due to missing firewall configuration. You need to open the GraphQL port and add:
    [server]
      [server.ui]
        apollo_url = "<http://YOUR_MACHINES_PUBLIC_IP:4200/graphql>"
    And on the agent machine:
    [server]
    endpoint = "<http://YOUR_MACHINES_PUBLIC_IP:4200/graphql>"
    o

    Ovo Ojameruaye

    9 months ago
    @Anna Geller, thank you. “on my linux” means some VM on prem. Can I use a different port rather than open the graphQL port? Something like this https://stackoverflow.com/questions/70258098/cant-access-prefect-server-remotely? I tried
    prefect server start --server-port=8501
    , updated the config file and now the UI (localhosr:8080) just tries to load but never does.
    Also after I update the config.tom on the machine the server is running, using
    [server]
    endpoint = "http://<internal_ip>:4200/graphql"
    
      [server.ui]
        apollo_url = "http://<internal_ip>:4200/graphql"
    and open the UI at localhost:8080 and check the connection to server, I see the image below. Shouldn't that show my ip rather than localhost. How can I edit the config file so I connect to the UI using <ip_address>:8080 rather than localhost:8080.
    Anna Geller

    Anna Geller

    9 months ago
    If you use
    prefect server start --server-port=8501,
    your config.toml would need to be:
    [server]
    endpoint = "<http://YOUR_MACHINES_PUBLIC_IP:8501/graphql>"
    
      [server.ui]
        apollo_url = "<http://YOUR_MACHINES_PUBLIC_IP:8501/graphql>"
    and to connect to the UI from some other machine, you need to add this on this machine:
    [server]
    endpoint = "<http://YOUR_MACHINES_PUBLIC_IP:8501/graphql>"
    o

    Ovo Ojameruaye

    9 months ago
    @Anna Geller , this is what I did. After I make this change, the UI is unable to load. No errors, it just keeps trying in load on the machine I start the server from. I can’t figure out why, with everything I have seen and read, it should work
    Anna Geller

    Anna Geller

    9 months ago
    what is the full command you used to start the server? Did you use the --expose flag? I think this is what seems missing:
    prefect server start --server-port=8501 --expose
    o

    Ovo Ojameruaye

    8 months ago
    Closing this out, the problem was that I was using VSCode remote to ssh into my VM. VSCode automatically forwards all open ports on the remote which ran prefect server to the local. I was able to connect to the UI using the IP address of my local machine. Thanks a lot for your help Anna