Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'invalid byte sequence in US-ASCII' error (php-fpm::install.rb) #58

Open
Rocklviv opened this issue Oct 17, 2014 · 6 comments
Open

'invalid byte sequence in US-ASCII' error (php-fpm::install.rb) #58

Rocklviv opened this issue Oct 17, 2014 · 6 comments

Comments

@Rocklviv
Copy link

When i'm trying to install php-fpm on Ubuntu 14.04 i get this error.
Using Bento Ubuntu-14.04 box.

* package[php5-fpm] action upgrade[2014-10-17T13:42:13+00:00] INFO: Processing package[php5-fpm] action upgrade (php-fpm::install line 33)       
       [2014-10-17T13:42:33+00:00] INFO: package[php5-fpm] upgraded from uninstalled to 5.5.9+dfsg-1ubuntu4.4
         - upgrade package php5-fpm from uninstalled to 5.5.9+dfsg-1ubuntu4.4
 * service[php-fpm] action enable[2014-10-17T13:42:33+00:00] INFO: Processing service[php-fpm] action enable (php-fpm::install line 48)
 =============================================================================   Error executing action `enable` on resource 'service[php-fpm]'       
 ============================================================================   
    ArgumentError       
    -------------       
    invalid byte sequence in US-ASCII       

           Resource Declaration:

           ---------------------
           # In /tmp/kitchen/cookbooks/php-fpm/recipes/install.rb

            48: service "php-fpm" do
            49:   provider service_provider if service_provider
            50:   service_name php_fpm_service_name
            51:   supports :start => true, :stop => true, :restart => true, :reload => true
            52:   action [ :enable, :start ]
            53: end

           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cookbooks/php-fpm/recipes/install.rb:48:in `from_file'

           service("php-fpm") do
             provider Chef::Provider::Service::Upstart
             action [:enable, :start]
             supports {:start=>true, :stop=>true, :restart=>true, :reload=>true}
             retries 0
             retry_delay 2
             guard_interpreter :default
             service_name "php5-fpm"
             pattern "php-fpm"

             cookbook_name :"php-fpm"
             recipe_name "install"
           end
@stissot
Copy link

stissot commented Oct 25, 2014

I have the same error on Ubuntu 14.04 but only when chef-client is run by init.d

[2014-10-25T12:15:19+02:00] ERROR: service[php-fpm] (php-fpm::install line 48) had an error: ArgumentError: invalid byte sequence in US-ASCII [2014-10-25T12:15:19+02:00] ERROR: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

@alambike
Copy link

alambike commented Dec 3, 2014

Same here (Ubuntu 14.04, chef 11.16.4)

    Error executing action `enable` on resource 'service[php-fpm]'
    ================================================================================

    ArgumentError
    -------------
    invalid byte sequence in US-ASCII

    Resource Declaration:
    ---------------------
    # In /mnt/cookbooks/supermarket/php-fpm/recipes/install.rb

     51: service "php-fpm" do
     52:   provider service_provider if service_provider
     53:   service_name php_fpm_service_name
     54:   supports :start => true, :stop => true, :restart => true, :reload => true
     55:   action [ :enable, :start ]
     56: end

    Compiled Resource:
    ------------------
    # Declared in /mnt/cookbooks/supermarket/php-fpm/recipes/install.rb:51:in `from_file'

    service("php-fpm") do
      provider Chef::Provider::Service::Upstart
      action [:enable, :start]
      supports {:start=>true, :stop=>true, :restart=>true, :reload=>true}
      retries 0
      retry_delay 2
      guard_interpreter :default
      service_name "php5-fpm"
      pattern "php-fpm"
      cookbook_name :"php-fpm"
      recipe_name "install"
    end

@alambike
Copy link

alambike commented Dec 4, 2014

Solved, locales wasn't configured in my system.
Including "locale::default" recipe in my run list, and seting LANG and LC_ALL in my base recipe fix the issue.

include_recipe "locale::default"

# set env vars
ENV["LANG"] = node["locale"]["lang"]
ENV["LC_ALL"] = node["locale"]["lang"]

@stissot
Copy link

stissot commented Jan 2, 2015

@alambike: I tried your suggestion to set the LANG and LC_ALL at the begin of the default recipe on my Ubuntu 14.04 with Chef 11.16.4 but still have the same invalid byte sequence error on chef-run.

[2015-01-02T12:09:42+01:00] ERROR: Running exception handlers
[2015-01-02T12:09:42+01:00] ERROR: Exception handlers complete
[2015-01-02T12:09:42+01:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2015-01-02T12:09:42+01:00] INFO: Sending resource update report (run-id: adc8924f-1416-4dc9-852c-1283af1eb39a)
[2015-01-02T12:09:42+01:00] ERROR: service[php-fpm] (php-fpm::install line 51) had an error: ArgumentError: invalid byte sequence in US-ASCII
[2015-01-02T12:09:42+01:00] ERROR: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[2015-01-02T12:09:42+01:00] ERROR: Sleeping for 14400 seconds before trying again

@alambike
Copy link

alambike commented Jan 2, 2015

@stisot are you using locale cookbook too?

I'm doing it in my base recipe and works ok

https://github.com/RIYIC/riyic/blob/master/recipes/_configure_locale.rb

@iiro
Copy link

iiro commented Jan 6, 2015

For me this helped too.

A manual run fixed the locale - and after that I restarted the chef-client in the background so it will get new locale settings.

Thanks everyone.

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

No branches or pull requests

4 participants