Hi all, we are using the Kubernetes agent with the...
# prefect-community
c
Hi all, we are using the Kubernetes agent with the
KubernetesJobEnvironment
and some of our flows are failing with the error below. I'm sure it's something minor... if we wait a few minutes and retry from the UI it does eventually run.
Copy code
Failed to create Kubernetes job: (409)
Reason: Conflict
HTTP response headers: HTTPHeaderDict({'Audit-Id': '8b3f7073-0520-49a3-9d38-60d761af5fbe', 'Content-Type': 'application/json', 'Date': 'Wed, 16 Sep 2020 15:55:38 GMT', 'Content-Length': '242'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"jobs.batch \"workflows-prefect-job\" already exists","reason":"AlreadyExists","details":{"name":"workflows-prefect-job","group":"batch","kind":"jobs"},"code":409}
j
Hey @Charlie Cahoon this looks to be due to the name of your job spec not being unique! So while a run is either running or waiting to be cleaned up another run is scheduled and it encounters a conflict. The
KubernetesJobEnvironment
has an optional kwarg
unique_job_name: bool
which when set to
True
will generate a unique name for the prefect job on each run
upvote 1
c
Josh, thanks for the quick reply! I'll go look at that. I knew it was probably something small.