500 error when attempting to GET a cookbook artifact ACL for invalid artifact
Open
@lbakerchef is already working on this.
Since Dec 21, 2021.
Triage: Confirmed
- Dominant language
- Erlang
- Stars
- 303
- Forks
- 211
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 5
Description
This is easily reproduceable against current hosted chef:
$ bin/knife raw cookbook_artifacts/bad_artifact
ERROR: Server responded with error 404 "Object Not Found"
ERROR: Error Body: {"error":["not_found"]}
?1 chef/knife $ bin/knife raw cookbook_artifacts/bad_artifact/_acl
ERROR: Server returned error 500 for https://api.chef.io/organizations/jiminywarehouse/cookbook_artifacts/bad_artifact/_acl, retrying 1/5 in 4s
The fix for this is to add a handler to chef_wm_util:not_found_message, as
chef_wm_util:not_found_message(cookbook_artifact, Name)
The dialyzer spec must also be updated to indicated cookbook_artifact is an accepted input. It is worth looking too to see why dialyzer didn't warn/error about this function being called with non-matching input - maybe something in the existing rule is too general and needs to be tightened up.
Aha! Link: https://chef.aha.io/features/SH-3015
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.