Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Encoding::InvalidByteSequenceError #56

Open
mgsaranraj87 opened this issue Jul 24, 2018 · 2 comments
Open

Encoding::InvalidByteSequenceError #56

mgsaranraj87 opened this issue Jul 24, 2018 · 2 comments

Comments

@mgsaranraj87
Copy link

Hi Team,
I'm not a ruby program and I feel cvmanager will solve most of my requirement.
I'm sure this issue has reported in GitHub for different scenarios. I'm trying to use cvmanager for Redhat satellite 6 and Foreman. I'm getting the below error while running the script.

Can you please help me to fix the issue.

ruby cvmanager --wait publish --verbose
/usr/share/gems/gems/json-1.7.7/lib/json/common.rb:155:in encode': "\xE2" on US-ASCII (Encoding::InvalidByteSequenceError) from /usr/share/gems/gems/json-1.7.7/lib/json/common.rb:155:in initialize'
from /usr/share/gems/gems/json-1.7.7/lib/json/common.rb:155:in new' from /usr/share/gems/gems/json-1.7.7/lib/json/common.rb:155:in parse'
from /usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:129:in load_apidoc' from /usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:138:in apidoc'
from /usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/resource.rb:8:in initialize' from /usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:151:in new'
from /usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:151:in resource' from cvmanager:375:in publish'
from cvmanager:541:in `

'

@Rocco83
Copy link
Contributor

Rocco83 commented Aug 1, 2018

Hi,

What if you run
file cvmanager
?
What about the same to your config file?
Can you post also your config (please cleanup password and sensitive information from it)

Seems to me an issue with the encoding of one of this files.

@edtepes
Copy link

edtepes commented Jan 7, 2020

I am having this same exact issue right now as well. It was working a few days ago and now I cannot call any ./cvmanager --config=...etc... commands at all. Same exact error message as the original poster of this issue.

file cvmanager returns:
cvmanager: Ruby script, ASCII text

file publish.yml returns:
publish.yml: ASCII text

my cvmanager.yaml cv looks like

---
:settings:
  :user: admin
  :pass: **************
  :uri: https://servername.com
  :timeout: 300
  :org: 1
  :lifecycle: 1
  :keep: 3
:cv:

:ccv:

and for another example my nonprod_rhel5.yaml looks like:

---
:settings:
  :user: admin
  :pass: ************
  :uri: https://servername.com
  :timeout: 300
  :org: 1
  :lifecycle: 5
  :keep: 1
  :promote_cvs: true
  :checkrepos: false
:cv:
  RHEL_5: latest
:promote:
  - RHEL_5

I had a python script calling these cvmanager commands by calling the subprocess module like this:

if instruction == "clean":
                proc = subprocess.Popen(['./cvmanager', 'clean', '--keep', '3'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)

This worked on Friday, now its Monday and when I went to check that my Content Views were updated over the weekend, nothing had happened. and during even the most basic testing I began to get these errors.

EDIT:
Fixed the issue by running the following two lines in bash. I found them in a github issue from another product about a similar error message as mine. Any idea why these would need setting all of a sudden?
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants