Search code examples
sslpuppet

Puppet: could not retrieve catalog from remote server


Running sudo puppet agent -t from host: host.internaltest.com

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Another local or imported resource exists with the type and title Host[host.internaltest.com] on node host.internaltest.com

This machine had its ssl certs messed with so I cleaned it off the master and then using autosign (bad bad i know!) I ran sudo puppet agent -t which regenerated the ssl cert but also threw this error. Let me know if you need more information, I haven't delete with this aspect of puppet too much.


Solution

  • Most likely puppetmaster has this cert in the memory. You need to clean the cert both on client and in the master

    #On client machine do this assuming puppet libdir = /var/lib/puppet
    
    rm -rf /var/lib/puppet/ssl/*/*.pem
    
    #On the puppet-master
    
    puppet cert clean host.internaltest.com
    
    # Restart puppet-master
    
    /sbin/service puppetmasterd restart
    
    # If you are using puppet-master behind passenger, you may need to restart httpd
    
    /sbin/service httpd restart
    
    # then run puppet agent on the client to regenerate the cert