- How to provide enough info to get help?
- rake aborted!
- Unable to save: failed to detect boot server: getaddrinfo: Name or service not known
- I use puppet enterprise, what now?
- error: Entry 'some file' not uptodate. Cannot merge.
- Strange errors with passenger
- error: Could not send facts to Foreman: wrong Content-Length format (RuntimeError)
- Is my Foreman instance running?
- How do I enable debugging?
- Unattended Provisioning Troubleshooting
- Puppet and Storeconfigs: err: Could not retrieve catalog from remote server: Error 400 on SERVER: stack level too deep
- How do I fix this error: "Unable to find directory $confdir/environments/$environment/modules in environment master" ?
- Smart-proxy do not recognize my puppet environment
- How do I fix the puppet class import problem with multiple puppet environment ?
- Unable to connect to Hypervisor?
- Routing errors when running rake test?
- cannot load such file -- facter / puppet (LoadError)
- Causes of "Error 400 Bad Request", and other smart-proxy related errors in the Foreman interface:
- Using Webrick you get : Error 400 on SERVER: Could not find node '<node fqdn>'; cannot compile
- DHCP Provisioning Fails with: "dhcpctl_connect: not found"
- Foreman is showing : Error message: Could not find json-1.5.5 in any of the sources
- VNC console in the Foreman UI refuses to connect to my VM: Server Disconnected
How to provide enough info to get help?¶
Foreman is pretty complex software project with many components and extensive configuration. Always try to describe best your specific case (OS, version, ruby and foreman version, database, specific configuration). From Foreman version 1.2 you can use foreman-debug script which collects all these information and also filters out things like passwords or tokens. For earlier Foreman releases you can use this bash script directly from git: https://github.com/theforeman/foreman/blob/develop/script/foreman-debug
rake aborted!¶
I get the following error while running rake db:migrate
rake aborted! undefined method `reenable' for <Rake::Task db:schema:dump => [environment]>:Rake::Task
this means you have an old version of rake (older than 0.87), you can verify it by typing:
rake --version
Usually this error is "safe" to ignore, however, it is recommended to upgrade to rake >= 0.87
Unable to save: failed to detect boot server: getaddrinfo: Name or service not known¶
if you have registred your smart-proxys via name, and these name are not resolvable, you get this error, you can add the name to your dns server or set
:tftp_servername: in smart-proxy settings to the ip of the smart-proxy.
I use puppet enterprise, what now?¶
As of PE version 1.0, foreman won't install easily without a few modifications. Since PE ships with its own version of Ruby you will need to install a few gems.
Basically you need to tell foreman to use the PE provided ruby library instead. Your not required to run the puppet version of ruby either as many distros now ship with ruby 1.8.7.
- You first need to install the pe-ruby-devel package that ships with PE. You can find this in your packages folder wherever you extracted PE.
a. rpm -ivh pe-ruby-devel-1.8.7.302-1.el5.i386.rpm - Update your path variable to use the ruby version PE ships with (export PATH=/opt/puppet/bin:$PATH)
- Check to make sure your PATH was updated ("which gem" should return /opt/puppet/bin/gem)
- gem install json
- gem install rest-client
(install the gem database driver you use) - gem install sqlite3 or gem install mysql ( you may have additional dependencies that would need to be resolved first)
Some of the gem dependencies can be resolved by installing the development library for that package (example: mysql-devel)
I found it difficult to install the sqlite3 gem because of dependency hell so I just setup mysql instead which was far easier to setup. Additionally mysql is much more scalable than sqlite.
You can get a list of the currently installed gems by using: gem list.
If your running the foreman init script or /etc/sysconfig/foreman configuration file. You may need to update apache/passenger configurations that point to the PE ruby version.
error: Entry 'some file' not uptodate. Cannot merge.¶
If you downloaded Foreman from source (git), it could be that some of the files you have modified (or were modified automatically) conflicts with another file Foreman wants to upgrade.
If you don't think that you edited this file (e.g. db/schema.rb) it is usually safe to do:
git checkout 'some file'
This will revert the file to its previous condition (as in the repo at the time of checkout) and now you should be able to get the latest version by:
git pull
Strange errors with passenger¶
Passenger executes foreman, based on the owner of the config/environmnets.rb file, make sure that this use can actually access:- puppet configuration files
- sqlite database (if using sqlite)
- write to log, tmp directories
see source:extras/puppet/foreman for complete puppet based setup for Foreman.
error: Could not send facts to Foreman: wrong Content-Length format (RuntimeError)¶
You might see this error if you run the HTTP push facts script or the sample external nodes script.
This is most likely due to older version of the mongrel gem. Please try and update your gems.
gem update mongrel
Is my Foreman instance running?¶
There is simple status service that returns JSON with "result" message "ok" when the instance is up and running. It also "pings" database and returns lag. Example:
$ curl -k -H "Accept: application/json" http://instance:3000/status
{"status":200,"result":"ok","db_duration_ms":"5"}
How do I enable debugging?¶
Edit config/environments/production.rb and uncomment "config.log_level = :debug"
Unattended Provisioning Troubleshooting¶
Puppet and Storeconfigs: err: Could not retrieve catalog from remote server: Error 400 on SERVER: stack level too deep¶
Your activerecord Version is to new, you need activrecord 3.0.10 see http://projects.puppetlabs.com/issues/9290
gem uninstall activerecord gem install activerecord -v 3.0.10
How do I fix this error: "Unable to find directory $confdir/environments/$environment/modules in environment master" ?¶
If you've followed http://docs.puppetlabs.com/guides/environment.html#configuring-environments-on-the-puppet-master to
create a multi-environment puppet configuration, you're initial rake may look something like this:
rake puppet:import:puppet_classes RAILS_ENV=production (in /usr/share/foreman) Evaluating possible changes to your installation Problems were detected during the evaluation phase Unable to find directory $confdir/environments/$environment/modules in environment master Please fix these issues and try again
This is because Foreman does not currently evaluate $confdir. There is a feature request open on this issue. In the
meantime, hard code your $confdir in your puppet.conf.
Smart-proxy do not recognize my puppet environment¶
If I query smart-proxy and it return empty puppet environment :
curl -k -H "Content-Type:application/json" -H "Accept:application/json" http://puppet:8443/puppet/environments => []
You may have to add in your puppetmaster's puppet.conf environment definition like :
[production]
manifest = /etc/puppet/manifests/site.pp
modulepath = /etc/puppet/modules
fileserverconfig = /etc/puppet/fileserver.conf
templatedir=/etc/puppet/templates/
[preprod]
manifest = /etc/puppet/preprod/manifests/site.pp
modulepath = /etc/puppet/preprod/modules
fileserverconfig = /etc/puppet/preprod/fileserver.conf
templatedir=/etc/puppet/preprod/templates
[development]
manifest = /etc/puppet/development/manifests/site.pp
modulepath = /etc/puppet/development/modules
fileserverconfig = /etc/puppet/development/fileserver.conf
templatedir=/etc/puppet/development/templates/
[test]
manifest = /etc/puppet/test/manifests/site.pp
modulepath = /etc/puppet/test/modules
fileserverconfig = /etc/puppet/test/fileserver.conf
templatedir=/etc/puppet/test/templates/
How do I fix the puppet class import problem with multiple puppet environment ?¶
If Foreman don't seems to be aware of all your environment and is able to import only your "production" environment (see http://theforeman.org/issues/1159),
try to add ":puppet_conf: /etc/puppet/puppet.conf" in your settings.yaml.
Unable to connect to Hypervisor?¶
Make sure the user that's actually running foreman can connect to your remote hypervisor (for instance by running sudo -u foreman virsh -c qemu+ssh://root@<host>/session list).
If you are running foreman through phusion passenger, ps auxwwf | grep "R[a]ils: /usr/share/foreman" | awk '{ print $1 }' will give you the user that's running foreman. If you find that it's not being run by foreman, do the following:
cd ~foreman
chown foreman config/environment.rb
touch ~foreman/tmp/restart.txt
Routing errors when running rake test?¶
Edit the config/settings.yaml and set the :login: setting to true
cannot load such file -- facter / puppet (LoadError)¶
if you running foreman under RVM or custom ruby installation, you would need to get puppet installed as a gem (as puppet / facter packages are not in your ruby search path).
simply add another file to FOREMAN_DIR/bundler.d
echo "gem 'puppet'" > bundler.d/Gemfile.local.rb
Edit the config/settings.yaml and add: :puppetgem: true
Causes of "Error 400 Bad Request", and other smart-proxy related errors in the Foreman interface:¶
- Check the sudoers file on the proxy, if the user "foreman-proxy" can run "puppetca". The command puppetca is un-available in puppet 3.0. Workaround is to create a wrapper script.
- From the cmd line, check if the user can run "puppetca" and "nsupdate" properly.
- Check if Bind is listening on 127.0.0.1. The proxy connects to localhost only, so this is required.
- Check if the foreman-proxy user "foreman-proxy" can read the Bind rndc keys.
- In Ubuntu, you will have to tell apparmor to allow Bind to write to zone files and journals. If your zone files are in /etc/bind/zones/, add "/etc/bind/zones/** rw," to /etc/apparmor.d/usr.sbin.named.
- If using Ubuntu Libvirt, and the "Virtual Machine" tab is empty, then you most likely need to create a default storage pool:
cat /etc/libvirt/storage/default.xml <pool type='dir'> <name>default</name> <uuid>35e0bbce-4019-ca88-6dec-b1a0c1be774b</uuid> <capacity>0</capacity> <allocation>0</allocation> <available>0</available> <source> </source> <target> <path>/var/lib/libvirt/images</path> <permissions> <mode>0700</mode> <owner>-1</owner> <group>-1</group> </permissions> </target> </pool> - On Ubuntu Libvirt, you may have to change /etc/libvirt/libvirtd.conf to listen on TCP.
Using Webrick you get : Error 400 on SERVER: Could not find node '<node fqdn>'; cannot compile¶
If you are using Foreman with webrick and you get an error downloading your catalog, maybe you encouter the issue noted in bug #1507
Edit the node.rb script and replace the following :
<br />SETTINGS = {<br /> :url => "http://<node fqdn>:3000*/*",<br />
by this :
<br />SETTINGS = {<br /> :url => "http://<node fqdn>:3000",<br />
DHCP Provisioning Fails with: "dhcpctl_connect: not found"¶
Depending on the version of ISC DHCP you are using a wrong key will return "dhcpctl_connect: not found" , this misleads to a connection problem.
To solve basically check if your KEY NAME matches your proxy settings.yml and also matches on your dhcpd.conf
Foreman is showing : Error message: Could not find json-1.5.5 in any of the sources¶
If you have a problem after doing a yum update ruby bundler needs to re-run.
This could happen after an update or chane of ruby packages.
rm ~foreman/Gemfile.lock cd ~foreman bundle install --local
VNC console in the Foreman UI refuses to connect to my VM: Server Disconnected¶
Check what version of python you have installed - noVNC requires python2. If you have multiple python versions installed, you can edit `extras/noVNC/websockify.py` and change the shebang on line 1
