Bug 1195658

Summary: subscription-manager fails to register due to Encoding::CompatibilityError in production.log
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: Subscription ManagementAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NEXTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.7CC: bbuckingham, bkearney, cwelton, jcallaha, lzap
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-06 19:29:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavel Moravec 2015-02-24 09:40:45 UTC
Description of problem:
A customer was unable to register a content host using subscription-manager with activation key to Sat6, that logged to production.log (see unblurred log in private attachment):

Processing by Katello::Api::Rhsm::CandlepinProxiesController#consumer_activate as JSON
  Parameters: {"facts"=>"[FILTERED]", "installedProducts"=>[{"productName"=>"Red Hat Enterprise Linux Server", "arch"=>"x86_64", "version"=>"6.6", "productId"=>"69"}], "type"=>"system", "name"=>"*******", "owner"=>"*******", "activation_keys"=>"*******"}
Completed 500 Internal Server Error in 1220ms

Encoding::CompatibilityError (incompatible character encodings: UTF-8 and ASCII-8BIT):
  lib/middleware/catch_json_parse_errors.rb:9:in `call'
  app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'

(and nothing more in the backtrace)

Adding "encoding: utf8" in the production section of /etc/foreman/database.yml file is a valid workaround.

Despite we dont know where the binary (and not-UTF8) input data come from, doesn't it make sense to have the "encoding:utf8" set in database.yml preventivelly everytime? Knowing the sensitivity of ruby to non-UTF8 input..

Or is there a different approach for this?


Version-Release number of selected component (if applicable):
foreman-1.6.0.52-1


How reproducible:
???


Steps to Reproduce:
??? unknown atm


Actual results:
content host unable to register


Expected results:
content host registered


Additional info:
attaching sosreport, foreman-debug and production.log

Comment 8 Pavel Moravec 2015-03-30 13:19:12 UTC
Important observation: the issue is present only when using activation key. Without it, subscription-manager succeeds.

Comment 12 jcallaha 2018-02-06 19:21:46 UTC
Unable to reproduce this on Sat 6.3 Snap 35. I recommend closing this, pending any additional concerns.

Comment 13 Bryan Kearney 2018-02-06 19:29:05 UTC
This can not be reproduced on Satellite 6.3. I am closing this out as next release. If you are still seeing this on 6.3, please feel free to re-open with additional information.