Project

General

Profile

Actions

Bug #35906

closed

[katello] Allow pulp_rest debugs for pulp3

Added by Pavel Moravec over 1 year ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Repositories
Target version:
Fixed in Releases:
Found in Releases:

Description

Description of problem:
With pulp2, Satellite/katello allowed to enable cp_rest and pulp_rest logging to see individual API requests to / resonses from [pulp|candlepin] - see https://access.redhat.com/solutions/3001661 . It is/was a nice feature allowing to 1) understand how katello manipulates with pulp/candlepin objects, 2) simplify a reproducer purely to pulp/candlepin.

Since pulp2to3 migration, this does not further work for pulp. The reason is, katello uses PulpcoreClient module that has class Configuration and :debugging, but no way to enable it.

I think the basic fix one-liner:

https://github.com/Katello/katello/blob/db5a820f93dad82348b382570fdad90e36c6f51c/app/models/katello/concerns/smart_proxy_extensions.rb#L190

should be:

config.debugging = ::Foreman::Logging.logger('katello/pulp_rest').debug?

which enables debugs like:

2023-01-02T22:40:59 [D|kat|6ce9a60c] Calling API: DistributionsRpmApi.partial_update ...
2023-01-02T22:40:59 [D|kat|6ce9a60c] HTTP request body param BEGIN
6ce9a60c | {"content_guard":null,"base_path":"RedHat/Library/custom/zoo_product/ZOO_repo","publication":"/pulp/api/v3/publications/rpm/rpm/2e85692d-4690-4ea1-9092-7927187bf874/"}
6ce9a60c | END
6ce9a60c |
2023-01-02T22:40:59 [D|kat|6ce9a60c] HTTP response body BEGIN
6ce9a60c | {"task":"/pulp/api/v3/tasks/2656ab82-e498-4bdb-9424-08ff56776861/"}
6ce9a60c | END
6ce9a60c |

(note the debugs lack method and URL of the request, which will be a scope of another issue)

BUT that one-liner fix is not ideal: whenever foreman/katello enables logging debugs, it automatically evaluates

::Foreman::Logging.logger('katello/pulp_rest').debug?

to true. While I would expect the default logging level of pulp_rest (and also cp_rest) should be info, something we should change via config. But I failed to override this default in either way.

Actions #1

Updated by The Foreman Bot over 1 year ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/10402 added
Actions #2

Updated by Samir Jha over 1 year ago

  • Target version set to Katello 4.7.1
  • Triaged changed from No to Yes
Actions #3

Updated by The Foreman Bot over 1 year ago

  • Fixed in Releases Katello 4.8.0 added
Actions #4

Updated by Chris Roberts over 1 year ago

  • Category set to Repositories
  • Status changed from Ready For Testing to Closed
Actions #5

Updated by The Foreman Bot over 1 year ago

  • Pull request https://github.com/Katello/katello/pull/10426 added
Actions #6

Updated by The Foreman Bot 8 months ago

  • Pull request https://github.com/Katello/katello/pull/10743 added
Actions

Also available in: Atom PDF