Everything is a Freaking DNS problem - webrick http://127.0.0.1:8080/blog/taxonomy/term/1445/0 en 24 hours of Puppet Drama http://127.0.0.1:8080/blog/24-hours-puppet-drama <p>Over the past couple of days I've been fighting with a weird puppet problem , we eventually cracked it , but I promised a bunch of you to fully explain it here ;)</p> <p>So we were deploying 2 Blade chassis at a pretty remote location with a mix of phyisical and virtual machines, some 48 instances in total. This is a pretty standard rollout, we've got a bunch of similar platforms in our lab , so we knew about a couple of glitches, what to expect etc.</p> <p>I was just keeping an eye on the deployment, looking at the logs seeing if things were running fine, when suddenly a couple of puppet runs didn't come trough, we had seen such behaviour before, usually it's a matter of running them a gain a couple of times and they will come trough. (Upgrading ruby and putting passenger in front of puppet actually solved those issues,<br /> We'd even had a loop built in the platform that runs puppet a couple of times till it returns with the correct exit code just to make sure. )</p> <p>We were first scratching the A chain of our setup, so that in the event of failure we could still bring up the B chain of the platform and be up and running again. Actually machines were coming up.. slowly .. some of them took a bit longer . One of the machine's clock was seriously off .. the SSL was barfing on it , so we set the bios clock, and restarted .. it was the machine with 6VM's took a while but everything was back on schedule.. then suddenly things were going down fast more and more puppetruns started failing and .. , at some point in time actually none of our puppet runs were working again .<br /> I'd see the puppetmaster perfectly compile it's catalog</p> <p><div class="geshifilter"><pre class="text geshifilter-text" style="font-family:monospace;"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">notice: Compiled catalog for ctl-0-a</div></li></ol></pre></div></p> <p>Then the client .. not wanting to get it ..</p> <p><div class="geshifilter"><pre class="text geshifilter-text" style="font-family:monospace;"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">Mar 1 11:10:45 ctl-0-a puppet-agent[3674]: Not using expired catalog for ctl-0-a from cache; expired at Tue Mar 01 09:50:06 +0000 2011</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">Mar 1 11:10:45 ctl-0-a puppet-agent[3674]: Using cached catalog</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">Mar 1 11:10:45 ctl-0-a puppet-agent[3674]: Could not retrieve catalog; skipping run</div></li></ol></pre></div></p> <p>We had gone from about 60% of our fresly deployed boxen working fine, to not one<br /> So what do you do .. indeed .. you turn on debugging.<br /> You put both your puppetmaster and client in debug. Nothing, no errors no nothing ..</p> <p>I asked some collegues, asked on irc .. much ideas but none of them that actually cracked the problem. I did what I knew that solve similar problems before,</p> <p>I switched our serialization format from yaml back to pson , and back, no luck.<br /> I upgraded ruby to a version from the <a href="http://yum.glei.ch/" rel="nofollow">glei.ch</a> repository. No luck.<br /> I upgraded our Puppet version 2.6 to a version from <a href="http://tmz.fedorapeople.org/repo/puppet/epel/5/i386/" rel="nofollow">the TMZ Epel repo</a> , we cleaned out ssl the certificates on all sides multiple times. Cleaned out /var/lib/puppet , We uninstalled puppet and reinstalled it.<br /> It wasn't a DNS Problem</p> <p>I had started stripping my manifests to empty runs, those worked, then started uncommenting the actual manifests again ... Then in the middle of the debug our VPN connection to the remote location broke down, we'd only be getting it back in the morning ..about 12 hours later not fun. Murphy obviously ..</p> <p>So the next morning we dived right back in ... making those manifests bigger again, removing all the stages, 1 or 2 successful runs, then with the same config .. back to failure. On and off.. successfull and unscussessful. ... it wasn't in the manifests ..</p> <p>So we decided to roll the puppetmaster back to it's previous version, that one was known to be stable, there obviously was something really fishy going, so that was the safest bet.</p> <p>Wrong, the machine came up, but it took longer than expected, and when trying to connect new clients to it .. nothing worked anymore .. same problem as before .. puppetmaster compiles catalog, clients didn't get anything. we started to suspect faulty hardware .. but how could that bee.. the puppetclient looked liked the only malfunctioning thing around .</p> <p>Then <a href="http://twitter.com/#!/dim0" rel="nofollow">Dim0</a> suggested me to look at the that one logfile I hadn't looked , /var/log/puppet/masterhttp.log and then we saw it . it was being flooded with ssl errors, ssl errors from clients that shouldn't even be connecting to the puppetmaster at all.</p> <p><div class="geshifilter"><pre class="text geshifilter-text" style="font-family:monospace;"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">[2011-03-02 13:32:00] ERROR OpenSSL::SSL::SSLError: tlsv1 alert decrypt error</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:44:in `accept'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:44:in `listen'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/1.8/webrick/server.rb:173:in `call'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:42:in `listen'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:41:in `initialize'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:41:in `new'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:41:in `listen'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/1.8/thread.rb:135:in `synchronize'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:38:in `listen'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:127:in `listen'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:142:in `start'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/daemon.rb:124:in `start'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:114:in `main'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:46:in `run_command'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:287:in `run'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:393:in `exit_on_fail'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:287:in `run'</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> /usr/sbin/puppetmasterd:4</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">[2011-03-02 13:32:00] ERROR OpenSSL::SSL::SSLError: tlsv1 alert decrypt error</div></li></ol></pre></div></p> <p>What happened was that 'we' decided to bring of the one backup machines back online, afterall once the slow starting server came trough, it would be the passive node in the cluster , no worries there, right ? Wrong,<br /> This physical machine had 6 virtual machines with old ssl certificates that got stuck in an loop which was put there to sure their puppetrun came trough correctly at boot time.</p> <p>Those 7 rogue clients which generated little to no relevant traffic on the network were saturating the default webrick, killing them solved the problem and we were back to regular deployment in no time.</p> <p>The sad part is that our upcoming release already has passenger , a fresher version of ruby etc .. and that most of the above mentioned errors won't occur anymore there.<br /> But in short .. don't use the default webrick .. it will kill you :)</p> <p>And no , not everything is a freaking dns problem, ssl is a big pain in the B too .. :)</p> http://127.0.0.1:8080/blog/24-hours-puppet-drama#comments devops passenger puppet ruby ssl webrick Thu, 03 Mar 2011 23:42:45 +0000 Kris Buytaert 1037 at http://127.0.0.1:8080/blog