403 "Forbidden" when uploading cookbooks with large files


#1

I’m unable to upload a cookbook with a large file (~160 MB):

$ knife cookbook upload --all

Uploading mmaww-staging [1.0.0]
(…)
ERROR: Failed to upload /home/tch/Desktop/chef-repo/cookbooks/mmaww-staging/files/default/mongo-db.tar.xz (95d55edf3a75d5358a424d843c3e8463) to https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398124259&Signature=…Unk%3D : 403 “Forbidden”

<?xml version="1.0" encoding="UTF-8"?>AccessDeniedAccess Deniedg2gCZAATYm9va3NoZWxmQDEyNy4wLjAuMWgDYgAABXZiAAHoHmIAAf01

ERROR: You authenticated successfully to https://192.168.11.34 as tch but you are not authorized for this action
Response: <?xml version="1.0" encoding="UTF-8"?>AccessDeniedAccess Deniedg2gCZAATYm9va3NoZWxmQDEyNy4wLjAuMWgDYgAABXZiAAHoHmIAAf01

echo ?
100

Any advice?

dpkg -l|grep chef

ii chef-server 11.0.12-1.ubuntu.12.04 The full stack of chef-server


Tomasz Chmielewski
http://wpkg.org


#2

How long is the cookbook upload taking? The upload URLs for each file are
pre-signed with an expiry time, usually set at 15 mins. With that large
file, you may be exceeding that time.

Have you tried uploading just that cookbook?

Also, you might want to think about storing that file somewhere else. It’s
a bad practice to store large artifacts in your cookbooks. Is your cookbook
in source control? What happens when that artifact changes? You’ll run into
repo bloat pretty quickly that way.

On Monday, April 21, 2014, Tomasz Chmielewski tch@wpkg.org wrote:

I’m unable to upload a cookbook with a large file (~160 MB):

$ knife cookbook upload --all

Uploading mmaww-staging [1.0.0]
(…)
ERROR: Failed to upload
/home/tch/Desktop/chef-repo/cookbooks/mmaww-staging/files/default/mongo-db.tar.xz
(95d55edf3a75d5358a424d843c3e8463) to
https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398124259&Signature=…Unk%3D: 403 “Forbidden”

<?xml version="1.0" encoding="UTF-8"?>AccessDeniedAccess

Deniedg2gCZAATYm9va3NoZWxmQDEyNy4wLjAuMWgDYgAABXZiAAHoHmIAAf01
ERROR: You authenticated successfully to https://192.168.11.34 as tch but
you are not authorized for this action
Response: <?xml version="1.0"
encoding=“UTF-8”?>AccessDeniedAccess
Deniedg2gCZAATYm9va3NoZWxmQDEyNy4wLjAuMWgDYgAABXZiAAHoHmIAAf01

echo ?
100

Any advice?

dpkg -l|grep chef

ii chef-server 11.0.12-1.ubuntu.12.04 The
full stack of chef-server


Tomasz Chmielewski
http://wpkg.org


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


#3

Hi,

I’ve followed some hints found via google, and changed this from 900
to 1800:

root@chef01:/etc/chef-server# grep -r s3_url_ttl *
chef-server-running.json: “s3_url_ttl”: 1800,

Now I’m getting:

$ time knife cookbook upload --all
(…)
Uploading mmaww-staging [1.0.0] <---- the only large recipe
(…)
ERROR: Chef::Exceptions::ContentLengthMismatch: Response body length 0 does not match HTTP Content-Length header 206.

real 28m27.768s
user 0m7.113s
sys 0m2.634s

The file I’m uploading is a static file and is unlikely to change in the future.


Tomasz Chmielewski
http://wpkg.org

On Mon, 21 Apr 2014 17:46:37 -0700
Stephen Delano stephen@opscode.com wrote:

How long is the cookbook upload taking? The upload URLs for each file
are pre-signed with an expiry time, usually set at 15 mins. With that
large file, you may be exceeding that time.

Have you tried uploading just that cookbook?

Also, you might want to think about storing that file somewhere else.
It’s a bad practice to store large artifacts in your cookbooks. Is
your cookbook in source control? What happens when that artifact
changes? You’ll run into repo bloat pretty quickly that way.

