Support bundle download gives error undefined method `strip` and Ops Manager certificate pane does not load
search cancel

Support bundle download gives error undefined method `strip` and Ops Manager certificate pane does not load

book

Article ID: 293789

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

Ops Manager was recently upgraded to version 2.10.40 or 2.10.41.

Foundation has products with syslog configured but not TLS-enabled syslog.

Downloading the support bundle (end point /api/v0/support_bundle) fails with 500 error undefined method `strip' for nil:NilClass:

Screen Shot 2022-06-08 at 2.12.22 PM.png

OpsManager > Certificates pane does not load certificates:

Screen Shot 2022-06-08 at 2.12.04 PM.png

Environment

Product Version: 2.10

Resolution

This issue is fixed in version 2.10.42 of OpsManager. Upgrading to latest patch of from Tanzu Net is recommended resolution. 

This issue is a regression introduced in Ops Manager releases 2.10.40 and 2.10.41. The bug affects foundations that are not configured to use a TLS-enabled syslog endpoint. The problem is caused by code that does not check to validate whether syslog certificate is null. 

If you cannot upgrade immediately then there is a workaround available.

Workaround:

1. SSH to OpsManager

2.  Backup and edit the file: 

sudo cp /home/tempest-web/tempest/web/app/presenters/api/v0/deployed/product_certificate_extractor.rb
/home/tempest-web/tempest/web/app/presenters/api/v0/deployed/product_certificate_extractor.rb.bak


sudo vim /home/tempest-web/tempest/web/app/presenters/api/v0/deployed/product_certificate_extractor.rb

Modify line 26 from:
return cert_metadata unless product.syslog_enabled?

to:
return cert_metadata unless product.syslog_enabled? && !product.syslog_config.ssl_ca_certificate.nil?

3. Backup and edit the file: 

sudo cp /home/tempest-web/tempest/web/lib/certificate_utils.rb /home/tempest-web/tempest/web/lib/certificate_utils.rb.bak
 

sudo vim /home/tempest-web/tempest/web/lib/certificate_utils.rb


Modify line 5 from: 
text_with_certificates.strip.each_line do |line| 

to
(text_with_certificates || '').strip.each_line do |line|

4. Restart tempest-web for changes to be applied.

service tempest-web restart

NOTE: You will need to enter decryption passphrase in UI after restart.