Bug 1588190

Summary: character conversion error when calling '/logs' on foreman-proxy
Product: Red Hat Satellite Reporter: Chris Duryee <cduryee>
Component: Foreman ProxyAssignee: Ivan Necas <inecas>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.1CC: brian.bresina.ctr, cduryee, ddolguik, inecas, jhutar
Target Milestone: UnspecifiedKeywords: FieldEngineering, PrioBumpField, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-14 12:20:14 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 Chris Duryee 2018-06-06 21:40:17 UTC
Description of problem:

We recently set up a Satellite 6.3.1 with one capsule. When we go to the capsule status page in the Satellite, the status page shows ERF50-5345, and it looks like the capsule is returning a 400. The proxy.log shows the following:

E, [2018-06-06T16:22:17.884203 ] ERROR -- : "\xFC" from ASCII-8BIT to UTF-8
I, [2018-06-06T16:22:17.884587 ] INFO -- : 172.19.129.210 - - [06/Jun/2018:16:22:17 -0500] "GET /logs/?from_timestamp=0 HTTP/1.1" 400 31 0.0341

Version-Release number of selected component (if applicable): 6.3.1

I am not sure how to reproduce this, we set up a satellite with one capsule and then synced repos into it. The \xFC might be a ü, its possible something pushed that character into the log buffer.

The Satellite and capsule both had UTF8 as their locale fwiw, checked via localectl.

Comment 5 Ivan Necas 2018-06-14 07:10:28 UTC
It should match the `/var/log/foreman-proxy/proxy.log`. I tried to simulate adding 'ü' to the buffer, but the server was handling this properly. I guess there was some binary data logged into the log, that caused the trouble: the log file should help us identify what the data were and act accordingly.

Comment 8 Jan Hutař 2018-06-19 14:07:27 UTC
How do you get that issue (given I have that to-be-uploaded broken "/var/log/foreman-proxy/proxy.log")? I have tried to access:

   https://sat640snap7.example.com/logs

but it says "The page you were looking for doesn't exist.", adding port ":8008" gives me "Secure Connection Failed".

Comment 9 Ivan Necas 2018-06-21 13:03:49 UTC
Using the details of the proxy.log I was able to reproduce the issue:

1. enable http port on proxy (gets enabled when using the templates plugin) - in /etc/foreman-proxy/settings.yml uncomment `:http_port: 8000` and restart foreman-proxy

2. curl -k --cert /etc/foreman-proxy/foreman_ssl_cert.pem --key /etc/foreman-proxy/foreman_ssl_key.pem https://localhost:8000 - note using https with http port

3. go to the capsule details in UI and in the logs tab

This produces ASCII-8BIT to UTF-8 errors in /var/log/foreman-proxy/proxy.log.

Comment 11 Satellite Program 2018-06-21 14:30:51 UTC
Upstream bug assigned to inecas

Comment 12 Satellite Program 2018-06-21 14:30:53 UTC
Upstream bug assigned to inecas

Comment 13 Ivan Necas 2018-09-14 12:20:14 UTC

*** This bug has been marked as a duplicate of bug 1615439 ***