Hey guys, I’m upgrading from 0.12.2 to 0.13.12 and...
# ask-community
d
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
Hi @Darragh - have you tried setting these variables in
~/.prefect/config.toml
?
d
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
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
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
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
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
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
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
Can you try resetting that variable? (there's a reset button in the input where you set the connection manually)
d
Button doesn’t seem to do anything… 🤔
n
Can you screenshot what you see there?
d
I have the server logs tailed here as well, and I don’t see any log output when I hit the reset button
n
When you reset, that input isn't cleared and your configuration doesn't show up?
d
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
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
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
Right, the cache is browser-side
If resetting picks up the correct value, that means your environment variables are set correctly.
d
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
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
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
@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
In the json yes, but not in the ui
Great, thanks @nicholas !
😄 1