chef-boneyard/chef-dk

knife supermarket share errors with 'ERROR: Multipart POST part 'tarball' is corrupt: "\x80\x00\x00\x00\x0E:\xBFD" is not an octal string'

isuftin opened this issue · 4 comments

Description

When trying to upload cookbook to Chef Supermarket, I get the error ERROR: Multipart POST part 'tarball' is corrupt: "\x80\x00\x00\x00\x0E:\xBFD" is not an octal string

Example:

$ knife supermarket share stig -VV -o ../ -c ~/.chef/knife-chefio.rb
INFO: Using configuration from /Users/isuftin/.chef/knife-chefio.rb
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
Generating metadata for stig from /var/folders/58/n9bfwg050sdg1dmn9688wrcm001rp_/T/chef-stig-build20190410-52953-ff735p/stig/metadata.rb
Making tarball stig.tgz
DEBUG: Signing: method: post, url: https://supermarket.chef.io/api/v1/cookbooks, file: #<File:0x00007ff745d18988>, User-id: isuftin-usgs, Timestamp: 2019-04-10T13:06:07Z
ERROR: Multipart POST part 'tarball' is corrupt: "\x80\x00\x00\x00\x0E:\xBFD" is not an octal string

I did try switching gem versions as mentioned here:

This did not help.

Possible related issues:

ChefDK Version

Using Chef Workstation.

$ chef -v
Chef Workstation: 0.2.53
  chef-run: 0.2.8
  chef-client: 14.10.9
  delivery-cli: 0.0.52 (9d07501a3b347cc687c902319d23dc32dd5fa621)
  berks: 7.0.7
  test-kitchen: 1.24.0
  inspec: 3.6.6
$ chef gem -v
2.7.6

Platform Version

MacOS:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.12.6
BuildVersion:   16G1917

Replication Case

What i do locally for a cloned tagged checkout of https://github.com/USGS-CIDA/stig:

$ knife cookbook metadata stig -o ../
Generating metadata for stig from /Users/isuftin/Chef/cookbooks/stig/metadata.rb

$ knife supermarket share stig -VV -o ../ -c ~/.chef/knife-chefio.rb

INFO: Using configuration from /Users/isuftin/.chef/knife-chefio.rb
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
Generating metadata for stig from /var/folders/58/n9bfwg050sdg1dmn9688wrcm001rp_/T/chef-stig-build20190410-60032-1e5qcb1/stig/metadata.rb
Making tarball stig.tgz
DEBUG: Signing: method: post, url: https://supermarket.chef.io/api/v1/cookbooks, file: #<File:0x00007fc414f2f398>, User-id: isuftin-usgs, Timestamp: 2019-04-10T13:14:14Z
ERROR: Multipart POST part 'tarball' is corrupt: "\x80\x00\x00\x00\x0E:\xBFD" is not an octal string

My knife-chefio.rb file looks like:

$ cat  ~/.chef/knife-chefio.rb
current_dir = File.dirname(__FILE__)
log_level                :info
log_location             STDOUT
node_name                "isuftin-usgs"
client_key               "#{current_dir}/isuftin-usgs-chefio.pem"
chef_server_url          "https://supermarket.chef.io/"

Stacktrace

https://gist.github.com/isuftin/e8bb0804d5510a0258ead2ea65638fca

FYI: We hit the same issue - turns out that the error was coming from the supermarket server, not the chef-workstation/chefdk knife client (I think chef-workstation is using an older version). As a workaround, we rolled back our supermarket instances to the previously installed version or rolled back rubygems on the supermarket server as a workaround. We didn't need to change knife at all. We had just recently upgraded to supermarket 3.2.2 when we started seeing this issue.

... turns out that the error was coming from the supermarket server

Good finding. Supermarket 3.2.2 included an upgraded RubyGems to close several CVEs. Can you open this issue on chef/supermarket?

tas50 commented

This was resolved by migrating Supermarket to libarchive from built in ruby archive handling.

lock commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.