HiveBrain v1.2.0
Get Started
← Back to all entries
debugMinor

Chef 12: Error while uploading cookbook

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
cookbookerrorchefuploadingwhile

Problem

I am using Chef and trying to upload a cookbook on chef-server but getting an error in response:


{"error":["Invalid key all_files in request body"]}

However, I can see the list of cookbook using knife node list

My chefDK version:

chef -v
Chef Development Kit Version: 2.0.28
chef-client version: 13.2.20
delivery version: master (17c1b0fed9be4c70f69091a6d21a4cbf0df60a23)
berks version: 6.2.0
kitchen version: 1.16.0
inspec version: 1.31.1


Chef-server version is 12.0.5

Logs:

DEBUG: Response body contains:
{"error":["Invalid key all_files in request body"]}
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response


I can't upload more logs, if one needs particular info then I can provide.

Any help?

Solution

This question seems to have been answered in the Chef issue. To close the loop, I will summarise it here:

This was a bug introduced in Chef 12:


The issue is with chef_solo vs chef_zero. It seems chef_solo was the old way of doing Chef things. So I added chef_zero.enabled true in the knife.rb file to activate chef_zero instead of chef_solo. When you do this, you should be able to upload.

It was subsequently fixed in Chef 13:


This is fixed in Chef 13.3.3, which will be released in the ChefDK 2.2 release

At the time of writing, Chef is in major version 15, so this issue is very unlikely to be encountered in the wild.

Context

StackExchange DevOps Q#1875, answer score: 1

Revisions (0)

No revisions yet.