argoproj / argoproj/argo-workflows
Better error handling for workflows which already exist
- Dominant language
- Go
- Stars
- 17k
- Forks
- 3.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 138
Description
# Summary
Running the following command in my cluster (Using the default example template lovely-octopus), I get a `code = Unknown desc = The POST operation against Workflow.argoproj.io could not be completed at this time, please try again.`
This is because the workflow already exists, and I'm forcing the name using `--name specificname`. Instead of an unknown error, it would be prudent to return a better error code indicating this resource already exists:
```
argo submit --from WorkflowTemplate/lovely-octopus --name lovely-octopus-jobexists
time="2022-01-18T22:36:02.947Z" level=fatal msg="Failed to submit workflow: rpc error: code = Unknown desc = The POST operation against Workflow.argoproj.io could not be completed at this time, please try again."
```
# Use Cases
Through the API, I could make a request, and check if it already exists, and silently fail. When the error response is unknown, it could have been caused by some other error, and I'd only be guessing that it was because the workflow already exists.
When would you use this?
See above Use Case
---
**Message from the maintainers**:
Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.
Contributor guide
Research direction
Start with the `argo submit` entry point and the workflow submission API path, using the reproduced command with `--name` and an existing workflow name. Trace how the server's resource-exists response becomes the displayed `Unknown` error. Done means duplicate workflow submission returns a specific resource-exists error while other submission failures remain distinguishable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- api, cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100