Red Hat Satellite Installation or upgrade fails with the exception (Puppet::Error: Cannot determine basic system flavour)

Solution Verified - Updated

Environment

  • Red Hat Satellite/Capsule 6.x
  • puppet 4 and above

Issue

  • Installing or upgrading Red Hat Satellite server fails with the below error:

    Sep 20 15:42:06 satellite65.sysmgmt.lan systemd[1]: Starting puppetserver Service...
    Sep 20 15:42:27 satellite65.sysmgmt.lan puppetserver[13270]: Failed to load feature test for posix: can't find user for 0
    Sep 20 15:42:27 satellite65.sysmgmt.lan puppetserver[13270]: Cannot run on Microsoft Windows without the win32-process, win32-dir and win32-service gems: Win32API only supported on win32
    Sep 20 15:42:27 satellite65.sysmgmt.lan puppetserver[13270]: Puppet::Error: Cannot determine basic system flavour
    Sep 20 15:42:27 satellite65.sysmgmt.lan puppetserver[13270]: (root) at /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/feature/base.rb:40
    Sep 20 15:42:27 satellite65.sysmgmt.lan puppetserver[13270]: require at org/jruby/RubyKernel.java:1040
    
  • puppet service fails to start :

       [root@satellite ~]# systemctl start puppetserver.service -l
       Job for puppetserver.service failed because the control process exited with error code. See "systemctl status puppetserver.service" and "journalctl -xe" for 
       details.
       [root@satellite ~]# systemctl status puppetserver.service -l
       ● puppetserver.service - puppetserver Service
          Loaded: loaded (/usr/lib/systemd/system/puppetserver.service; disabled; vendor preset: disabled)
          Active: activating (start) since Fri 2018-03-02 18:27:50 IST; 7s ago
         Control: 13622 (bash)
          CGroup: /system.slice/puppetserver.service
                  ├─13622 bash /opt/puppetlabs/server/apps/puppetserver/cli/apps/start
                  ├─13629 /usr/bin/java -Xms2g -Xmx2g -XX:MaxPermSize=256m -Djava.security.egd=/dev/urandom -XX:OnOutOfMemoryError=kill -9 %p -cp 
       /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar clojure.main -m puppetlabs.trapperkeeper.main --config 
       /etc/puppetlabs/puppetserver/conf.d --bootstrap-config 
       /etc/puppetlabs/puppetserver/services.d/,/opt/puppetlabs/server/apps/puppetserver/config/services.d/ --restart-file 
       /opt/puppetlabs/server/data/puppetserver/restartcounter
                  └─13660 sleep 1
    
       Mar 02 18:27:50 satellite.redhat.com systemd[1]: Starting puppetserver Service...
       Mar 02 18:27:50 satellite.redhat.com puppetserver[13622]: OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
    

For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.

Resolution

  • Assign executable permission to /tmp

  • As per the US government standards or DISA, "/tmp" should be used with "noexec" permission. However, Puppet Server 4.x or above version will not function if, "noexec" bit is set on the temporary mount point that Java uses.

  • Following modifications need to be performed to use any other mount point that has "exec" bit set, which can then be used as a temporary mount point for Java -

       # vim /etc/sysconfig/puppetserver
    
  • Add the following line in the above file and save the file:
    JAVA_ARGS="-Xms2G -Xmx2G -XX:MaxPermSize=256m -Djava.io.tmpdir=/var/tmp" ----> In this example, the mount point has been set to "/var/tmp"

     # systemctl restart puppetserver
     # systemctl status puppetserver ----> Ensure that the service is running
     # ps -ef | grep java.io.tmpdir | grep puppetlabs  ----> Ensure that new "tmp" partition is in effect
    
  • Refer below step in case the above step does not resolve the issue:

     # vim  /etc/foreman-installer/custom-hiera.yaml
    
  • Adding below line in the above file can also be used as a workaround for this issue:
    puppet::server_jvm_extra_args: '-XX:MaxPermSize=256m -Djava.io.tmpdir=/custom/dir/location'

Note:

  1. Either way, you’ll need to set the permissions of the directory to 1777. This allows the Puppet Server JRuby process to write a file to '/tmp' and then execute it. If permissions are set incorrectly, you’ll get a massive stack trace without much useful information in it.

  2. The changes in /etc/sysconfig/puppetserver file might get overwritten with Satellite upgrade. Hence it is recommended to make changes in /etc/foreman-installer/custom-hiera.yaml file.

  3. In Java 17 (Satellite/Capsule 6.16+), the option '-XX:MaxPermSize=256m' is not valid (Unrecognized VM option 'MaxPermSize=256m'), then remove it from the recommendation.

Root Cause

  • If /tmp is mounted with the option noexec, puppetserver assumes that it is running on a Windows server, because it cannot determine the basic system flavour.

Diagnostic Steps

  • Check permission on /tmp

  • Following error is observed in /var/log/message:

     satellite puppetserver: Caused by: org.jruby.exceptions.RaiseException: (Error) Cannot 
      determine basic system flavour
    
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.