Support #7964
closedunable to import puppet class
Description
Hi,
I have puppet master and forman on saparate servers , i have added puppet master through smart proxy and now when i am trying to import classes from my production nvironment, i am getting the following error.
Oops, we're sorry but something went wrong
Warning!
undefined method `values' for []:Array
If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.
NoMethodError
undefined method `values' for []:Array
app/services/puppet_class_importer.rb:78:in `new_classes_for'
app/services/puppet_class_importer.rb:39:in `changes'
app/controllers/concerns/foreman/controller/environments.rb:11:in `import_environments'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'
Updated by Suyash Jain about 10 years ago
i an not able to import puppet envirment also.
the same error
Warning!
undefined method `values' for []:Array
Updated by Anonymous about 10 years ago
- Tracker changed from Bug to Support
- Priority changed from Urgent to Normal
Hello,
please have a look into the logfiles of the smart proxy on the Puppet master (/var/log/foreman-proxy/proxy.log). Any pointer, why no environments are found?
Updated by Justin Sherrill almost 10 years ago
Note, i saw this recently and the cause was that the smart proxy was returning a 404 because the puppet master was not configured to use environments. No idea if this was your cause, but my guess is that foreman is not handling most error states 404,500, etc..
Updated by Andrew Lau over 9 years ago
Did you find a solution for this issue? Just hit the same one trying to publish a content view in katello.
E, [2015-04-08T22:09:21.197116 #2562] ERROR -- : Not found
x.x.x.x - - [08/Apr/2015 22:09:21] "GET /puppet/environments/KT_example_Library_OS_2_x86_64_4/classes HTTP/1.1" 404 9 0.3203
Updated by Justin Sherrill over 9 years ago
Another cause of this is that the environment simply does not exist on the file system in /etc/puppet/environments/ (assuming that is where puppet is configured to look).
In the katello case, this can be because apache no longer has write access to /etc/puppet/environments (which is needed for pulp to create the puppet environment)