Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Flyteadmin treats workflow compilation failures as internal #4565

Closed
2 tasks done
katrogan opened this issue Dec 8, 2023 · 1 comment
Closed
2 tasks done

[BUG] Flyteadmin treats workflow compilation failures as internal #4565

katrogan opened this issue Dec 8, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@katrogan
Copy link
Contributor

katrogan commented Dec 8, 2023

Describe the bug

Flyteadmin currently returns grpc status Internal for workflow compilation failures:

// Validate that the workflow compiles.
workflowClosure, err := w.getCompiledWorkflow(ctx, finalizedRequest)
if err != nil {
logger.Errorf(ctx, "Failed to compile workflow with err: %v", err)
return nil, errors.NewFlyteAdminErrorf(codes.Internal,
"failed to compile workflow for [%+v] with err %v", request.Id, err)
}

Expected behavior

An invalid workflow passed into the create request should be treated as a user rather than server error

Additional context to reproduce

No response

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@katrogan katrogan added the bug Something isn't working label Dec 8, 2023
@katrogan katrogan self-assigned this Dec 8, 2023
Copy link

dosubot bot commented Dec 8, 2023

🤖

Hey @katrogan!👋 I'm Dosu, a friendly bot here to assist you while we wait for a human maintainer to join us. I'm designed to help solve bugs, answer questions, and assist you in becoming a contributor. Let's dig into this together, shall we? 😊

I understand your concern about Flyteadmin treating workflow compilation failures as internal server errors rather than user errors. This behavior is due to the fact that the compilation process is considered a server-side operation. The server is responsible for compiling the workflow, and if it fails, it's treated as a server error. This is evident in the TestCreateWorkflow_CompileWorkflowError function in the workflow_manager_test.go file.

The workflow compilation process in Flyteadmin involves several steps, including validation of inputs, task validation, workflow requirements validation, workflow validation, and finally, compilation. If any of these steps fail, it's considered a server error because these operations are performed by the server. You can find more details about the workflow compilation process in the CompileWorkflow function in the workflow_compiler.go file.

Additionally, there are other error types in Flyteadmin that are treated as server errors when they could be considered user errors. For instance, all Gorm errors, except for gorm.ErrRecordNotFound, are treated as server errors (codes.Internal). This includes errors that could be due to user input, such as invalid query parameters. Similarly, all PgErrors, except for uniqueConstraintViolationCode and undefinedTable, are treated as server errors (codes.Unknown). This includes errors that could be due to user input, such as invalid SQL syntax or non-existent table/column names. You can find more details about this in the fromGormError and ToFlyteAdminError functions in the postgres.go file.

I hope this clarifies why Flyteadmin treats workflow compilation failures as internal server errors. If you have any further questions, feel free to ask.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant