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

Job definition creation failure due to validation error and show weird error message #281

Closed
edwardps opened this issue Nov 5, 2022 · 4 comments · Fixed by #283
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@edwardps
Copy link

edwardps commented Nov 5, 2022

Description

When the job is created using an invalid s3 bucket(e.g. s3 bucket in another different region), the job will be failed due to backend validation. Then the UI show error message like below:

Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=Error%3A%20S3%20bucket%20-us-west-2%20must%20be%20in%20region%20'us-east-1'%2C%20but%20found%20in%20'us-west-2' for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

Reproduce

Simply use a s3 bucket in different region.

@edwardps edwardps added the bug Something isn't working label Nov 5, 2022
@dlqqq
Copy link
Collaborator

dlqqq commented Nov 5, 2022

Interesting, it looks like we are rendering the error object itself rather than the text? I don't see why this would be the case in #277. I'll investigate this issue further on Monday.

@edwardps
Copy link
Author

edwardps commented Nov 5, 2022

Thanks David for the investigation.

Can we follow the behavior and show the error message in the job creation page? This enable customer to easily fix the issue without requiring entering configuration from scratch.

@JasonWeill JasonWeill self-assigned this Nov 7, 2022
@JasonWeill
Copy link
Collaborator

I have not been able to reproduce this. I tried to replace createJob with a function that always fails:

  async createJob(
    model: Scheduler.ICreateJob
  ): Promise<Scheduler.ICreateJobResponse> {
    return Promise.reject(
      new ServerConnection.ResponseError(
        new Response(),
        'Rejected because I said so'
      )
    );
  }

When I submit a request, I always get an error message above the form, without hitting the error boundary.

image

In submitCreateJobRequest, we're already using a try/catch block to catch this error, so it wouldn't hit the error boundary anyway:

api
.createJob(jobOptions)
.then(response => {
// Switch to the list view with "Job List" active
props.showListView(JobsView.ListJobs);
})
.catch((error: Error) => {
props.handleModelChange({
...props.model,
createError: error.message,
createInProgress: false
});
});

@JasonWeill
Copy link
Collaborator

I can reproduce this in open source code with a custom handler for job definition creation, but not with one for job creation. A similar try/catch block appears in the submitCreateJobDefinitionRequest function.

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

Successfully merging a pull request may close this issue.

3 participants