https://prefect.io logo
Title
c

Chris Goddard

07/21/2020, 5:40 PM
hi there! I'm working on deploying prefect on a server. in the short term I'm just wanting to run a flow as a script rather than run prefect server. that works fine locally but for some reason on the server I keep getting errors because it's expecting an API key to prefect cloud. is there a configuration setting I'm missing?
I'm using the "slack_notifier" state handler which references prefect.Client() to get a flow ID's url. this is what's causing the error - get_cloud_url method fails because it's trying to connect to Prefect Cloud
z

Zachary Hughes

07/21/2020, 5:50 PM
Hi @Chris Goddard, have you run
prefect backend server
?
c

Chris Goddard

07/21/2020, 5:51 PM
no! I'll try. I think because I've run prefect server locally my local configuration is different
is there a way to configure that without running that command? I'm running the script and prefect within a docker container
z

Zachary Hughes

07/21/2020, 5:56 PM
backend
is stored in
config.toml
, so you should be able to overwrite that with a local config if you'd like!
c

Chris Goddard

07/21/2020, 5:56 PM
perfect
yup that worked!
🎉 1
z

Zachary Hughes

07/21/2020, 5:58 PM
Glad to hear it!
c

Chris Goddard

07/21/2020, 5:59 PM
could that be set with an environment variable? i.e.
PREFECT__CONFIG__BACKEND
?
would it be
PREFECT__CONFIG__BACKEND="server"
?
z

Zachary Hughes

07/21/2020, 6:03 PM
That would do the trick as well! Env vars set like that can override the values defined in
config.toml
. In this case I think it'd be
PREFECT__BACKEND