chef / chef/knife-ec-backup

400 Bad Request errors do not show enough information to be useful

Open
#147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Untriaged
Dominant language
Ruby
Stars
32
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Describe the Enhancement:

Today the sum of errors is printed out at the end of a restore. If the error is a Net::HTTPServerException there is essentially no useful information.

The literal thing I was running into was users failing to be created because of a bad email address ex.response.body #=> {"error":["email must be valid"]}. This wasn't observable with the current information being logged.

Describe the Need:

Anybody who would like to correct an issue would want to know more details about the error so the issue can be corrected.

Current Alternative

Not that I can think of other than something like pry.

Can We Help You Implement This?:

Would like some direction in terms of best way to implement. I could see creating a custom exception class for these errors and then nesting the original exception in it. Then inside the EcErrorHandler add additional ways to format the output.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating EcErrorHandler and the restore path that summarizes errors, then inspect how Net::HTTPServerException is currently formatted. Reproduce a failed restore involving a 400 response and verify that the resulting output includes the server-provided error details, such as the response body.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.