https://prefect.io logo
#prefect-community
Title
# prefect-community
w

wonsun

07/15/2022, 6:56 AM
Hi all~ I want to know that how to change the prefect's default server database! (using prefect 1.0) There's method "Running Prefect with a pre-existing postgres database" in prefect docs. But can i change the
server.database.connection_url
or
server.database.host
to connecting information for MySQL database, not postgres?
1
a

Anna Geller

07/15/2022, 9:37 AM
No, currently only Postgres is supported as a Server backend
w

wonsun

07/15/2022, 9:40 AM
oh... I see. thank you for your fast reply💙
🙌 1
Galler.. Same problem, sorry to ask twice! I set the Secret at Cloud. (like below image) And I imported the modules related to Secret in the python file where flow is defined and wrote the code as follows.
team_db = Secret('my_strow').get()
But i got the error message like this.
Copy code
Traceback (most recent call last):
  File "/home/.prefect/flow.py", line 199, in <module>
    team_db = Secret('my_strow').get()
  File "/home/enviorments/test/lib/python3.10/site-packages/prefect/client/secrets.py", line 170, in get
    raise ValueError(
ValueError: Local Secret "my_strow" was not found.
I think that I'm not enough understanding about secret on cloud and local secret. Also weird things, last week i already run this flow code that same method. What am i missing?? 😟
The only difference from when the flow running well is I changed the content of 'my_strow' in the UI.
@Anna Geller
a

Anna Geller

07/21/2022, 10:45 PM
try this:
Copy code
export PREFECT__CLOUD__USE_LOCAL_SECRETS=false
💙 1
w

wonsun

08/22/2022, 6:12 AM
Hi Anna, as you said above, I used the export~ method to call and use the secret stored in the cloud, but when I turn off the computer or run flow in some cases,
Value error  : Local Secret was not found.
appears. I want to fundamentally solve this problem, could you please tell me what is wrong? The order in which I execute the prefect (1.0) flow is usually as follows. 1. virtual enviorment activate 2. prefect backend cloud 3. prefect server start 4. prefect agent local start -p <entered specific path> 5. export PREFECT__CLOUD__USE_LOCAL_SECRETS=false Is there something wrong? I hope this error doesn't happen again.. 😞 @Anna Geller
a

Anna Geller

08/22/2022, 10:39 AM
this is only valid if you want to use Cloud:
Copy code
export PREFECT__CLOUD__USE_LOCAL_SECRETS=false
for Server, you only have local Secrets so you should use:
Copy code
export PREFECT__CLOUD__USE_LOCAL_SECRETS=true
this will clarify more https://discourse.prefect.io/t/how-to-set-secrets-e-g-github-access-token-on-server/70
w

wonsun

08/22/2022, 10:44 AM
Humm.. I use the secret stored in the cloud as
export PREFECT__CLOUD__USE_LOCAL_SECRETS=false
but sometimes it works well and sometimes it doesn't... There is no secret set in local.
a

Anna Geller

08/22/2022, 10:52 AM
check this Discourse thread, it has a detailed explanation
w

wonsun

08/22/2022, 10:53 AM
Will do. Appreciate it
🙌 1
60 Views