Uploaded image for project: 'Puppet Server'
  1. Puppet Server
  2. SERVER-262

`puppetserver gem env` does not work, useful for troubleshooting


    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: SERVER 1.0.0
    • Fix Version/s: SERVER 1.0.2
    • Component/s: Puppet Server
    • Labels:
    • Template:
    • Sub-team:
    • Story Points:
    • Sprint:
      SERVER 2014/12/31, Server 2015-01-21, Server 2015-02-04


      Working with puppet server 1.0.0 from packages on EL 7 I noticed the following error:

      [vagrant@localhost ~]$ puppetserver gem env
      ERROR:  While executing gem ... (NoMethodError)
          undefined method `split' for nil:NilClass

      This error also happens in my local development environment where:

      lein gem --config ~/.puppet-server/puppet-server.conf env
      ERROR:  While executing gem ... (NoMethodError)
          undefined method `split' for nil:NilClass
      lein gem --config ~/.puppet-server/puppet-server.conf env  18.59s user 0.78s system 174% cpu 11.132 total

      The use case is that I'm trying to debug some behaviors in server/master.rb and as part of that effort I'd like to insert a pry debugger into the first line. For pry to work, I need to make sure the gem is installed in a location available to puppet server, which led me to use puppetserver gem ... and the dev equivalent of lein gem --config ~/.puppet-server/puppet-server.conf ....

      The gem command is a very helpful troubleshooting and debugging tool from an end-user perspective because it provides authoritative and comprehensive information about PATH, LOAD_PATH, GEM_PATH, GEM_HOME, etc...

      For example, I'd expect something like this output:

      gem env
      RubyGems Environment:
        - RUBYGEMS VERSION: 2.2.2
        - RUBY VERSION: 2.1.4 (2014-10-27 patchlevel 265) [x86_64-darwin13.0]
        - INSTALLATION DIRECTORY: /opt/crossfader/versions/ruby/2.1.4/gemsets/clojure/ruby/2.1.0
        - RUBY EXECUTABLE: /opt/crossfader/versions/ruby/2.1.4/bin/ruby
        - EXECUTABLE DIRECTORY: /opt/crossfader/versions/ruby/2.1.4/gemsets/clojure/ruby/2.1.0/bin
        - SPEC CACHE DIRECTORY: /Users/jeff/.gem/specs
          - ruby
          - x86_64-darwin-13
        - GEM PATHS:
           - /opt/crossfader/versions/ruby/2.1.4/gemsets/clojure/ruby/2.1.0
           - /opt/crossfader/versions/ruby/2.1.4/gemsets/global/ruby/2.1.0
           - /opt/crossfader/versions/ruby/2.1.4/lib/ruby/gems/2.1.0
           - /Users/jeff/.gem/ruby/2.1.0
           - :update_sources => true
           - :verbose => true
           - :backtrace => false
           - :bulk_threshold => 1000
           - https://rubygems.org/
        - SHELL PATH:
           - /opt/crossfader/bin
           - /opt/crossfader/versions/ruby/2.1.4/gemsets/clojure/ruby/2.1.0/bin
           - /opt/crossfader/versions/ruby/2.1.4/gemsets/global/ruby/2.1.0/bin
           - /opt/crossfader/versions/ruby/2.1.4/bin
           - /opt/crossfader/versions/lein/2.5.0/bin
           - /opt/crossfader/versions/jdk/1.7.0_71/bin
           - /usr/local/bin
           - /usr/bin
           - /bin
           - /usr/sbin
           - /sbin

      UPDATE: A fix for this was implemented for SERVER 1.0.2. The fix introduced a new behavior around the handling of the GEM_PATH environment variable which led to a separate PR being done - covered by SERVER-522 - to revert this fix as part of the SERVER 1.0.3 release. In short, the GEM_PATH environment variable had started allowing an external environment value to flow through to the JRuby environment in the "puppetserver gem" process. Concerns by some about the user experience with this led to the later revert. Work to restore the "puppetserver gem env" command to working order and clarifying the overall behavior with respect to environment variable handling should be done as part of SERVER-297.


          Issue Links



              • Assignee:
                erik Erik Dasher
                jeff Jeff McCune
                QA Contact:
                Erik Dasher
              • Votes:
                0 Vote for this issue
                6 Start watching this issue


                • Created:

                  Zendesk Support