https://prefect.io logo
Title
n

Nathan Low

05/17/2023, 2:48 PM
Hi All, sorry to bug about an issue with an on prem setup again but we're updated an on prem prefect server to use postgres, updated the PREFECT_ORION_DATABASE_CONNECTION_URL (we're on 2,7,12) on a different profile to the correct url, but Prefect is using the sqlite database instead, even when we use the profile using a call to start the server with the '-p profile_name' flag. Are there any other flags to set? I can't see what the setting is on the server as it's blanked out, which makes sense as it could have passwords in it.
Is there anything I can do with this? Our sqlite db on prod is at 12GB and I'm definitely seeing issues with getting the prefect server to work when the database gets to this size.
z

Zanie

05/23/2023, 2:57 PM
Can you try setting the profile with
PREFECT_PROFILE
instead?
We might not properly pass the current profile to sub-commands with the
-p
flag
n

Nathan Low

05/23/2023, 2:58 PM
Ok, I'll give that a shot, thanks
I've tried updating the default profile but that didn't seem to take either
z

Zanie

05/23/2023, 2:58 PM
Really? via
prefect profile use ...
?
That’d be pretty weird. We also changed the setting name to
PREFECT_API_DATABASE_CONNECTION_URL
— the old one should still work but you may want to just use the new one to avoid any complications.
n

Nathan Low

05/23/2023, 3:00 PM
Yeah, locally I've noticed the prefect config set doesn't actually update the project.toml files
z

Zanie

05/23/2023, 3:16 PM
It updates a profiles file at ~/.prefect
n

Nathan Low

05/23/2023, 3:17 PM
in linux, sure, but in windows it updates C:\users\[user that is running the process]\.prefect, but it's not doing that.
z

Zanie

05/23/2023, 3:17 PM
~ being whatever your home directory is yes 😄
It’s not updating the profiles file but it doesn’t error?
n

Nathan Low

05/23/2023, 3:19 PM
Then when you set PREFECT_HOME it puts the toml file there, but doesn't seem to update it through the command line
yeah no error, just config updated successfully or something like that
z

Zanie

05/23/2023, 3:20 PM
You can’t change the home directory that way
The home directory needs to be consistent because that’s how we find the profiles to read
n

Nathan Low

05/23/2023, 3:20 PM
not through "prefect config set PREFECT_HOME"?
z

Zanie

05/23/2023, 3:20 PM
Yeah you shouldn’t do that
n

Nathan Low

05/23/2023, 3:20 PM
Ok, what should we do?
z

Zanie

05/23/2023, 3:20 PM
We can add a guard for it
If you want to change the home directory, use an environment variable.
n

Nathan Low

05/23/2023, 3:21 PM
Ok, gotcha
z

Zanie

05/23/2023, 3:21 PM
Changing the home directory changes the profile lookup path
So if you change the home directory in a profile, we’ll never find it 😄
n

Nathan Low

05/23/2023, 3:28 PM
Cool thanks
Yeah that got us for like a month figuring that file update thing out, just updated it by hand to get it working
Ok, I've set the settings as environment variables, now I get permission denied on the folder set in the environment variable, I've opened it up to 'Everyone', so I'm confused
Seems to mostly be dependant on the "PREFECT_PROFILES_PATH" environment variab*le*
After changing the "PREFECT_HOME" environment variable, and creating a new postgresql profile with "prefect profile create test" and using "prefect set" then "prefect profile use postgresql" before running "prefect -p postgresql orion start --host 0.0.0.0" it is using the postgresql db, thanks a bunch!
💯 1
I am not entirely sure where the profile.toml file is being stored at the moment. I think it would where I set PREFECT_HOME to be: C:\PrefectServer\Orion, but didn't see the date modified to be updated on that file in that folder or in ~\.prefect (C:\Users\svc_prefect_d\.prefect)
And it seems like there's a read timeout when trying to read the ssl certs file to connect to postgresql