Thread
#prefect-community
    k

    Kevin Weiler

    2 years ago
    hi there - I’m having trouble telling my flow where to look for prefect server (the api). I’ve tried many different ways to set
    prefect.config.api.url
    (env variable
    PREFECT__CONFIG__API__URL
    and setting it in
    config.toml
    but when I call
    .register()
    I get the following error:
    requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=4200): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fbcbd594e10>: Failed to establish a new connection: [Errno 111] Connection refused'))
    indicating that it’s still trying
    localhost
    instead of what I’ve given it (which does not resolve to
    localohost
    ) - any ideas?
    Kyle Moon-Wright

    Kyle Moon-Wright

    2 years ago
    Hey @Kevin Weiler, I believe other users have encountered this error before, let me get more information for you.
    k

    Kevin Weiler

    2 years ago
    cool, thanks!
    stepping away for a few FYI
    Kyle Moon-Wright

    Kyle Moon-Wright

    2 years ago
    Hmm, I'm wondering where in the process this error is occurring. How do you have your config.toml setup? Here's the Prefect config.toml for reference.
    k

    Kevin Weiler

    2 years ago
    referencing your
    config.toml
    it looks like
    PREFECT__CONFIG__API__URL
    is the wrong env variable. I think the one I want to set is
    PREFECT__CONFIG__SERVER__ENDPOINT
    I set it in the
    config.toml
    though instead
    Kyle Moon-Wright

    Kyle Moon-Wright

    2 years ago
    The endpoint may be what you're looking for, but we'll have to test it out. I'd also recommend configuring either the env variables or config.toml, but not both to avoid crossing those wires.
    k

    Kevin Weiler

    2 years ago
    thanks - yeah, I’m just going with config.toml for now
    j

    josh

    2 years ago
    As a follow up the correct env var for setting that would be
    PREFECT__SERVER__ENDPOINT
    without the
    __CONFIG
    k

    Kevin Weiler

    2 years ago
    ah thanks sir!