García Gimenez Ignacio - 6to 2da

    García Gimenez Ignacio - 6to 2da

    11 months ago
    Hi all! Im having an issue trying to create a tenant, it throws the following exception: "HTTPConnectionPool(host='localhost', port=4200): Max retries exceeded with url....". I'm running my own docker compose file. Apollo's server is running fine, it connects to the UI. But it seems like wont connect when trying to create the tenant with the command "prefect server create-tenant --name default --slug default". Is there any way to change the default ip "localhost" to a custom one?
    Kevin Kho

    Kevin Kho

    11 months ago
    Hey @García Gimenez Ignacio - 6to 2da, if you are connecting to Prefect Server from another machine, and your Prefect version is 0.15.5 and above, you need to start it with the expose flag like
    prefect server start --expose
    Before you do that, you can edit the config.toml to point to the IP
    [server]
      [server.ui]
        apollo_url = "<http://YOUR_MACHINES_PUBLIC_IP:4200/graphql>"
    And on your machine connecting there:
    [server]
    endpoint = "YOUR_MACHINES_PUBLIC_IP:4200/graphql"
    García Gimenez Ignacio - 6to 2da

    García Gimenez Ignacio - 6to 2da

    11 months ago
    I've already have that in my Docker Compose file
    The ui connects ok, but then when trying to create the tenant, it fails, because is trying to point to localhost
    Kevin Kho

    Kevin Kho

    11 months ago
    The second one is the
    config.toml
    for the machine you’re trying to hit the API with.
    [server]
    endpoint = "YOUR_MACHINES_PUBLIC_IP:4200/graphql"
    This should change the API query from localhost
    García Gimenez Ignacio - 6to 2da

    García Gimenez Ignacio - 6to 2da

    11 months ago
    Is there anyway to specify that endpoint via Enviroment Variable?
    Kevin Kho

    Kevin Kho

    11 months ago
    Try
    PREFECT__SERVER__ENDPOINT
    García Gimenez Ignacio - 6to 2da

    García Gimenez Ignacio - 6to 2da

    11 months ago
    Still not working 😞
    Kevin Kho

    Kevin Kho

    11 months ago
    Are you trying on to connect from the same machine or different machine?
    García Gimenez Ignacio - 6to 2da

    García Gimenez Ignacio - 6to 2da

    11 months ago
    I'm just attached to the container, via the docker terminal. And trying to create the tenant
    Kevin Kho

    Kevin Kho

    11 months ago
    Sorry a bit confused. Is your command line running in the container or on the host machine? If it’s still
    localhost
    , I think it didn’t get the environment variable? Maybe you can check if the env variable is set. This has to be set on machine communicating with the API
    García Gimenez Ignacio - 6to 2da

    García Gimenez Ignacio - 6to 2da

    11 months ago
    I have a docker-compose file in a VM (192.168.0.43) with a Docker Environment. And via SSH I'm running "docker-compose up" in the VM to get Prefect working. I can connect to the UI using the IP of the VM and the :8080 port. I'm algo trying to run commands using "docker exec -u 0 -it server_graphql_1 bash" and accessing the terminal of the Prefect's UI Docker Instance.
    Kevin Kho

    Kevin Kho

    11 months ago
    Ah ok and you are creating the tenant via the SSH terminal? or on your machine that is connecting through SSH?
    García Gimenez Ignacio - 6to 2da

    García Gimenez Ignacio - 6to 2da

    11 months ago
    Im creating the tenant in the SSH Terminal
    nicholas

    nicholas

    11 months ago
    @García Gimenez Ignacio - 6to 2da - since you can connect to the API with your browser, would you mind trying to leave the SSH session and use your local terminal (with the endpoint set as Kevin described) to run the create tenant command? It sounds like there’s some mixup of environments happening right now
    García Gimenez Ignacio - 6to 2da

    García Gimenez Ignacio - 6to 2da

    11 months ago
    But how? I'm running a Windows Machine, how i'm supposed to run "prefect server create-tenant --name default --slug default"? Do I need to install something?
    nicholas

    nicholas

    11 months ago
    You would need to install the prefect python package on your machine to do that; alternatively you can try SSHing into your VM and checking that the environment variable described above is correctly set with
    printenv
    It sounds like you’re running docker in docker though, is that correct?