Host Config Management Report in Red Hat Satellite 6.2 returns "Error 400 on SERVER: Could not find a directory environment named 'Production' anywhere in the path: /etc/puppet/environments. Does the directory exist?" error.

Solution In Progress - Updated -

Environment

  • Red Hat Satellite 6.2

Issue

  • Opening Host Config Management Report page in Red Hat Satellite 6.2 returns the below error.
  • puppet agent -t from Capsule server shows the below error.
`Error 400 on SERVER: Could not find a directory environment named 'Production' anywhere in the path: /etc/puppet/environments. Does the directory exist?` 

Resolution

  • Follow the below steps to change the puppet environment name as production.
"Configure" --> "Environments" --> Click on "Production" --> Go to "Primary" tab --> Change the name from "Production" to "production" and click "Submit".

Root Cause

  • Environment of the YAML facts of Capsule shows environment as Production but the environment directory of puppet is created as production, under /etc/puppet/environments.
[root@capsule ~]# ls -lrt /etc/puppet/environments
total 0
drwxr-xr-x 4 root root 61 Feb 21 16:13 example_env
drwxr-xr-x 2 root root  6 Feb 21 16:14 production
[root@capsule ~]# /etc/puppet/node.rb capsule.example.com
---
classes: {}
parameters:
  puppetmaster: capsule.example.com
  domainname: example.com
  location: INDIA
  organization: REDHAT
  root_pw:
  puppet_ca: capsule.example.com
  foreman_env: Production     <--- It should be "production", as in "/etc/puppet/environments".
  owner_name: Admin User
  /*
  . . (omitted few lines) . . 
  */
  lifecycle_environment: Library
  content_view: Rhel_repository
  kickstart_repository:
environment: Production    <-- It should be "production", as in "/etc/puppet/environments".

Diagnostic Steps

  • Ensure that the directory name of puppet environment created under "/etc/puppet/environments" matches with the environment of the YAML facts of Capsule.
[root@capsule ~]# ls -lrt /etc/puppet/environments
total 0
drwxr-xr-x 4 root root 61 Feb 21 16:13 example_env
drwxr-xr-x 2 root root  6 Feb 21 16:14 production
[root@capsule ~]# /etc/puppet/node.rb capsule.example.com
---
classes: {}
parameters:
  puppetmaster: capsule.example.com
  domainname: example.com
  location: INDIA
  organization: REDHAT
  root_pw:
  puppet_ca: capsule.example.com
  foreman_env: Production     <--- It should be "production", as in "/etc/puppet/environments".
  owner_name: Admin User
  /*
  . . (omitted few lines) . . 
  */
  lifecycle_environment: Library
  content_view: Rhel_repository
  kickstart_repository:
environment: Production    <-- It should be "production", as in "/etc/puppet/environments".

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.

Comments