On Monday, April 21, 2014, Tomasz Chmielewski tch@wpkg.org wrote:

I’m unable to upload a cookbook with a large file (~160 MB):

$ knife cookbook upload --all

Uploading mmaww-staging [1.0.0]
(…)
ERROR: Failed to upload
/home/tch/Desktop/chef-repo/cookbooks/mmaww-staging/files/default/mongo-db.tar.xz
(95d55edf3a75d5358a424d843c3e8463) to
https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398124259&Signature=…Unk%3D:
403 “Forbidden” <?xml version="1.0"
encoding=“UTF-8”?>AccessDeniedAccess
Deniedg2gCZAATYm9va3NoZWxmQDEyNy4wLjAuMWgDYgAABXZiAAHoHmIAAf01
ERROR: You authenticated successfully to https://192.168.11.34 as
tch but you are not authorized for this action
Response: <?xml version="1.0"
encoding=“UTF-8”?>AccessDeniedAccess
Deniedg2gCZAATYm9va3NoZWxmQDEyNy4wLjAuMWgDYgAABXZiAAHoHmIAAf01

echo ?
100

Any advice?

dpkg -l|grep chef

ii chef-server
11.0.12-1.ubuntu.12.04 The full stack of chef-server


Tomasz Chmielewski
http://wpkg.org


Tomasz Chmielewski


#4

On Tue, 22 Apr 2014 02:00:08 +0100
Tomasz Chmielewski tch@wpkg.org wrote:

The file I’m uploading is a static file and is unlikely to change in
the future.

Or this:

$ time knife cookbook upload mmaww-staging
Uploading mmaww-staging [1.0.0]
ERROR: Chef::Exceptions::ContentLengthMismatch: Response body length 0
does not match HTTP Content-Length header 206.

real 21m23.216s
user 0m6.249s
sys 0m3.728s

The error seems to be coming from nginx now - I can see the following
in /var/log/chef-server/nginx/error.log:

2014/04/22 01:22:31 [error] 22184#0: *13 readv() failed (104:
Connection reset by peer) while reading upstream, client:
188.37.253.127, server: chef01.sys, request:
“PUT /bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398129373&Signature=…/%2B1V2w%3D
HTTP/1.1”, upstream:
http://127.0.0.1:4321/bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398129373&Signature=…/%2B1V2w%3D”,
host: “chef01.sys.timedoctor.com:443

What do I need to change so that Chef accepts files which are 100-200
MB in size?


Tomasz Chmielewski
http://wpkg.org


#5

First of all, I don’t recommend that you store files in your cookbooks that
are 100-200MB in size, but I’ll try and help you debug this a bit.

Do you have any logs from the bookshelf service on the chef server? This is
the service that’s handling the cookbook storage. It seems odd that a file
of this size would take 20 minutes to upload. Do you have a slow connection
to the chef server?

On Monday, April 21, 2014, Tomasz Chmielewski tch@wpkg.org wrote:

On Tue, 22 Apr 2014 02:00:08 +0100
Tomasz Chmielewski <tch@wpkg.org <javascript:;>> wrote:

The file I’m uploading is a static file and is unlikely to change in
the future.

Or this:

$ time knife cookbook upload mmaww-staging
Uploading mmaww-staging [1.0.0]
ERROR: Chef::Exceptions::ContentLengthMismatch: Response body length 0
does not match HTTP Content-Length header 206.

real 21m23.216s
user 0m6.249s
sys 0m3.728s

The error seems to be coming from nginx now - I can see the following
in /var/log/chef-server/nginx/error.log:

2014/04/22 01:22:31 [error] 22184#0: *13 readv() failed (104:
Connection reset by peer) while reading upstream, client:
188.37.253.127, server: chef01.sys, request:
“PUT
/bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398129373&Signature=…/%2B1V2w%3D
HTTP/1.1”, upstream:

http://127.0.0.1:4321/bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398129373&Signature=…/%2B1V2w%3D
”,
host: “chef01.sys.timedoctor.com:443

What do I need to change so that Chef accepts files which are 100-200
MB in size?


