https://prefect.io logo
Title
a

Albert Wong

03/04/2023, 1:48 AM
anyone ever get the 'Can't connect to Server API at http://127.0.0.1:4200/api. Check that it's accessible from your machine.'? After developing locally, I'm setting up a remote host for actual deployments and unable to get the server configured correctly it seems. I'm starting the server with:
prefect server start --host=0.0.0.0
I get a UI, but parts of it are inaccessible
n

Nate

03/04/2023, 2:10 AM
hmm when I've seen this its usually an issue with the networking setup, can you share more about where you're trying to host your API in relation to where you're trying to access it? also just in case it's relevant, seeing this
After developing locally, I'm setting up a remote host for actual deployments
I'm curious if you just want remote execution of your deployments or if you actually need to host your API yourself because of compliance reasons / other preferences? since you can remotely configure / execute your deployments when letting Prefect Cloud host the API (apologies if you already know this, i just mention since its a common point of confusion 😄 )
a

Albert Wong

03/04/2023, 2:13 AM
need to host for compliance reasons networking ... just some vm somewhere on a corporate network. It's kinda transparent to me. It has its IP address which I can ping and access via browser
there is also a dns entry on the ip that I use to access via browser
oh interesting, I had to set the api url on the server too, prefect config set PREFECT_API_URL=
and now it's working
:party-parrot: 1
I see my deployment and a bunch of block options!
thanks Nate for pointing me in the right direction
n

Nate

03/04/2023, 2:18 AM
glad you figured it out - let us know if you generate any questions as you build out some deployments!
k

kasteph

03/07/2023, 7:16 AM
Hey @Albert Wong I'm facing the same issue. For the PREFECT_API_URL, did you just set it to
0.0.0.0
too?
a

Albert Wong

03/07/2023, 8:38 AM
no I set it to the actual hostname:port/api on the server
k

kasteph

03/07/2023, 9:10 AM
thanks, I was able to get it to work. do you still see the following:
etl-server-1  | httpx.ConnectError: All connection attempts failed
when the server starts though?
a

Albert Wong

03/09/2023, 2:37 AM
I haven't seen that
k

kasteph

03/09/2023, 2:37 AM
Ah I managed to fix it by setting it from profiles.toml