Troubleshooting

Version 27 (Igor Galić, 07/03/2012 05:22 am)

1 3 Ohad Levy
{{toc}}
2 3 Ohad Levy
3 1
h1. rake aborted!
4 1
5 1
I get the following error while running rake db:migrate
6 1
<pre>
7 1
rake aborted!
8 1
undefined method `reenable' for <Rake::Task db:schema:dump => [environment]>:Rake::Task
9 1
</pre>
10 1
11 1
this means you have an old version of rake (older than 0.87), you can verify it by typing:
12 1
<pre>
13 1
rake --version
14 1
</pre>
15 1
16 1
Usually this error is "safe" to ignore, however, it is recommended to upgrade to rake >= 0.87
17 2 Ohad Levy
18 10 Corey Osman
19 20 Florian Koch
h1. Unable to save: failed to detect boot server: getaddrinfo: Name or service not known
20 1
21 20 Florian Koch
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 
22 20 Florian Koch
:tftp_servername: in smart-proxy settings to the ip of the smart-proxy.
23 10 Corey Osman
24 7 Corey Osman
h1. I use puppet enterprise, what now?
25 7 Corey Osman
26 7 Corey Osman
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.
27 12 Corey Osman
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.
28 7 Corey Osman
29 8 Ohad Levy
# 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.
30 1
      a. rpm -ivh pe-ruby-devel-1.8.7.302-1.el5.i386.rpm 
31 8 Ohad Levy
# Update your path variable to use the ruby version PE ships with (export PATH=/opt/puppet/bin:$PATH)
32 8 Ohad Levy
# Check to make sure your PATH was updated ("which gem" should return /opt/puppet/bin/gem)
33 8 Ohad Levy
# gem install json
34 8 Ohad Levy
# gem install rest-client
35 7 Corey Osman
(install the gem database driver you use)
36 8 Ohad Levy
# gem install sqlite3 or gem install mysql  ( you may have additional dependencies that would need to be resolved first)
37 7 Corey Osman
38 7 Corey Osman
Some of the gem dependencies can be resolved by installing the development library for that package (example: mysql-devel)
39 7 Corey Osman
40 7 Corey Osman
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.
41 7 Corey Osman
42 7 Corey Osman
You can get a list of the currently installed gems by using: gem list.
43 1
44 10 Corey Osman
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.
45 6 Corey Osman
46 6 Corey Osman
47 2 Ohad Levy
h1. error: Entry 'some file' not uptodate. Cannot merge.
48 2 Ohad Levy
49 2 Ohad Levy
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.
50 2 Ohad Levy
51 2 Ohad Levy
If you don't think that you edited this file (e.g. db/schema.rb) it is usually safe to do:
52 2 Ohad Levy
<pre>
53 2 Ohad Levy
git checkout 'some file'
54 2 Ohad Levy
</pre> 
55 2 Ohad Levy
56 2 Ohad Levy
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:
57 2 Ohad Levy
<pre>
58 2 Ohad Levy
git pull
59 2 Ohad Levy
</pre>
60 3 Ohad Levy
61 3 Ohad Levy
h1. Strange errors with passenger
62 3 Ohad Levy
63 3 Ohad Levy
Passenger executes foreman, based on the owner of the config/environmnets.rb file, make sure that this use can actually access:
64 3 Ohad Levy
* puppet configuration files
65 3 Ohad Levy
* sqlite database (if using sqlite)
66 3 Ohad Levy
* write to log, tmp directories
67 3 Ohad Levy
68 3 Ohad Levy
see source:extras/puppet/foreman for complete puppet based setup for Foreman.
69 4 Bash Shell
70 4 Bash Shell
71 4 Bash Shell
72 4 Bash Shell
h1. error: Could not send facts to Foreman: wrong Content-Length format (RuntimeError)
73 4 Bash Shell
74 4 Bash Shell
You might see this error if you run the HTTP push facts script or the sample external nodes script.
75 4 Bash Shell
This is most likely due to older version of the mongrel gem. Please try and update your gems.
76 4 Bash Shell
77 4 Bash Shell
<pre>
78 4 Bash Shell
gem update mongrel
79 4 Bash Shell
</pre>
80 5 Lukas Zapletal
81 5 Lukas Zapletal
h1. Is my Foreman instance running?
82 5 Lukas Zapletal
83 5 Lukas Zapletal
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:
84 5 Lukas Zapletal
85 5 Lukas Zapletal
<pre>
86 5 Lukas Zapletal
$ curl -k -H "Accept: application/json" http://instance:3000/status
87 5 Lukas Zapletal
{"status":200,"result":"ok","db_duration_ms":"5"}
88 5 Lukas Zapletal
</pre>
89 9 Dis Connect
90 9 Dis Connect
91 9 Dis Connect
h1. How do I enable debugging?
92 9 Dis Connect
93 9 Dis Connect
Edit config/environments/production.rb and uncomment "config.log_level = :debug"
94 13 Corey Osman
95 13 Corey Osman
h1. [[Unattended Provisioning Troubleshooting]]
96 14 Florian Koch
97 14 Florian Koch
h1. Puppet and Storeconfigs: err: Could not retrieve catalog from remote server: Error 400 on SERVER: stack level too deep
98 14 Florian Koch
99 14 Florian Koch
Your activerecord Version is to new, you need activrecord 3.0.10 see http://projects.puppetlabs.com/issues/9290
100 14 Florian Koch
101 14 Florian Koch
<pre>
102 14 Florian Koch
gem uninstall activerecord
103 14 Florian Koch
gem install activerecord -v 3.0.10
104 14 Florian Koch
</pre>
105 15 Romain Vrignaud
106 15 Romain Vrignaud
107 15 Romain Vrignaud
108 15 Romain Vrignaud
h1. How do I fix this error: "Unable to find directory $confdir/environments/$environment/modules in environment master" ?
109 15 Romain Vrignaud
110 15 Romain Vrignaud
If you've followed http://docs.puppetlabs.com/guides/environment.html#configuring-environments-on-the-puppet-master to 
111 15 Romain Vrignaud
create a multi-environment puppet configuration, you're initial rake may look something like this:
112 15 Romain Vrignaud
<pre>
113 15 Romain Vrignaud
rake puppet:import:puppet_classes RAILS_ENV=production
114 15 Romain Vrignaud
(in /usr/share/foreman)
115 15 Romain Vrignaud
Evaluating possible changes to your installation
116 15 Romain Vrignaud
Problems were detected during the evaluation phase
117 15 Romain Vrignaud
118 15 Romain Vrignaud
Unable to find directory $confdir/environments/$environment/modules in environment master
119 15 Romain Vrignaud
120 15 Romain Vrignaud
Please fix these issues and try again
121 15 Romain Vrignaud
</pre>
122 15 Romain Vrignaud
This is because Foreman does not currently evaluate $confdir.  There is a feature request open on this issue.  In the 
123 15 Romain Vrignaud
meantime, hard code your $confdir in your puppet.conf.
124 15 Romain Vrignaud
125 21 Romain Vrignaud
h1. Smart-proxy do not recognize my puppet environment
126 23 Romain Vrignaud
127 21 Romain Vrignaud
If I query smart-proxy and it return empty puppet environment :
128 22 Romain Vrignaud
<pre>
129 21 Romain Vrignaud
curl -k -H "Content-Type:application/json" -H "Accept:application/json" http://puppet:8443/puppet/environments
130 21 Romain Vrignaud
=> []
131 22 Romain Vrignaud
</pre>
132 21 Romain Vrignaud
133 21 Romain Vrignaud
You may have to add in your puppetmaster's puppet.conf environment definition like :
134 21 Romain Vrignaud
135 22 Romain Vrignaud
<pre>
136 21 Romain Vrignaud
[production]
137 21 Romain Vrignaud
    manifest   = /etc/puppet/manifests/site.pp
138 21 Romain Vrignaud
    modulepath = /etc/puppet/modules
139 21 Romain Vrignaud
    fileserverconfig = /etc/puppet/fileserver.conf
140 21 Romain Vrignaud
    templatedir=/etc/puppet/templates/
141 21 Romain Vrignaud
142 21 Romain Vrignaud
[preprod]
143 21 Romain Vrignaud
    manifest   = /etc/puppet/preprod/manifests/site.pp
144 21 Romain Vrignaud
    modulepath = /etc/puppet/preprod/modules
145 21 Romain Vrignaud
    fileserverconfig = /etc/puppet/preprod/fileserver.conf
146 21 Romain Vrignaud
    templatedir=/etc/puppet/preprod/templates
147 21 Romain Vrignaud
148 21 Romain Vrignaud
[development]
149 21 Romain Vrignaud
    manifest   = /etc/puppet/development/manifests/site.pp
150 21 Romain Vrignaud
    modulepath = /etc/puppet/development/modules
151 21 Romain Vrignaud
    fileserverconfig = /etc/puppet/development/fileserver.conf
152 21 Romain Vrignaud
    templatedir=/etc/puppet/development/templates/
153 21 Romain Vrignaud
154 21 Romain Vrignaud
[test]
155 21 Romain Vrignaud
    manifest   = /etc/puppet/test/manifests/site.pp
156 21 Romain Vrignaud
    modulepath = /etc/puppet/test/modules
157 21 Romain Vrignaud
    fileserverconfig = /etc/puppet/test/fileserver.conf
158 21 Romain Vrignaud
    templatedir=/etc/puppet/test/templates/
159 22 Romain Vrignaud
</pre>
160 21 Romain Vrignaud
161 21 Romain Vrignaud
162 15 Romain Vrignaud
h1. How do I fix the puppet class import problem with multiple puppet environment ?
163 15 Romain Vrignaud
164 15 Romain Vrignaud
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),
165 15 Romain Vrignaud
try to add ":puppetconfdir: /etc/puppet/puppet.conf" in your settings.yaml.
166 17 Martin Hovmöller
167 17 Martin Hovmöller
h1. Unable to connect to Hypervisor?
168 18 Martin Hovmöller
169 17 Martin Hovmöller
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).
170 19 Martin Hovmöller
171 17 Martin Hovmöller
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:
172 17 Martin Hovmöller
cd ~foreman
173 17 Martin Hovmöller
chown foreman config/environment.rb
174 17 Martin Hovmöller
touch ~foreman/tmp/restart.txt
175 24 chris alfonso
176 24 chris alfonso
h1. Routing errors when running rake test?
177 24 chris alfonso
178 24 chris alfonso
Edit the config/settings.yaml and set the :login: setting to true
179 25 Ohad Levy
180 25 Ohad Levy
h1. cannot load such file -- facter / puppet (LoadError)
181 25 Ohad Levy
182 26 Ohad Levy
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).
183 25 Ohad Levy
184 25 Ohad Levy
simply add another file to FOREMAN_DIR/bundler.d
185 25 Ohad Levy
<pre>
186 27 Igor Galić
echo "gem 'puppet'" > bundler.d/local-gems.rb
187 25 Ohad Levy
</pre>