What to do when encountering the error Encoding::CompatibilityError (incompatible character encodings: UTF-8 and ASCII-8BIT) ?

Solution Verified - Updated -

Environment

Red Hat Satellite 6.0

Issue

When running the command subscription-manager register --org="organization" --activationkey="key" the following error message is seen in /var/log/foreman/production.log

Processing by Katello::Api::V2::RootController#resource_list as JSON
  Parameters: {"root"=>{}}
  Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/views/katello/api/v2/root/resource_list.json.rabl within katello/api/v2/layouts/collection (5.2ms)
Completed 200 OK in 39ms (Views: 7.2ms | ActiveRecord: 0.0ms)
Processing by Katello::Api::Rhsm::CandlepinProxiesController#server_status as JSON
Completed 200 OK in 161ms (Views: 1.1ms | ActiveRecord: 0.0ms)
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"=>"xxxxx", "owner"=>"xxxx", "activation_keys"=>"RHN Activation Key"}
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'

Resolution

The working workaround is using the subscription manager without activation key

# subscription-manager register --org="organization" --environment="Library"

We are working on solving this issue as soon as possible
There is bugzilla open for the issue: Bugzilla 1195658

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments