View traces for Ubuntu hosts

Problem:
I would like to setup traces for my Ubuntu hosts which it working like a charm for my RedHat like distros.
Katello-upload-profile and katello-host-tools-tracer are installed on the hosts, I can see the needs
for reboot in the host status but nothing appears in the traces tab. Is that a normal behaviour for Ubuntu or did I miss a step somewhere?

Expected outcome:

See traces in the tab

Foreman and Proxy versions:

Foreman 3.5.1 Katello 4.7.3

Foreman and Proxy plugin versions:

|plugin |version|
|—|—|—|—|
|foreman-tasks | 7.1.1|
|foreman_bootdisk |21.0.3|
|foreman_puppet |5.0.0|
|foreman_remote_execution |8.2.0|
|katello |4.7.3|
|puppetdb_foreman |6.0.1|

Distribution and version:
OracleLinux 8.7

Other relevant data:

Have a look at https://apt.atix.de/
There you can find sub-man and katello-host-tools including tracer package.

Hi @Bernhard_Suttner,
subscription-manager, katello-host-tools and katello-host-tools-tracer are installed on my hosts from a local mirror of apt.atix.de. Thats why I’m asking if I have missed a step :face_with_monocle:

Hi there!

I have the same problem than @GC29:

  • Ubuntu 20.04 and 22.04 hosts
  • subscription-manager, katello-host-tools and katello-host-tools-tracer installed (edit, installed from apt.atix.de)
  • Still having the Enable Traces button in the Foreman GUI
  • Still having the Cannot upload tracer data, is this client registered? message on all the hosts.

Is there something else to do for register the client ?

Thanks for your feedback, I’m feeling less alone! :smile:

1 Like

Did you run “package-profile-upload --force” on the debian/ubuntu host?

On the foreman-rake console, you can run:

irb(main):006:0> a = Host.find_by(name: 'ubuntu2004-219.local')
irb(main):007:0> a.content_facet.tracer_installed?

This should show “true”. It checks, if on the host a package “python3-katello-host-tools-tracer” is installed. See: katello/content_facet.rb at master · Katello/katello · GitHub

Hi Bernhard,

On the foreman-rake console, it return me “false”

a.content_facet.tracer_installed?
=> false

On the concerned host:

# apt list --installed | grep python3-katello-host-tools-tracer

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

python3-katello-host-tools-tracer/unknown,now 3.5.7.1-1 all [installed,automatic]

The package-profile-upload returns me:

# package-profile-upload --force
Package profile updates
        status: 1
        updates: []
        exceptions:

Thanks for you report. Just opened a new PR which should fix the issue.

Please give it a try.

On my server /usr/share/gems/gems/katello-4.7.4/app/models/katello/host/content_facet.rb is only 282 lines… :thinking:

Should I modify this part ?


    213       def katello_agent_installed?
    214         self.host.installed_packages.where("#{Katello::InstalledPackage.table_name}.name" => 'katello-agent').any?
    215       end
    216
    217       def tracer_installed?
    218         self.host.installed_packages.where("#{Katello::InstalledPackage.table_name}.name" => [ "python-#{HOST_TOOLS_TRACER_PACKAGE_NAME}",
    219                                                                                                "python3-#{HOST_TOOLS_TRACER_PACKAGE_NAME}",
    220                                                                                                HOST_TOOLS_TRACER_PACKAGE_NAME ]).any?
    221       end
    222
    223       def host_tools_installed?
    224         host.installed_packages.where("#{Katello::InstalledPackage.table_name}.name" => [ "python-#{HOST_TOOLS_PACKAGE_NAME}",
    225                                                                                           "python3-#{HOST_TOOLS_PACKAGE_NAME}",
    226                                                                                           HOST_TOOLS_PACKAGE_NAME ]).any?
    227       end

Hi @Bernhard_Suttner

I have made the same changes that those of the PR in the /usr/share/gems/gems/katello-4.8.0.rc2/app/models/katello/host/content_facet.rb file and it looks like the package is now tagged as installed:

irb(main):001:0> Host.find_by(name: 'foreman-t5.lab').content_facet.tracer_installed?
=> true
irb(main):002:0> Host.find_by(name: 'foreman-t4.lab').content_facet.tracer_installed?
=> true
irb(main):003:0> Host.find_by(name: 'foreman-t3.lab').content_facet.tracer_installed?
=> true
irb(main):004:0> Host.find_by(name: 'foreman-t2.lab').content_facet.tracer_installed?
=> true

And no more Cannot upload tracer data, is this client registered? message:

sonic@foreman-t2:~$ sudo katello-tracer-upload
sonic@foreman-t2:~$

But still no traces available dand the Enable Traces button in the GUI:

Thanks for the help :slight_smile:

1 Like

Oh my bad, after restarting the host the traces looks working!

3 Likes

Thanks for your test. Hopefully the PR Fixes #36297 - Enable tracer on debian/ubuntu is always on by sbernhard · Pull Request #10514 · Katello/katello · GitHub can then be merged soon. Thoughts @katello ? :slight_smile:

2 Likes

I just try the fix, it works for me too!
Thanks!

1 Like