chef / chef/knife-ec-backup

Error message is misleading if there are more entries in the clients group than clients

Open Beginner friendly
#157 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In the following code, the difference of the clients in the group vs the clients themselves is using .abs.

https://github.com/chef/knife-ec-backup/blob/7dd063dedfa3e5101a4f6bc998999780e732bdc0/lib/chef/knife/ec_base.rb#L261

In the case where the clients group has 1 or more clients that no longer exist, then the message show is misleading.

There are 2 missing clients in PROD_ORG's client group file /path/organizations/PROD_ORG/groups/client.json. If this is not intentional do NOT proceed with a restore until corrected. knife tidy backup clean will auto-correct this. https://github.com/chef-customers/knife-tidy

When in fact it should say something like

There are 2 clients in clients in PROD_ORG's client group file /path/organizations/PROD_ORG/groups/client.json that no longer exist.

The way this could happen is if some clients were deleted during the knife-ec-backup, after the client group data was exported but before the client data was exported.

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 at lib/chef/knife/ec_base.rb#L261 and trace the client-group count comparison for a group containing clients that no longer exist. Reproduce the backup case described in the issue and update the error wording so it identifies clients present in the group but absent from the exported client data; the issue is done when this scenario no longer produces the misleading missing-clients message.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.