Skip to content

Commit e2be2fb

Browse files
committed
Fixes #38212 - Podman push expected 404s now render as info messages in log
1 parent ebfaf9b commit e2be2fb

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

app/controllers/katello/api/registry/registry_proxies_controller.rb

+13-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,19 @@ def repackage_message
2323
end
2424

2525
rescue_from RestClient::Exception do |e|
26-
Rails.logger.error pp_exception(e)
26+
# Log BLOB_UNKNOWN errors as info.
27+
# These 404s occur as part of podman push's blob lookup and should not be reported as errors.
28+
if e.http_code == 404
29+
body = JSON.parse(e.http_body) rescue {}
30+
if body["errors"]&.any? { |error| error["code"] == "BLOB_UNKNOWN" }
31+
Rails.logger.info pp_exception(e)
32+
else
33+
Rails.logger.error pp_exception(e)
34+
end
35+
else
36+
Rails.logger.error pp_exception(e)
37+
end
38+
2739
if request_from_katello_cli?
2840
render json: { errors: [e.http_body] }, status: e.http_code
2941
else

0 commit comments

Comments
 (0)