https://prefect.io logo
Title
b

Bernardo Galvao

01/06/2023, 12:06 PM
Hi, @Ryan Peden, I adapted your Docker Compose file to Docker Swarm and I am having an issue here. Orion UI cannot connect to API: where should I start looking?
āœ… 2
a

Anna Geller

01/06/2023, 2:53 PM
nice! Ryan will know more but the PREFECT_API_URL doesn't seem to match between code and UI in your image
šŸ‘ 1
r

Ryan Peden

01/06/2023, 2:57 PM
I agree with Anna - setting
PREFECT_API_URL
to
<http://172.16.8.65:4200/api>
should make this work for you.
šŸ˜Š 1
I'll add a comment in the
docker-compose.yml
file that mentions this šŸ™‚
šŸ™Œ 2
:gratitude-thank-you: 3
And just to clarify, you should only need to set this on the Orion container. If you are using a container for the agent as well, you should be able to leave its PREFECT_API_URL as http://orion:4200/api since it can communicate with Orion over the internal Docker network.
:gratitude-thank-you: 1
šŸ’Æ 1
b

Bernardo Galvao

01/06/2023, 3:11 PM
thanks for being so clear and quick! I noticed there are two variables: ā€¢
PREFECT_ORION_API_HOST
set for the prefect orion container ā€¢
PREFECT_API_URL
set for the agent container ofc I'll go look them up in the docs, but if you can answer me, what is the difference and where should they be set? Edit: I'm adding the
PREFECT_API_URL
in the orion container in addition to the already present
PREFECT_ORION_API_HOST
. Edit 2: I checked the github repo and now it's as clear as it gets. Thanks!
Yep, that fixed it, the error doesn't show up anymore šŸ„°
šŸ™Œ 2
:gratitude-thank-you: 2
r

Ryan Peden

01/07/2023, 12:09 AM
Thanks following up to let us know it is working for you! šŸ˜Š
šŸ‘ 1