Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-5873

system ruby binary present breaks facter_task

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      On a system where ruby is installed:

      root@agent1  ~  which -a ruby
      /usr/local/bin/ruby
      root@agent1 ~  /usr/local/bin/ruby --version
      ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
      

      ..and the binary comes before puppet's in the system $PATH:

      root@agent1 ~  echo $PATH
      /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/puppetlabs/bin
      

      Running the facter_task in the console produces:

      {
        "_error" : {
          "msg" : "Task exited 1:\n/opt/puppetlabs/puppet/lib/ruby/2.4.0/open3.rb:199:in `spawn': No such file or directory - facter (Errno::ENOENT)\n\tfrom /opt/puppetlabs/puppet/lib/ruby/2.4.0/open3.rb:199:in `popen_run'\n\tfrom /opt/puppetlabs/puppet/lib/ruby/2.4.0/open3.rb:95:in `popen3'\n\tfrom /opt/puppetlabs/puppet/lib/ruby/2.4.0/open3.rb:258:in `capture3'\n\tfrom /opt/puppetlabs/pxp-agent/tasks-cache/4b19b7e0729b983fd1dbf85af34fcef9022bc5924ec816996c1e51f36903b31a/init.rb:9:in `get'\n\tfrom /opt/puppetlabs/pxp-agent/tasks-cache/4b19b7e0729b983fd1dbf85af34fcef9022bc5924ec816996c1e51f36903b31a/init.rb:18:in `<main>'\n",
          "kind" : "puppetlabs.tasks/task-error",
          "details" : {
            "exit_code" : 1
          }
        },
        "_output" : ""
      }
      

      I can workaround this by setting the pxp-agent service's PATH in /etc/sysconfig/pxp-agent:

      PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/puppetlabs/bin:/usr/local/bin
      

      (putting /usr/local/bin further up)

        Attachments

          Activity

            People

            • Assignee:
              william.meek William Meek
              Reporter:
              erik.hansen Erik Hansen
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support