Project

General

Profile

Actions

Bug #28878

open

Foreman Ansible Inventory reports fails in JSON if hosts has a non ascii char in its

Added by Samir Jha about 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Reporting
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Copied from original community post: https://community.theforeman.org/t/foreman-ansible-inventory-reports-fails-in-json-if-hosts-has-a-non-ascii-char-in-its-facts/17119

Problem:
When AWX (Ansible Tower) sync its inventory or when manually generating an “Ansible Inventory” Report template, with facts, if any of those facts contains a non ascii character and you try to export the template in Json, you’ll receive an error similar to :

(Encoding::UndefinedConversionError): “\xC3” from ASCII-8BIT to UTF-8

In my case, I had the following in one of my host :

ec2_userdata :
"then rm /bootstrap.donefi# Récupération du répertoire courant et du répertoire "

Which caused the problem.
Exporting in anything else but Json works without problem.

Expected outcome:
No error when generating the report

Foreman and Proxy versions:
1.24.1
Foreman and Proxy plugin versions:
1.24.1

No data to display

Actions

Also available in: Atom PDF