Hey folks I've just upgraded to 0.15.5 and I'm now getting a Foreign key violation on starting a local prefect server. I run
prefect server start --postgres-port 5433
to start the server (have another postgres instance on my machine hence the port diff) then I get the following error. However despite this and the logs spitting out endless errors the I can still connect agents and register flows and they still work. Any ideas how I can fix this?
Hi @Elliot Oram - did you run the migrations as part of upgrading?
You should be able to do so via the CLI
prefect server database upgrade
upvote 1
e
Elliot Oram
09/16/2021, 5:13 PM
No such luck I'm afraid:
Copy code
$ prefect server database upgrade
Usage: prefect server [OPTIONS] COMMAND [ARGS]...
Try "prefect server -h" for help.
Error: No such command "database".
k
Kevin Kho
09/16/2021, 5:14 PM
What did you upgrade from?
e
Elliot Oram
09/16/2021, 5:15 PM
0.14.6
z
Zach Angell
09/16/2021, 5:56 PM
Ah sorry about that, the command is
prefect-server database upgrade
e
Elliot Oram
09/17/2021, 7:05 AM
Copy code
$ prefect-server database upgrade
zsh: command not found: prefect-server
z
Zach Angell
09/17/2021, 1:53 PM
I'm sorry I hadn't realized you were runnning Server only using Prefect Core. I doubt migrations are the problem unless you're seeing errors on startup.
The particular constraint referenced in the stack trace,
log_flow_run_id_fkey
was added over a year ago.
It seems like something is trying to write logs for a flow run that no longer exists.
• Do you know what is trying to write these logs? The most likely candidate is a Prefect agent
• Did you persist data when restarting Server? If not, it's possible any running flow runs would try to write remaining logs and generate these errors
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.