Bug 1623973 - foreman-debug still captures katello-service status rather than foreman-maintain service status
Summary: foreman-debug still captures katello-service status rather than foreman-maint...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Foreman Debug
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.4.0
Assignee: Lukas Zapletal
QA Contact: Ondrej Gajdusek
URL: https://projects.theforeman.org/issue...
Whiteboard:
Depends On: 1628926
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-30 15:05 UTC by Paul Dudley
Modified: 2019-11-05 23:33 UTC (History)
4 users (show)

Fixed In Version: katello-3.7.0-6-1,foreman-1.18.0.30-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 19:33:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 24767 0 Normal Closed katello-debug.sh still calls katello-service status rather than foreman-maintain 2020-04-22 09:30:03 UTC
Foreman Issue Tracker 24944 0 Normal Closed Remove LC_ALL=C from foreman-debug 2020-04-22 09:30:03 UTC

Description Paul Dudley 2018-08-30 15:05:51 UTC
Description of problem:
foreman-debug is still set to capture katello-service status output rather than foreman-maintain service status output.

From /usr/share/foreman/script/foreman-debug.d/katello-debug.sh:
...
add_cmd "katello-service status" "katello_service_status"
...

Should be changed to:
...
add_cmd "foreman-maintain service status" "foreman-maintain_service_status"
...

Comment 1 Lukas Zapletal 2018-08-31 08:54:59 UTC
Thanks for the patch!

Comment 3 Satellite Program 2018-09-03 16:10:51 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24767 has been resolved.

Comment 5 Ondrej Gajdusek 2018-09-13 15:44:04 UTC
I can see backtrace instead of proper output in 'foreman-maintain_service_status' file generated by foreman-debug.


COMMAND> foreman-maintain service status

/usr/share/gems/gems/foreman_maintain-0.2.9/definitions/features/mongo.rb:181:in `===': invalid byte sequence in US-ASCII (ArgumentError)
	from /usr/share/gems/gems/foreman_maintain-0.2.9/definitions/features/mongo.rb:181:in `block in read_db_section'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/definitions/features/mongo.rb:179:in `each'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/definitions/features/mongo.rb:179:in `read_db_section'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/definitions/features/mongo.rb:165:in `load_db_config'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/definitions/features/mongo.rb:31:in `initialize'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/detector.rb:114:in `new'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/detector.rb:114:in `detect_feature'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/detector.rb:73:in `block in ensure_features_detected'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/detector.rb:72:in `each_key'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/detector.rb:72:in `ensure_features_detected'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/detector.rb:45:in `available_procedures'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain.rb:113:in `allowed_available_procedures'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/cli/advanced/procedure/run_command.rb:7:in `<class:RunCommand>'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/cli/advanced/procedure/run_command.rb:6:in `<module:Procedure>'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/cli/advanced/procedure/run_command.rb:5:in `<module:Cli>'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/cli/advanced/procedure/run_command.rb:4:in `<module:ForemanMaintain>'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/cli/advanced/procedure/run_command.rb:3:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/cli/advanced/procedure_command.rb:1:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/cli/advanced_command.rb:1:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/lib/foreman_maintain/cli.rb:8:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/share/gems/gems/foreman_maintain-0.2.9/bin/foreman-maintain:11:in `<top (required)>'
	from /usr/bin/foreman-maintain:23:in `load'
	from /usr/bin/foreman-maintain:23:in `<main>'

Running foreman-maintain service status from shell shows the proper/expected output.

Comment 6 Lukas Zapletal 2018-09-14 11:41:20 UTC
This is a bug in foreman-maintain actually, I filed: https://bugzilla.redhat.com/show_bug.cgi?id=1628926

I am marking this as a regression, previously we had status debug file, now there is none.

Comment 7 Ivan Necas 2018-09-14 13:17:59 UTC
The problem is pulp config file (/etc/pulp/server.conf) contains UTF-8 characters:

    # ca_path:           The ca_certs file contains a set of concatenated “certification authority”

While we can fix explicitly in foreman maintain's particular place when reading the /etc/pulp/server.conf file, I'm not sure I agree that setting LC_ALL=C in foreman-debug is the right approach, at least when running ruby scripts: when continuing with this approach, we risk random failures in any other places, all having the common denominator of having LC_ALL=C, where foreman-debug might be the only place we us it that way. I think it would be more suitable to set LC_ALL=en_US.UTF-8

Anyway, I will go ahead and sent a patch to foreman-maintain to set the UTF-8 encoding by default explicitly.

Comment 8 Lukas Zapletal 2018-09-14 13:47:17 UTC
Let me change my mind:

https://projects.theforeman.org/issues/24944

Honestly I don't remember why I added it, it can break things in UTF-8 these days. This is a left over I have in my head from the pre-UTF8 era.

Comment 10 Patrick Creech 2018-09-24 14:46:28 UTC
snap 23, not 63

Comment 11 Ondrej Gajdusek 2018-09-26 12:40:06 UTC
foreman-debug now generates 'foreman-maintain_service_status' file with the proper content and without the backtrace.

Verified with:
snap_6.4.0_23.0
foreman-debug-1.18.0.33-1.el7sat.noarch

Comment 12 Bryan Kearney 2018-10-16 19:33:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:2927


Note You need to log in before you can comment on or make changes to this bug.