yevgenko / cookbook-php-fpm

Installs/Configures php-fpm
http://community.opscode.com/cookbooks/php-fpm
Apache License 2.0
68 stars 117 forks source link

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

Open Rocklviv opened 10 years ago

Rocklviv commented 10 years ago

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 commented 10 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

@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 commented 9 years ago

@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 commented 9 years ago

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.