https://prefect.io logo
o

Oscar Björhn

11/01/2022, 12:53 PM
Good day! I'm trying to run a flow using azure container instance (ACI) and I'm getting a strange missing context error that I never bumped into during my docker and kubernetes days. Has anyone seen this before?
1
Copy code
Agent started! Looking for work from queue(s): transformation-dev...
12:33:08.199 | INFO    | prefect.agent - Submitting flow run                    
'ce25c963-b1a7-4158-a3e8-2313dfe983e8'                                          
12:33:08.948 | ERROR   | prefect.agent - Failed to submit flow run              
'ce25c963-b1a7-4158-a3e8-2313dfe983e8' to infrastructure.                       
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /usr/local/lib/python3.8/site-packages/prefect/logging/handlers.py:273 in    │
│ emit                                                                         │
│                                                                              │
│   270 │   │   │   if not getattr(record, "send_to_orion", True):             │
│   271 │   │   │   │   return  # Do not send records that have opted out      │
│   272 │   │   │                                                              │
│ ❱ 273 │   │   │   self.get_worker(profile).enqueue(self.prepare(record, prof │
│   274 │   │   except Exception:                                              │
│   275 │   │   │   self.handleError(record)                                   │
│   276                                                                        │
│                                                                              │
│ /usr/local/lib/python3.8/site-packages/prefect/logging/handlers.py:309 in    │
│ prepare                                                                      │
│                                                                              │
│   306 │   │   │   try:                                                       │
│   307 │   │   │   │   context = prefect.context.get_run_context()            │
│   308 │   │   │   except MissingContextError:                                │
│ ❱ 309 │   │   │   │   raise MissingContextError(                             │
│   310 │   │   │   │   │   f"Logger {record.name!r} attempted to send logs to │
│   311 │   │   │   │   │   "flow run id. The Orion log handler can only send  │
│   312 │   │   │   │   │   "run contexts unless the flow run id is manually p │
╰──────────────────────────────────────────────────────────────────────────────╯
MissingContextError: Logger 'azure.identity._internal.get_token_mixin' attempted
to send logs to Orion without a flow run id. The Orion log handler can only send
logs within flow run contexts unless the flow run id is manually provided.
My agent also runs in ACI and it can run kubernetes-based flow runs with no issues. I get the error even if I update my block to refer to a non-existing image, so it's not even pulling the image.
a

Anna Geller

11/01/2022, 1:33 PM
for posterity - Ryan is on the case 🙂
👍 1