https://prefect.io logo
Title
j

Jessica Smith

02/04/2023, 10:03 PM
I'm suddenly having issues of prefect saying that it can't log to Orion without a flow run id..but it's right as the flow starts, so there is definitely a flow run id. A flow that was working yesterday is failing like this all of a sudden. Any ideas?
āœ… 1
p

Peyton Runyan

02/05/2023, 12:57 PM
There's a possibility you're calling the logger outside of a flow run, or (or perhaps we are and this is a bug- can you paste your flow code and the exact error?). Try setting this config variable:
PREFECT_LOGGING_ORION_WHEN_MISSING_FLOW=warn
PR for details on what's likely happening: https://github.com/PrefectHQ/prefect/pull/8311
j

Jessica Smith

02/05/2023, 2:14 PM
It's definitely not that I'm callng it outside a flow, unless I have a very big misunderstanding of how it should be done. Here is example flow code:
from prefect import flow


@flow
def test_flow():
    print("test")


if __name__ == "__main__":
    test_flow()
Here is log message. I had to upgrade to 2.7.11 to get it to actually finish, 2.7.10 just raises a very unhelpful error
2.7.10 error message
(for context on environment, Windows 11 in Parallels but using VS Code remote tunnels to execute from M1 MBP)
Something I just noted, all of the log messages are showing up in Prefect Cloud twice. I imagine that's related, so I'm going to dig into the loggers and see if I've messed up a configuration or something
Aha! Seems I had set
PREFECT_LOGGING_EXTRA_LOGGERS='root'
in my config. removed this, seems to work now
šŸ™Œ 1
p

Peyton Runyan

02/05/2023, 4:11 PM
Ah! That makes sense. I’m glad you got it sorted!