Bug 1281687

Summary: hammer host update on realm fails with error ERROR -- : "\x82" from ASCII-8BIT to UTF-8
Product: Red Hat Satellite Reporter: Mahesh Taru <mtaru>
Component: Foreman ProxyAssignee: Ivan Necas <inecas>
Status: CLOSED ERRATA QA Contact: Kedar Bidarkar <kbidarka>
Severity: high Docs Contact:
Priority: high    
Version: 6.1.0CC: akofink, bbuckingham, cjg23, creynold, inecas, jcallaha, kbidarka, sjagtap, wharris
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Linux   
URL: http://projects.theforeman.org/issues/10581
Whiteboard:
Fixed In Version: foreman-proxy-1.11.0.6-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-14 20:59:27 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:
Attachments:
Description Flags
/var/log/foreman-proxy/proxy.log none

Description Mahesh Taru 2015-11-13 07:03:29 UTC
Description of problem:
Trying to update host using hammer utility fails on realm.
From webui works fine.

Version-Release number of selected component (if applicable):
rubygem-hammer_cli-0.1.4.13-1.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Satellite 6.1 with realm configured
2. Try to update host using hammer.

# hammer host update --id comp-st-060 --managed yes --hostgroup-id 12
Could not update the host:
  Failed to create example.com's realm entry: ERF12-5287 [ProxyAPI::ProxyException]: Unable to create realm entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://satellite.example.com:9090/realm/INT.ACI.ICS.PSU.EDU

3. Language settings on satellite server.
# env |grep -i lang
LANG=en_US.UTF-8
LANGUAGE=

# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

# runuser - postgres -c "psql -l"
                                   List of databases
    Name    |  Owner   | Encoding |   Collate   |    Ctype    |    Access privileges    
------------+----------+----------+-------------+-------------+-------------------------
 candlepin  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =T/postgres            +
            |          |          |             |             | postgres=CTc/postgres  +
            |          |          |             |             | candlepin=CTc/postgres
 foreman    | foreman  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =T/foreman             +
            |          |          |             |             | foreman=CTc/foreman
 gutterball | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =T/postgres            +
            |          |          |             |             | postgres=CTc/postgres  +
            |          |          |             |             | gutterball=CTc/postgres
 postgres   | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres            +
            |          |          |             |             | postgres=CTc/postgres
 template1  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres            +
            |          |          |             |             | postgres=CTc/postgres
(6 rows)


Actual results:
host update fails at first attempt

Expected results:
host should get updated without any error

Comment 3 Bryan Kearney 2015-11-13 16:22:19 UTC
Connecting redmine issue http://projects.theforeman.org/issues/10581 from this bug

Comment 4 Bryan Kearney 2015-11-13 17:02:26 UTC
Upstream bug component is Capsule

Comment 9 Andrew Kofink 2016-08-08 12:38:51 UTC
Created attachment 1188724 [details]
/var/log/foreman-proxy/proxy.log

Comment 10 Andrew Kofink 2016-08-08 12:46:41 UTC
I'm seeing the above attached log from either the UI or CLI. I followed the instructions here for an expired keytab to no avail: http://projects.theforeman.org/projects/foreman/wiki/ERF12-5287

Comment 11 Andrew Kofink 2016-08-08 12:50:39 UTC
In addition, I noticed the documentation for Foreman 1.12 may be incorrect, or the installer contains a bug: When attempting to install the smart proxy with `foreman-installer --foreman-ipa-authentication=true`, the option I get

```
ERROR: Unrecognised option '--foreman-ipa-authentication'

See: 'foreman-installer --help'
```

Comment 12 Andrew Kofink 2016-08-08 13:48:49 UTC
inecas, this seems like a bug with the smart proxy. If it's not, please reassign me.

Comment 13 Ivan Necas 2016-08-10 10:44:04 UTC
Opened a PR upstream to address the encoding issue

Comment 14 Bryan Kearney 2016-08-15 10:10:31 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/10581 has been closed

Comment 15 Sanket Jagtap 2016-09-13 17:13:10 UTC
Build:6.2.2-1.1.el7sat


Steps:
1. Configured satellite with REALM
2. Provisioned the host which enrolled into realm
3. Created a host group with non-ascii characters name "žluťoučký"
4. Updated the host group of the host to žluťoučký

Host enrolled into realm.

[root@kbrhel72mul99k ~]# id admin
uid=478000000(admin) gid=478000000(admins) groups=478000000(admins)

hammer> hostgroup list
---|---------------|---------------|------------------|-------------|------
ID | NAME          | TITLE         | OPERATING SYSTEM | ENVIRONMENT | MODEL
---|---------------|---------------|------------------|-------------|------
1  | rhel7_hstgrp  | rhel7_hstgrp  | RHEL Server 7.2  | production  |      
3  | žluťoučký | žluťoučký | RHEL Server 7.2  | production  |      
---|---------------|---------------|------------------|-------------|------


hammer> host update --id 6 --managed yes --hostgroup-id 3
Host updated

Also , the class field in IDM for the host is also updated with new hostgroup name.

Comment 17 errata-xmlrpc 2016-09-14 20:59:27 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/RHBA-2016:1885