Skip to content

Puppet: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: stack level too deep on node something.pp

As a Puppet user, you can run into the following error.

~$ puppet agent -t
Info: Retrieving plugin
Info: Loading facts in /etc/puppet/modules/firewall/lib/facter/iptables_persistent_version.rb
Info: Loading facts in /etc/puppet/modules/firewall/lib/facter/ip6tables_version.rb
Info: Loading facts in /etc/puppet/modules/firewall/lib/facter/iptables_version.rb
Info: Loading facts in /etc/puppet/modules/vmwaretools/lib/facter/vmwaretools_version.rb
Info: Loading facts in /etc/puppet/modules/postgresql/lib/facter/postgres_default_version.rb
Info: Loading facts in /etc/puppet/modules/concat/lib/facter/concat_basedir.rb
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb
Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/iptables_persistent_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/lib/puppet/lib/facter/ip6tables_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/vmwaretools_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/postgres_default_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/iptables_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: stack level too deep on node hostname.tld
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Continued...

Taking a MySQL-dump with a wildcard on table names

Situation: you want to take a mysqldump with all table-names that match a particular pattern, but you don't want all the tables.

Here's how:

root@serv: ~$ mysqldump YOURDBNAME $(mysql -D YOURDBNAME -Bse "SHOW TABLES LIKE 'table_pattern_%'") > /tmp/database-dump.sql

You can modifity the SHOW TABLES LIKE query to include all the table names that you want.

Reading all data from a Memcached instance

Memcached is a simply key/value store, often used as a cache to reduce load on a database system. It uses a concept of slabs and chunks to store data. Each piece of data you want to store, depending on the object size, will get stored in a different 'slab'. A slab is a fixed in size and will store your data.

Memcached allows you to retrieve all data from within such a slab via the command line (= telnet interface). Continued...

Setting custom puppet facts from within your Vagrantfile

You may want to set custom puppet facts in your development environment by specifying them in your Vagrantfile, so you can have a unique fact per developer or identify your own environment. Here's a quick way to do that.
Continued...

Nginx: nginx: [warn] load balancing method redefined

You may receive the following warning when reloading/configtesting an Nginx configuration that uses upstreams.

$ service nginx configtest
nginx: [warn] load balancing method redefined in /etc/nginx/conf.d/upstream.conf:5
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

This can occur when you conflicting variables inside your upstream, like such:

$ cat upstream.conf 
upstream upstream_name {
  # Use max # keepalive connections
  keepalive 120;
  # Use the backend with least number of connections
  least_conn;
  # All upstream members defined below
  server 192.168.1.5:80  weight=24;
  server 192.168.1.6:80   weight=24;
}

The warning is causde by the mixing of 'keepalive' and 'least_conn', use either one but don't mix both.