I'm sure we've all seen this message from time to time when using puppet with exported resources:

Error 400 on SERVER: Exported resource Sshkey[foo] cannot override local resource on node bar.example.com

It's actually pretty easy to fix. Simply delete the exported resource for node foo.

Assuming you are using MySQL for your DB, something like this will do the trick:

mysql -e "delete from resources where restype like 'sshkey' and exported=1 and host_id = (select id from hosts where name 'foo')" puppet

3 thoughts on “Error 400 on SERVER: Exported resource Sshkey[foo] cannot override local resource on node bar.example.com

  1. Thanks. That seems a little more severe though – it wipes the entire host from the DB. My SQL query only deletes the one bad record that triggers the error.

  2. It's not severe, really.  The host would be recreated on the next catalog run. so no harm, unless your db host is resource constrained.

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

required