Tomasz Chmielewski
http://wpkg.org


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


#6

On 4/21/14, 6:00 PM, Tomasz Chmielewski wrote:

ERROR: Chef::Exceptions::ContentLengthMismatch: Response body length 0 does not match HTTP Content-Length header 206.

try updating chef on your desktop. if you’re running 11.12.2 and seeing
this, then you’d need to cut a bug report, but we’d need more
information like output of knife cookbook upload -V and as much context
as you can give.


#7

On Mon, 21 Apr 2014 18:47:53 -0700
Stephen Delano stephen@opscode.com wrote:

First of all, I don’t recommend that you store files in your
cookbooks that are 100-200MB in size, but I’ll try and help you debug
this a bit.

I can understand your point for some cases, but there are lots of valid
reasons to use chef to serve files of that size anyway.

Do you have any logs from the bookshelf service on the chef server?
This is the service that’s handling the cookbook storage. It seems
odd that a file of this size would take 20 minutes to upload. Do you
have a slow connection to the chef server?

I don’t see any new entries in bookshelf logs when I upload a large
file; only these nginx logs. My guess would be it’s nginx
buffers/timeouts set too low somewhere, but I didn’t investigate that
yet.

My connection to the server is asymmetrical (ADSL), and I can upload at
around 150 kB/sec. Other than that, the connection is stable, no packet
losses etc.


Tomasz Chmielewski
http://wpkg.org


#8

On Mon, 21 Apr 2014 21:00:54 -0700
Lamont Granquist lamont@opscode.com wrote:

On 4/21/14, 6:00 PM, Tomasz Chmielewski wrote:

ERROR: Chef::Exceptions::ContentLengthMismatch: Response body
length 0 does not match HTTP Content-Length header 206.

try updating chef on your desktop. if you’re running 11.12.2 and
seeing this, then you’d need to cut a bug report, but we’d need more
information like output of knife cookbook upload -V and as much
context as you can give.

Hi,

I’m running 11.12.2 already:

$ dpkg -l|grep chef
ii chef 11.12.2-1 amd64 The full stack of chef

Here is the output with -V:

$ time knife cookbook upload mmaww-staging -V
Uploading mmaww-staging [1.0.0]
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
INFO: Saving mmaww-staging
INFO: Uploading files
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/files/default/mysql-setup.sh (checksum hex = 4160124bf8a905a0e5dc1aa419135909) to https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-4160124bf8a905a0e5dc1aa419135909?AWSAccessKeyId=…&Expires=1398159865&Signature=YNVBVPwN82OPwmiOgy41VmQB1jw%3D
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/files/default/mongo-setup.sh (checksum hex = 8abcd332a3bb0d3d284dbe0d83322fde) to https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-8abcd332a3bb0d3d284dbe0d83322fde?AWSAccessKeyId…&Expires=1398159865&Signature=DBHn7Bp8fo16o9CQ%2Bg8gDdIQhH0%3D
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/files/default/mongo-td_stage.tar.xz (checksum hex = 95d55edf3a75d5358a424d843c3e8463) to https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398159865&Signature=kXJpijoKemcQZA96ZVJydQG1JVc%3D
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/recipes/default.rb (checksum hex = 9cb5ef6dbb6db3811a1108ac5f990efc) to https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-9cb5ef6dbb6db3811a1108ac5f990efc?AWSAccessKeyId=…&Expires=1398159865&Signature=GgeSQKQ373PW1lWTpWOE%2BC3RfkU%3D
INFO: HTTP Request Returned 403 Forbidden:
ERROR: Chef::Exceptions::ContentLengthMismatch: Response body length 0 does not match HTTP Content-Length header 206.

real 21m55.991s
user 0m5.937s
sys 0m1.698s

The only logs on chef-server side, in /var/log/chef-server/, are these for nginx: access.log and error.log.

access.log:

