https://prefect.io logo
d

Darragh

10/24/2020, 3:10 PM
Hey guys, I’m upgrading from 0.12.2 to 0.13.12 and having some problems. Previously I was able to set env variables to override the graphql endpoint, and a bunch of other things, but it doesn’t seem to accept the format I had anymore. Previous variable:
PREFECT__SERVER__UI__GRAPHQL_URL
Not working with 0.13.12 Docs seem to suggest that it’s changed
graphql_url
to
apollo_url
, so I tried to update the env var to
PREFECT__SERVER__UI__APOLLO_URL
or even
PREFECT__SERVER__SERVER__UI__APOLLO_URL
but no luck. Any suggestions? Also tried
PREFECT__TELEMETRY__SERVER__TELEMETRY__ENABLED=false
to disable telemetry but no luck there either
n

nicholas

10/24/2020, 4:28 PM
Hi @Darragh - have you tried setting these variables in
~/.prefect/config.toml
?
d

Darragh

10/24/2020, 4:41 PM
Hey @nicholas no I haven't, as the deployment setup I'm using us fully automated, including the variable overrides. So right now I deploy prefect to an ec2 instance, and set a bunch of env vars from our CI/CD pipeline, and then start prefect. If I was to go the toml route is have to install prefect and then add a bunch of scripts to search and replace the variables in place in the toml. Not the end of the world to change to that, but I'd prefer to stick to the current method if it'll still work..
n

nicholas

10/24/2020, 5:07 PM
Hm ok - well to start, I think your telemetry variable should be:
PREFECT__SERVER__TELEMETRY__ENABLED=false
and the UI apollo endpoint should be:
PREFECT__SERVER__UI__APOLLO_URL=xx
d

Darragh

10/24/2020, 5:43 PM
Yeah i tried the apollo one, no joy... Is there one for debug logging or something that I can turn on, just to test if it's picking any up at all?
n

nicholas

10/24/2020, 5:47 PM
I don't think there's a debug log for that but you could try execing into the UI container or visiting
<http://your_machine_endpoint:8080/settings.json>
, which should show you what setting the UI is inheriting
d

Darragh

10/24/2020, 5:54 PM
Good call, had no idea that was there 😄 settings.json only has this in it:
Copy code
{
  "server_url": "http://$CORRECT_IP:4200/graphql"
}
No mention of the apollo_url
n

nicholas

10/24/2020, 6:15 PM
nope that's perfect, so that IP address is correct?
(the UI juggles 2 apollo urls, one for Cloud and one for Server, so they're denoted as such)
d

Darragh

10/24/2020, 6:17 PM
Yeah the IP is correct, but in the UI it keeps failing the graphql connection check until I set it manually. Set it manually and then it connects
n

nicholas

10/24/2020, 6:19 PM
Can you try resetting that variable? (there's a reset button in the input where you set the connection manually)
d

Darragh

10/24/2020, 6:20 PM
Button doesn’t seem to do anything… 🤔
n

nicholas

10/24/2020, 6:23 PM
Can you screenshot what you see there?
d

Darragh

10/24/2020, 6:25 PM
I have the server logs tailed here as well, and I don’t see any log output when I hit the reset button
n

nicholas

10/24/2020, 8:49 PM
When you reset, that input isn't cleared and your configuration doesn't show up?
d

Darragh

10/25/2020, 3:59 PM
Sorry for the delay, think I misunderstood you yesterday. I did a clean deploy today, with the env vars, etc.. and the UI couldn’t connect to graphql, and the initial data in that input field was a greyed out “http://loclahot:4200/graphql”, but when I hit the reset it did display the correct IP which confused me greatly 🙂
n

nicholas

10/25/2020, 4:06 PM
No worries, that's usually a result of caching of the old value on a non-clean deploy. It sounds like you got it working now though?
d

Darragh

10/25/2020, 4:07 PM
Nope, that was a clean deploy I just did and still had to do the manual reset to get it picking up the right endpoint…
n

nicholas

10/25/2020, 4:07 PM
Right, the cache is browser-side
If resetting picks up the correct value, that means your environment variables are set correctly.
d

Darragh

10/25/2020, 4:10 PM
Hmm, not sure I follow…. So if I do a clean deploy, env var set etc… and then open the UI for the first time, why would it not have the correct value set?
n

nicholas

10/25/2020, 4:12 PM
Since the Prefect UI is a purely front-end application, the cache is set in your browser based on its knowledge of the prefect application; if your browser has an old value in the cache from a previous visit to the Prefect UI (even if it's a different installation), you need to clear it, which is what the reset button is doing.
d

Darragh

10/25/2020, 4:14 PM
Hmm, interesting. I was pretty sure I had done that, but I’ll test again in an incognito window and confirm!
Confirmed - while the backend commands [create project, register flow, etc..] seem to work, the UI does not pick up the env var as part of a clean deploy/clean browser cache. Any automated way around this?
n

nicholas

10/26/2020, 1:20 PM
@Darragh - so on a clean install you're not seeing the correct apollo endpoint at
<http://your_server:8080/settings.json>
?
Actually after digging a little, I think https://github.com/PrefectHQ/ui/pull/360 will fix this but I just realized it hasn't been released yet - it should be released with the next Server release though, which is tomorrow/wednesday
d

Darragh

10/26/2020, 3:20 PM
In the json yes, but not in the ui
Great, thanks @nicholas !
😄 1
4 Views