Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-3501

upstart provider fails with non-ASCII characters in job conf file with a non-UTF8 locale

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: PUP 3.7.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Ubuntu 14.04

    • Template:

      Description

      The default php5-fpm upstart job configuration file contains the line

      author "Ondřej Surý <ondrej@debian.org>"
      

      When I run puppet agent -t from the command line, everything works great, and as expected. When puppet does it's normal run, I get

      Error: /Stage[main]/Php::Fpm::Daemon/Service[php5-fpm]: Could not evaluate: invalid byte sequence in US-ASCII
      

      in the reports.

      If I unset the LANG environment variable then the run fails from the command line as well, with the same error (making nice traces possible):

      Error: /Stage[main]/Php::Fpm::Daemon/Service[php5-fpm]: Could not evaluate: invalid byte sequence in US-ASCII
      /usr/lib/ruby/vendor_ruby/puppet/provider/service/upstart.rb:212:in `match'
      /usr/lib/ruby/vendor_ruby/puppet/provider/service/upstart.rb:212:in `match'
      /usr/lib/ruby/vendor_ruby/puppet/provider/service/upstart.rb:212:in `block in enabled_post_0_9_0?'
      /usr/lib/ruby/vendor_ruby/puppet/provider/service/upstart.rb:211:in `each_line'
      /usr/lib/ruby/vendor_ruby/puppet/provider/service/upstart.rb:211:in `enabled_post_0_9_0?'
      /usr/lib/ruby/vendor_ruby/puppet/provider/service/upstart.rb:109:in `enabled?'
      /usr/lib/ruby/vendor_ruby/puppet/type/service.rb:64:in `retrieve'
      /usr/lib/ruby/vendor_ruby/puppet/type.rb:1058:in `block in retrieve'
      /usr/lib/ruby/vendor_ruby/puppet/type.rb:1053:in `each'
      /usr/lib/ruby/vendor_ruby/puppet/type.rb:1053:in `retrieve'
      /usr/lib/ruby/vendor_ruby/puppet/type.rb:1076:in `retrieve_resource'
      /usr/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:236:in `from_resource'
      /usr/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:19:in `evaluate'
      /usr/lib/ruby/vendor_ruby/puppet/transaction.rb:204:in `apply'
      /usr/lib/ruby/vendor_ruby/puppet/transaction.rb:217:in `eval_resource'
      /usr/lib/ruby/vendor_ruby/puppet/transaction.rb:147:in `call'
      /usr/lib/ruby/vendor_ruby/puppet/transaction.rb:147:in `block (2 levels) in evaluate'
      /usr/lib/ruby/vendor_ruby/puppet/util.rb:327:in `block in thinmark'
      /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
      /usr/lib/ruby/vendor_ruby/puppet/util.rb:326:in `thinmark'
      /usr/lib/ruby/vendor_ruby/puppet/transaction.rb:147:in `block in evaluate'
      /usr/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
      /usr/lib/ruby/vendor_ruby/puppet/transaction.rb:138:in `evaluate'
      /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:169:in `block in apply'
      /usr/lib/ruby/vendor_ruby/puppet/util/log.rb:149:in `with_destination'
      /usr/lib/ruby/vendor_ruby/puppet/transaction/report.rb:112:in `as_logging_destination'
      /usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:168:in `apply'
      /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:118:in `block in apply_catalog'
      /usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `block in benchmark'
      /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
      /usr/lib/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
      /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:117:in `apply_catalog'
      /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:222:in `run_internal'
      /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:132:in `block in run'
      /usr/lib/ruby/vendor_ruby/puppet/context.rb:64:in `override'
      /usr/lib/ruby/vendor_ruby/puppet.rb:244:in `override'
      /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:131:in `run'
      /usr/lib/ruby/vendor_ruby/puppet/agent.rb:47:in `block (4 levels) in run'
      /usr/lib/ruby/vendor_ruby/puppet/agent/locker.rb:20:in `lock'
      /usr/lib/ruby/vendor_ruby/puppet/agent.rb:47:in `block (3 levels) in run'
      /usr/lib/ruby/vendor_ruby/puppet/agent.rb:117:in `with_client'
      /usr/lib/ruby/vendor_ruby/puppet/agent.rb:44:in `block (2 levels) in run'
      /usr/lib/ruby/vendor_ruby/puppet/agent.rb:82:in `run_in_fork'
      /usr/lib/ruby/vendor_ruby/puppet/agent.rb:43:in `block in run'
      /usr/lib/ruby/vendor_ruby/puppet/application.rb:179:in `call'
      /usr/lib/ruby/vendor_ruby/puppet/application.rb:179:in `controlled_run'
      /usr/lib/ruby/vendor_ruby/puppet/agent.rb:41:in `run'
      /usr/lib/ruby/vendor_ruby/puppet/application/agent.rb:356:in `onetime'
      /usr/lib/ruby/vendor_ruby/puppet/application/agent.rb:322:in `run_command'
      /usr/lib/ruby/vendor_ruby/puppet/application.rb:384:in `block (2 levels) in run'
      /usr/lib/ruby/vendor_ruby/puppet/application.rb:510:in `plugin_hook'
      /usr/lib/ruby/vendor_ruby/puppet/application.rb:384:in `block in run'
      /usr/lib/ruby/vendor_ruby/puppet/util.rb:488:in `exit_on_fail'
      /usr/lib/ruby/vendor_ruby/puppet/application.rb:384:in `run'
      /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:146:in `run'
      /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:92:in `execute'
      /usr/bin/puppet:8:in `<main>'
      

      Removing the UTF-8 characters from the configuration file and running puppet agent -t --trace causes things to work as desired.

      Without LANG set, /sbin/status php5-fpm still works.

      /etc/default/locale sets LANG=en_US.UTF-8

      The bug can be worked around by setting the locale in /etc/environment, or by setting it in /etc/init.d/puppet.

        Attachments

          Issue Links

            Activity

            Hide
            pcfens Phil Fenstermacher added a comment -

            It also seems reasonable for this to be a non-puppet issue, similar to CHEF-3304

            Show
            pcfens Phil Fenstermacher added a comment - It also seems reasonable for this to be a non-puppet issue, similar to CHEF-3304
            Hide
            mbrodala Mathias Brodala added a comment -

            Here's the locale output for the root user on a regular Ubuntu Trusty VM image:

            LANG=
            LANGUAGE=
            LC_CTYPE="POSIX"
            LC_NUMERIC="POSIX"
            LC_TIME="POSIX"
            LC_COLLATE="POSIX"
            LC_MONETARY="POSIX"
            LC_MESSAGES="POSIX"
            LC_PAPER="POSIX"
            LC_NAME="POSIX"
            LC_ADDRESS="POSIX"
            LC_TELEPHONE="POSIX"
            LC_MEASUREMENT="POSIX"
            LC_IDENTIFICATION="POSIX"
            LC_ALL=

            Does this means that I have to enforce LANG=en_US.UTF-8 via /etc/environment on all of our machines? It does fix the issue but I'm not sure if this is the way to go.

            Show
            mbrodala Mathias Brodala added a comment - Here's the locale output for the root user on a regular Ubuntu Trusty VM image: LANG= LANGUAGE= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL= Does this means that I have to enforce LANG=en_US.UTF-8 via /etc/environment on all of our machines? It does fix the issue but I'm not sure if this is the way to go.
            Hide
            Yamakasy Yama added a comment - - edited

            I'm facing the same issue on Ubuntu 14.04

            LANG=en_US.UTF-8 via /etc/environment does fix this for me after restarting puppet.

            But why not set it in the puppet init file ?

            Show
            Yamakasy Yama added a comment - - edited I'm facing the same issue on Ubuntu 14.04 LANG=en_US.UTF-8 via /etc/environment does fix this for me after restarting puppet. But why not set it in the puppet init file ?
            Hide
            Yamakasy Yama added a comment -

            OK, It seem that /etc/environment doesn't work then the system has rebooted. You need to manually restart puppet again to get it working.

            I think the only option is the puppet init script.

            Show
            Yamakasy Yama added a comment - OK, It seem that /etc/environment doesn't work then the system has rebooted. You need to manually restart puppet again to get it working. I think the only option is the puppet init script.
            Hide
            Yamakasy Yama added a comment -

            OK, I need to update this again.

            When I set this in my /etc/init.d/puppet and reboot the machine it doesn't work also. Restarting the puppet service makes it work again.

            Show
            Yamakasy Yama added a comment - OK, I need to update this again. When I set this in my /etc/init.d/puppet and reboot the machine it doesn't work also. Restarting the puppet service makes it work again.
            Hide
            larsen Larsen added a comment -

            Duplicate of PUP-1055?

            Show
            larsen Larsen added a comment - Duplicate of PUP-1055 ?
            Hide
            josh Josh Cooper added a comment -

            Thank you for reporting this. We believe this issue has already been reported in another ticket. Please see the linked duplicate issue.

            Show
            josh Josh Cooper added a comment - Thank you for reporting this. We believe this issue has already been reported in another ticket. Please see the linked duplicate issue.

              People

              • Assignee:
                Unassigned
                Reporter:
                pcfens Phil Fenstermacher
              • Votes:
                3 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support