188.37.253.127 - - [22/Apr/2014:09:51:17 +0000] “PUT /bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398159865&Signature=kXJpijoKemcQZA96ZVJydQG1JVc%3D HTTP/1.1” 403 “1310.623” 0 “-” “Chef Knife/11.12.2 (ruby-1.9.3-p484; ohai-7.0.2; x86_64-linux; +http://opscode.com)” “127.0.0.1:4321” “403” “0.002” “11.12.2” “algorithm=sha1;version=1.0;” “tch” “2014-04-22T09:29:25Z” “WCBVdNihGqn06wwwcqjsjzwCAPw=” 164108882

error.log:

2014/04/22 09:51:16 [error] 22184#0: *40 readv() failed (104: Connection reset by peer) while reading upstream, client: 188.37.253.127, server: chef01.sys, request: “PUT /bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398159865&Signature=kXJpijoKemcQZA96ZVJydQG1JVc%3D HTTP/1.1”, upstream: “http://127.0.0.1:4321/bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398159865&Signature=kXJpijoKemcQZA96ZVJydQG1JVc%3D”, host: “chef01.sys:443”

The link speed to the chef server from my laptop is around 150 kB/s.

Let me know what other information do you may need.


Tomasz Chmielewski
http://wpkg.org


#9

On 2014-04-22 11:04, Tomasz Chmielewski wrote:

try updating chef on your desktop. if you’re running 11.12.2 and
seeing this, then you’d need to cut a bug report, but we’d need more
information like output of knife cookbook upload -V and as much
context as you can give.

Hi,

I’m running 11.12.2 already:

(…)

If I upload the cookbooks from a location with a faster link, it works
fine.

So the problem basically is a combination of a file which is large
enough and/or a link which is slow enough; it would be great if a task
like cookbook uploading success or failure didn’t depend on on these
factors (at least, not so much, or give a clear explanation and a
possible fix).


Tomasz Chmielewski
http://wpkg.org


#10

Hello there,

It appears that you haven’t actually reset your s3_url_ttl value.

Here’s a bit of exploration into the expiry times:

irb(main):008:0> t1 = DateTime.parse(“22/Apr/2014 09:51:17 +0000”).to_time
=> 2014-04-22 02:51:17 -0700
irb(main):009:0> t2 = Time.at(1398159865)
=> 2014-04-22 02:44:25 -0700
irb(main):010:0> t1 < t2
=> false

The runtime of your upload is 22 mins, and the expiry is 7 prior to the
failed request, which leaves the ttl at 900s, not the 1800 that you said
intended to change it to.

Did you simply change it in the chef_server_running.json file? That won’t
fully do the trick, in fact, that’s just a state dump of the running server
once it’s been configured, so manually changing values there won’t help.

Follow the guide on this page (linked directly to the value to change -
http://docs.opscode.com/config_rb_chef_server.html#erchef) for updating
/etc/chef-server/chef-server.rb and reconfiguring your server.

HTH!

On Tue, Apr 22, 2014 at 5:14 AM, Tomasz Chmielewski tch@wpkg.org wrote:

On 2014-04-22 11:04, Tomasz Chmielewski wrote:

try updating chef on your desktop. if you’re running 11.12.2 and

seeing this, then you’d need to cut a bug report, but we’d need more
information like output of knife cookbook upload -V and as much
context as you can give.

Hi,

I’m running 11.12.2 already:

(…)

If I upload the cookbooks from a location with a faster link, it works
fine.

So the problem basically is a combination of a file which is large enough
and/or a link which is slow enough; it would be great if a task like
cookbook uploading success or failure didn’t depend on on these factors (at
least, not so much, or give a clear explanation and a possible fix).


Tomasz Chmielewski
http://wpkg.org


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


#11

On Tue, Apr 22, 2014 at 2:27 AM, Tomasz Chmielewski tch@wpkg.org wrote:

I can understand your point for some cases, but there are lots of valid

reasons to use chef to serve files of that size anyway.

Can you enumerate on these reasons? There are lots of reasons why you DON’T
want to do this as well.

  • Every time a developer checks out the cookbook repo for the first
    time, they’re downloading multiple large files
  • If a developer has a slow connection, they can’t upload the cookbooks
    in a reasonable time
  • When these files change, it will exacerbate this problem
  • If a node needs a cookbook but doesn’t need the large file, it still
    has to download the large file

The chef server wasn’t designed to serve multi-hundred MB artifacts. It was
designed to serve JSON data, text files, and templates. It CAN do it, but
that doesn’t mean you should. Don’t be surprised if you find more tunable
values that you’ll need to change when you attempt to work out of the box
like this.

Don’t get me wrong, I’m not telling you not to do this or that I know
what’s best for you and your infrastructure. You’re the ultimate decision
maker there. I’m just warning you about the pitfalls you may encounter when
straying from the beaten path. You’ve obviously already hit some of those,
and you’re still in the stages of uploading cookbooks. Good luck in your
journey!


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


#12

On Apr 22, 2014, at 4:27 AM, Tomasz Chmielewski tch@wpkg.org wrote:

First of all, I don’t recommend that you store files in your
cookbooks that are 100-200MB in size, but I’ll try and help you debug
this a bit.

I can understand your point for some cases, but there are lots of valid
reasons to use chef to serve files of that size anyway.

Chef is not designed to serve in the role of a large binary repository. There are other tools that are much better suited to do that sort of thing, and IMO you should use the right tool for the job.

Chef does a lot of things well, but there are some things that it does not do at all, or does not do well. This is one of those things.

If you want to take a hammer and use it to drive in all your screws, you shouldn’t be surprised if the result is something … less than you had hoped for.


Brad Knowles brad@shub-internet.org
LinkedIn Profile: http://tinyurl.com/y8kpxu


#13

On 2014-04-22 15:57, Stephen Delano wrote:

On Tue, Apr 22, 2014 at 2:27 AM, Tomasz Chmielewski tch@wpkg.org
wrote:

I can understand your point for some cases, but there are lots of
valid
reasons to use chef to serve files of that size anyway.

Can you enumerate on these reasons? There are lots of reasons why you
DON’T want to do this as well.

Basically, that’s simplicity, especially for smaller deployments.

  • no need to set up a separate webserver for file serving

  • no need to worry about separate webserver auth, SSL certificates,
    credentials,

  • lower learning curve for Chef - once I’m able to do simple things
    (uploading a single file should be a simple thing), I can jump to more
    complicated ones

  • “large file” turned out to be ~150 MB for my link, but could be 10 MB
    for someone else with a slower link. Also, I’d argue if most people
    reading this have ~150 MB in mind if they read “multi-hundred MB
    artifact”

  • if Chef wasn’t designed to serve files of some sizes, it should
    complain about it (i.e. “WARN: file XYZ is larger than 10 MB, this
    exceeds Chef design”); not fail with unclear reason,

  • official documentation for cookbook_file,
    http://docs.opscode.com/resource_cookbook_file.html, or
    http://docs.opscode.com/essentials_cookbook_files.html, does not mention
    potential file size issues - but could be I wasn’t looking in the right
    place.

Of course I find your all points valid, too.


Tomasz Chmielewski
http://wpkg.org


#14

On 4/22/14, 3:04 AM, Tomasz Chmielewski wrote:

On Mon, 21 Apr 2014 21:00:54 -0700
Lamont Granquist lamont@opscode.com wrote:

On 4/21/14, 6:00 PM, Tomasz Chmielewski wrote:

ERROR: Chef::Exceptions::ContentLengthMismatch: Response body
length 0 does not match HTTP Content-Length header 206.

try updating chef on your desktop. if you’re running 11.12.2 and
seeing this, then you’d need to cut a bug report, but we’d need more
information like output of knife cookbook upload -V and as much
context as you can give.
Hi,

I’m running 11.12.2 already:

$ dpkg -l|grep chef
ii chef 11.12.2-1 amd64 The full stack of chef

Here is the output with -V:

$ time knife cookbook upload mmaww-staging -V
Uploading mmaww-staging [1.0.0]
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
INFO: Saving mmaww-staging
INFO: Uploading files
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/files/default/mysql-setup.sh (checksum hex = 4160124bf8a905a0e5dc1aa419135909) to https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-4160124bf8a905a0e5dc1aa419135909?AWSAccessKeyId=…&Expires=1398159865&Signature=YNVBVPwN82OPwmiOgy41VmQB1jw%3D
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/files/default/mongo-setup.sh (checksum hex = 8abcd332a3bb0d3d284dbe0d83322fde) to https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-8abcd332a3bb0d3d284dbe0d83322fde?AWSAccessKeyId…&Expires=1398159865&Signature=DBHn7Bp8fo16o9CQ%2Bg8gDdIQhH0%3D
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/files/default/mongo-td_stage.tar.xz (checksum hex = 95d55edf3a75d5358a424d843c3e8463) to https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398159865&Signature=kXJpijoKemcQZA96ZVJydQG1JVc%3D
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/recipes/default.rb (checksum hex = 9cb5ef6dbb6db3811a1108ac5f990efc) to https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-9cb5ef6dbb6db3811a1108ac5f990efc?AWSAccessKeyId=…&Expires=1398159865&Signature=GgeSQKQ373PW1lWTpWOE%2BC3RfkU%3D
INFO: HTTP Request Returned 403 Forbidden:
ERROR: Chef::Exceptions::ContentLengthMismatch: Response body length 0 does not match HTTP Content-Length header 206.

Can you try ‘knife --version’ and see if you’re picking up knife from a
different location than your omnibus chef install?


#15

Did the configuration changes help?

On Tue, Apr 22, 2014 at 11:50 AM, Lamont Granquist lamont@opscode.comwrote:

On 4/22/14, 3:04 AM, Tomasz Chmielewski wrote:

On Mon, 21 Apr 2014 21:00:54 -0700
Lamont Granquist lamont@opscode.com wrote:

On 4/21/14, 6:00 PM, Tomasz Chmielewski wrote:

ERROR: Chef::Exceptions::ContentLengthMismatch: Response body
length 0 does not match HTTP Content-Length header 206.

try updating chef on your desktop. if you’re running 11.12.2 and
seeing this, then you’d need to cut a bug report, but we’d need more
information like output of knife cookbook upload -V and as much
context as you can give.

Hi,

I’m running 11.12.2 already:

$ dpkg -l|grep chef
ii chef 11.12.2-1
amd64 The full stack of chef

Here is the output with -V:

$ time knife cookbook upload mmaww-staging -V
Uploading mmaww-staging [1.0.0]
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
INFO: Saving mmaww-staging
INFO: Uploading files
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/files/default/mysql-setup.sh
(checksum hex = 4160124bf8a905a0e5dc1aa419135909) to
https://chef01.sys:443/bookshelf/organization-
00000000000000000000000000000000/checksum-4160124bf8a905a0e5dc1aa4191359
09?AWSAccessKeyId=…&Expires=1398159865&Signature=
YNVBVPwN82OPwmiOgy41VmQB1jw%3D
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/files/default/mongo-setup.sh
(checksum hex = 8abcd332a3bb0d3d284dbe0d83322fde) to
https://chef01.sys:443/bookshelf/organization-
00000000000000000000000000000000/checksum-8abcd332a3bb0d3d284dbe0d83322f
de?AWSAccessKeyId…&Expires=1398159865&Signature=
DBHn7Bp8fo16o9CQ%2Bg8gDdIQhH0%3D
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/
files/default/mongo-td_stage.tar.xz (checksum hex =
95d55edf3a75d5358a424d843c3e8463) to https://chef01.sys:443/
bookshelf/organization-00000000000000000000000000000000/checksum-
95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=
1398159865&Signature=kXJpijoKemcQZA96ZVJydQG1JVc%3D
INFO: Uploading /home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/recipes/default.rb
(checksum hex = 9cb5ef6dbb6db3811a1108ac5f990efc) to
https://chef01.sys:443/bookshelf/organization-
00000000000000000000000000000000/checksum-9cb5ef6dbb6db3811a1108ac5f990e
fc?AWSAccessKeyId=…&Expires=1398159865&Signature=
GgeSQKQ373PW1lWTpWOE%2BC3RfkU%3D
INFO: HTTP Request Returned 403 Forbidden:
ERROR: Chef::Exceptions::ContentLengthMismatch: Response body length 0
does not match HTTP Content-Length header 206.

Can you try ‘knife --version’ and see if you’re picking up knife from a
different location than your omnibus chef install?


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


#16

I’ve uploaded from a faster location, and I hope I won’t be needing to
do large uploads again :slight_smile: (and if I need to, I’ll follow your advices
and use an external server to store the files).


Tomasz Chmielewski
http://wpkg.org

On 2014-04-22 20:05, Stephen Delano wrote:

Did the configuration changes help?

On Tue, Apr 22, 2014 at 11:50 AM, Lamont Granquist
lamont@opscode.com wrote:

On 4/22/14, 3:04 AM, Tomasz Chmielewski wrote:
On Mon, 21 Apr 2014 21:00:54 -0700
Lamont Granquist lamont@opscode.com wrote:

On 4/21/14, 6:00 PM, Tomasz Chmielewski wrote:
ERROR: Chef::Exceptions::ContentLengthMismatch: Response body
length 0 does not match HTTP Content-Length header 206.

try updating chef on your desktop. if you’re running 11.12.2 and
seeing this, then you’d need to cut a bug report, but we’d need
more
information like output of knife cookbook upload -V and as much
context as you can give.
Hi,

I’m running 11.12.2 already:

$ dpkg -l|grep chef
ii chef
11.12.2-1
amd64 The full stack of chef

Here is the output with -V:

$ time knife cookbook upload mmaww-staging -V
Uploading mmaww-staging [1.0.0]
INFO: Validating ruby files
INFO: Validating templates
INFO: Syntax OK
INFO: Saving mmaww-staging
INFO: Uploading files
INFO: Uploading
/home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/files/default/mysql-setup.sh
(checksum hex = 4160124bf8a905a0e5dc1aa419135909) to
https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-4160124bf8a905a0e5dc1aa419135909?AWSAccessKeyId=…&Expires=1398159865&Signature=YNVBVPwN82OPwmiOgy41VmQB1jw%3D
[1]
INFO: Uploading
/home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/files/default/mongo-setup.sh
(checksum hex = 8abcd332a3bb0d3d284dbe0d83322fde) to
https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-8abcd332a3bb0d3d284dbe0d83322fde?AWSAccessKeyId…&Expires=1398159865&Signature=DBHn7Bp8fo16o9CQ%2Bg8gDdIQhH0%3D
[2]
INFO: Uploading
/home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/files/default/mongo-td_stage.tar.xz
(checksum hex = 95d55edf3a75d5358a424d843c3e8463) to
https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398159865&Signature=kXJpijoKemcQZA96ZVJydQG1JVc%3D
[3]
INFO: Uploading
/home/tch/Desktop/…/chef-repo/cookbooks/mmaww-staging/recipes/default.rb
(checksum hex = 9cb5ef6dbb6db3811a1108ac5f990efc) to
https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-9cb5ef6dbb6db3811a1108ac5f990efc?AWSAccessKeyId=…&Expires=1398159865&Signature=GgeSQKQ373PW1lWTpWOE%2BC3RfkU%3D
[4]
INFO: HTTP Request Returned 403 Forbidden:
ERROR: Chef::Exceptions::ContentLengthMismatch: Response body length
0 does not match HTTP Content-Length header 206.

Can you try ‘knife --version’ and see if you’re picking up knife from
a different location than your omnibus chef install?


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104

Links:

[1]
https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-4160124bf8a905a0e5dc1aa419135909?AWSAccessKeyId=…&Expires=1398159865&Signature=YNVBVPwN82OPwmiOgy41VmQB1jw%3D
[2]
https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-8abcd332a3bb0d3d284dbe0d83322fde?AWSAccessKeyId…&Expires=1398159865&Signature=DBHn7Bp8fo16o9CQ%2Bg8gDdIQhH0%3D
[3]
https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-95d55edf3a75d5358a424d843c3e8463?AWSAccessKeyId=…&Expires=1398159865&Signature=kXJpijoKemcQZA96ZVJydQG1JVc%3D
[4]
https://chef01.sys:443/bookshelf/organization-00000000000000000000000000000000/checksum-9cb5ef6dbb6db3811a1108ac5f990efc?AWSAccessKeyId=…&Expires=1398159865&Signature=GgeSQKQ373PW1lWTpWOE%2BC3RfkU%3D


Tomasz Chmielewski