Troubleshooting

Version 19 (Martin Hovmöller, 01/24/2012 04:32 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 10 Corey Osman
20 11 Corey Osman
21 16 Romain Vrignaud
22 10 Corey Osman
23 7 Corey Osman
h1. I use puppet enterprise, what now?
24 7 Corey Osman
25 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.
26 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.
27 7 Corey Osman
28 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.
29 1
      a. rpm -ivh pe-ruby-devel-1.8.7.302-1.el5.i386.rpm 
30 8 Ohad Levy
# Update your path variable to use the ruby version PE ships with (export PATH=/opt/puppet/bin:$PATH)
31 8 Ohad Levy
# Check to make sure your PATH was updated ("which gem" should return /opt/puppet/bin/gem)
32 8 Ohad Levy
# gem install json
33 8 Ohad Levy
# gem install rest-client
34 7 Corey Osman
(install the gem database driver you use)
35 8 Ohad Levy
# gem install sqlite3 or gem install mysql  ( you may have additional dependencies that would need to be resolved first)
36 7 Corey Osman
37 7 Corey Osman
Some of the gem dependencies can be resolved by installing the development library for that package (example: mysql-devel)
38 7 Corey Osman
39 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.
40 7 Corey Osman
41 7 Corey Osman
You can get a list of the currently installed gems by using: gem list.
42 1
43 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.
44 6 Corey Osman
45 6 Corey Osman
46 2 Ohad Levy
h1. error: Entry 'some file' not uptodate. Cannot merge.
47 2 Ohad Levy
48 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.
49 2 Ohad Levy
50 2 Ohad Levy
If you don't think that you edited this file (e.g. db/schema.rb) it is usually safe to do:
51 2 Ohad Levy
<pre>
52 2 Ohad Levy
git checkout 'some file'
53 2 Ohad Levy
</pre> 
54 2 Ohad Levy
55 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:
56 2 Ohad Levy
<pre>
57 2 Ohad Levy
git pull
58 2 Ohad Levy
</pre>
59 3 Ohad Levy
60 3 Ohad Levy
h1. Strange errors with passenger
61 3 Ohad Levy
62 3 Ohad Levy
Passenger executes foreman, based on the owner of the config/environmnets.rb file, make sure that this use can actually access:
63 3 Ohad Levy
* puppet configuration files
64 3 Ohad Levy
* sqlite database (if using sqlite)
65 3 Ohad Levy
* write to log, tmp directories
66 3 Ohad Levy
67 3 Ohad Levy
see source:extras/puppet/foreman for complete puppet based setup for Foreman.
68 4 Bash Shell
69 4 Bash Shell
70 4 Bash Shell
71 4 Bash Shell
h1. error: Could not send facts to Foreman: wrong Content-Length format (RuntimeError)
72 4 Bash Shell
73 4 Bash Shell
You might see this error if you run the HTTP push facts script or the sample external nodes script.
74 4 Bash Shell
This is most likely due to older version of the mongrel gem. Please try and update your gems.
75 4 Bash Shell
76 4 Bash Shell
<pre>
77 4 Bash Shell
gem update mongrel
78 4 Bash Shell
</pre>
79 5 Lukas Zapletal
80 5 Lukas Zapletal
h1. Is my Foreman instance running?
81 5 Lukas Zapletal
82 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:
83 5 Lukas Zapletal
84 5 Lukas Zapletal
<pre>
85 5 Lukas Zapletal
$ curl -k -H "Accept: application/json" http://instance:3000/status
86 5 Lukas Zapletal
{"status":200,"result":"ok","db_duration_ms":"5"}
87 5 Lukas Zapletal
</pre>
88 9 Dis Connect
89 9 Dis Connect
90 9 Dis Connect
h1. How do I enable debugging?
91 9 Dis Connect
92 9 Dis Connect
Edit config/environments/production.rb and uncomment "config.log_level = :debug"
93 13 Corey Osman
94 13 Corey Osman
h1. [[Unattended Provisioning Troubleshooting]]
95 14 Florian Koch
96 14 Florian Koch
h1. Puppet and Storeconfigs: err: Could not retrieve catalog from remote server: Error 400 on SERVER: stack level too deep
97 14 Florian Koch
98 14 Florian Koch
Your activerecord Version is to new, you need activrecord 3.0.10 see http://projects.puppetlabs.com/issues/9290
99 14 Florian Koch
100 14 Florian Koch
<pre>
101 14 Florian Koch
gem uninstall activerecord
102 14 Florian Koch
gem install activerecord -v 3.0.10
103 14 Florian Koch
</pre>
104 15 Romain Vrignaud
105 15 Romain Vrignaud
106 15 Romain Vrignaud
107 15 Romain Vrignaud
h1. How do I fix this error: "Unable to find directory $confdir/environments/$environment/modules in environment master" ?
108 15 Romain Vrignaud
109 15 Romain Vrignaud
If you've followed http://docs.puppetlabs.com/guides/environment.html#configuring-environments-on-the-puppet-master to 
110 15 Romain Vrignaud
create a multi-environment puppet configuration, you're initial rake may look something like this:
111 15 Romain Vrignaud
<pre>
112 15 Romain Vrignaud
rake puppet:import:puppet_classes RAILS_ENV=production
113 15 Romain Vrignaud
(in /usr/share/foreman)
114 15 Romain Vrignaud
Evaluating possible changes to your installation
115 15 Romain Vrignaud
Problems were detected during the evaluation phase
116 15 Romain Vrignaud
117 15 Romain Vrignaud
Unable to find directory $confdir/environments/$environment/modules in environment master
118 15 Romain Vrignaud
119 15 Romain Vrignaud
Please fix these issues and try again
120 15 Romain Vrignaud
</pre>
121 15 Romain Vrignaud
This is because Foreman does not currently evaluate $confdir.  There is a feature request open on this issue.  In the 
122 15 Romain Vrignaud
meantime, hard code your $confdir in your puppet.conf.
123 15 Romain Vrignaud
124 15 Romain Vrignaud
h1. How do I fix the puppet class import problem with multiple puppet environment ?
125 15 Romain Vrignaud
126 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),
127 15 Romain Vrignaud
try to add ":puppetconfdir: /etc/puppet/puppet.conf" in your settings.yaml.
128 17 Martin Hovmöller
129 17 Martin Hovmöller
h1. Unable to connect to Hypervisor?
130 18 Martin Hovmöller
131 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).
132 19 Martin Hovmöller
133 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:
134 17 Martin Hovmöller
cd ~foreman
135 17 Martin Hovmöller
chown foreman config/environment.rb
136 17 Martin Hovmöller
touch ~foreman/tmp/restart.txt