I ran into a problem recently with some corrupt chef cookbooks after a recent chef upgrade, I was getting an “Error Syncing Cookbooks – EOFError: end of file reached” error on every chef run on all nodes:
================================================================================
Error Syncing Cookbooks:
================================================================================
Unexpected Error:
-----------------
EOFError: end of file reached
[2013-01-21T18:17:27+00:00] ERROR: Running exception handlers
[2013-01-21T18:17:27+00:00] FATAL: Saving node information to /var/cache/chef/failed-run-data.json
[2013-01-21T18:17:27+00:00] ERROR: Exception handlers complete
[2013-01-21T18:17:27+00:00] FATAL: Stacktrace dumped to /var/cache/chef/chef-stacktrace.out
[2013-01-21T18:17:27+00:00] FATAL: EOFError: end of file reached
I’d already deleted the cookbooks:
knife cookbook delete cookbook_name
and re-uploaded them, but this didn’t work. It took a purge to completely delete the cookbook from the chef server:
knife cookbook delete --purge cookbook_name
In the end I had so many cookbooks that were somehow corrupt that I bulk purged them and re-uploaded them all:
knife cookbook bulk delete --purge '.+'