chrisroberts / vagabond

Advocating idleness and work-shyness
Other
233 stars 25 forks source link

invalid byte sequence in US-ASCII #24

Closed retr0h closed 10 years ago

retr0h commented 11 years ago

I get the following when running vagabond server up. This works perfectly fine on my co-workers 13.04 system. The ubuntu_1204 container was created by vagabond.

$ bundle exec vagabond server up 
Vagabond: Creating server
  -> Chef Server container created!
  -> Chef Server CREATED!
  -> Bootstrapping erchef...
Vagabond exiting. Reason: Expected process to exit with [0], but received '100'
---- Begin output of sudo knife bootstrap 10.0.3.171 --template-file /home/jdewey/git/openstack-chef-repo/.bundle/bundler/gems/vagabond-1c8691e1db27/lib/vagabond/bootstraps/server.erb -i /opt/hw-lxc-config/id_rsa ----
STDOUT: /home/jdewey/.chef
Bootstrapping Chef on 10.0.3.171
STDERR: writing RSA key
writing RSA key
ERROR: ArgumentError: invalid byte sequence in US-ASCII
---- End output of sudo knife bootstrap 10.0.3.171 --template-file /home/jdewey/git/openstack-chef-repo/.bundle/bundler/gems/vagabond-1c8691e1db27/lib/vagabond/bootstraps/server.erb -i /opt/hw-lxc-config/id_rsa ----
Ran sudo knife bootstrap 10.0.3.171 --template-file /home/jdewey/git/openstack-chef-repo/.bundle/bundler/gems/vagabond-1c8691e1db27/lib/vagabond/bootstraps/server.erb -i /opt/hw-lxc-config/id_rsa returned 100

When running the command manually, it works.

$ sudo knife bootstrap 10.0.3.171 --template-file /home/jdewey/git/openstack-chef-repo/.bundle/bundler/gems/vagabond-1c8691e1db27/lib/vagabond/bootstraps/server.erb -i /opt/hw-lxc-config/id_rsa
/home/jdewey/.chef
Bootstrapping Chef on 10.0.3.171
writing RSA key
writing RSA key
10.0.3.171 Reading package lists...
10.0.3.171 
10.0.3.171 Building dependency tree...
10.0.3.171 
10.0.3.171 Reading state information...
10.0.3.171 
10.0.3.171 The following NEW packages will be installed:
10.0.3.171   wget
10.0.3.171 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
10.0.3.171 Need to get 277 kB of archives.
10.0.3.171 After this operation, 614 kB of additional disk space will be used.
10.0.3.171 Get:1 http://archive.ubuntu.com/ubuntu/ precise/main wget amd64 1.13.4-2ubuntu1 [277 kB]
10.0.3.171 Fetched 277 kB in 0s (0 B/s)
...

Running ruby 1.9.3 on ubuntu 12.10.

$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.10
Release:    12.10
Codename:   quantal
jaypipes commented 11 years ago

Chris, retr0h's coworker is me... :)

chrisroberts commented 11 years ago

Hi! I'm guessing it's probably a locale issue since it seems to be taunting me everywhere else :P

What's the locale on your machine look like currently? Do you get the same output from locale when running it directly from your user and when you sudo locale ? I'll still throw in a bit to force utf-8 but I'm curious if an env adjustment would be enough as well.

retr0h commented 11 years ago

Seems to be the same ...

$ locale
LANG=en_US.UTF-8
LANGUAGE=
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=

$ sudo locale
[sudo] password for jdewey: 
LANG=en_US.UTF-8
LANGUAGE=
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=
chrisroberts commented 11 years ago

@retr0h i threw in bunch of encoding bits on the files. want to give them a shot and see if it clears up?

chrisroberts commented 11 years ago

@retr0h any luck running against updates in the develop branch?

chrisroberts commented 11 years ago

If the problem resurfaces, please reopen this ticket.

Thanks!

retr0h commented 11 years ago

Sorry Chris -

Was held up lately. I'll dig into this.

retr0h commented 11 years ago

Hi Chris -

I built a gem from the develop branch, and am running into the same problem...

emopop:cookbook-infra-db(master)% vagabond server up       
[sudo] password for jdewey: 
ERROR: Node already exists and is running: server
Vagabond: Starting node: server
  -> STARTED
  -> Bootstrapping erchef...
Vagabond exiting. Reason: Expected process to exit with [0], but received '100'
---- Begin output of sudo knife bootstrap 10.0.3.171 --template-file /home/jdewey/.rvm/gems/ruby-1.9.3-p362/bundler/gems/vagabond-211e9e11dc81/lib/vagabond/bootstraps/server.erb -i /opt/hw-lxc-config/id_rsa ----
STDOUT: /home/jdewey/.chef
Bootstrapping Chef on 10.0.3.171
STDERR: writing RSA key
writing RSA key
ERROR: ArgumentError: invalid byte sequence in US-ASCII
chrisroberts commented 11 years ago

@retr0h no worries, and thanks for giving this a go again. I'm going to try and mess with a test node and see if I can't replicate the behavior. It looks to be an issue isolated to mixlib::shellout, sudo, and knife. It might be solved just by forcing some env vars along with it so I'll take a crack at that and see what I come up with.

chrisroberts commented 10 years ago

I believe the latest release should have this issue resolved