Skip to content

Instantly share code, notes, and snippets.

@groknaut
Created November 17, 2015 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save groknaut/db2c2fefa79f6cc638ad to your computer and use it in GitHub Desktop.
Save groknaut/db2c2fefa79f6cc638ad to your computer and use it in GitHub Desktop.
knife upload 400 error
/opt/opscode/bin/knife upload /cookbooks -c /path/to/knife.rb --force -VV
INFO: Using configuration from /path/to/knife.rb
..snip for brevity
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: openresty/1.7.10.1
DEBUG: date: Mon, 16 Nov 2015 23:23:31 GMT
DEBUG: content-type: application/json
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"1","response_version":"1"}
DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.2.0
DEBUG: content-encoding: gzip
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: HTTP server did not include a Content-Length header in response, cannot identify truncated downloads.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
INFO: Upload complete!
Updated cookbooks/yum-epel-0.6.0
..snip for brevity
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Signing the request as pivotal
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating PUT to https://localhost/organizations/org02/cookbooks/yum-mysql-community/0.1.12?force=true
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Content-Type: application/json
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.0;
DEBUG: X-OPS-USERID: pivotal
DEBUG: X-OPS-TIMESTAMP: 2015-11-16T23:23:31Z
DEBUG: X-OPS-CONTENT-HASH: g1SOvkYNIebogCyH/QpWF2WPA3I=
DEBUG: X-OPS-AUTHORIZATION-1: Sa7N05OcSvctc0ds1+xpmFuqETSxkwNtHe/Fh7fbXtQC3uJQXNylAIkEjp1t
DEBUG: X-OPS-AUTHORIZATION-2: kfAA9298qpiH1Em9wgnNYgHfbsrj26Nq8DCnBkj1sByIgx4XvJfloO811jq0
DEBUG: X-OPS-AUTHORIZATION-3: Dc+OKS52UV5p4Ll+L+9MLaIulhHuGqYBicAc9ZWvWkLlmsqpVwQdQKGxf/g6
DEBUG: X-OPS-AUTHORIZATION-4: wafMOHT6FzuEEC4YOqw55S8m8FVvP8FKJFEer6AxV3+K5aMS4AAMzBBVqwQp
DEBUG: X-OPS-AUTHORIZATION-5: rmf1o2ZYfdHPzJAGyahQSiarkEqzR+KRpGW3woUSKCkZ137JPkS+vnwgI6iH
DEBUG: X-OPS-AUTHORIZATION-6: 5ktbaoSKc7YOAKcaEBqzYQ/LLh4Cjb7RUIbk8dltWQ==
DEBUG: HOST: localhost:443
DEBUG: X-Ops-Server-API-Version: 1
DEBUG: X-REMOTE-REQUEST-ID: acdf403a-f8f3-4094-b3c6-8ada106268e3
DEBUG: Content-Length: 2641
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: openresty/1.7.10.1
DEBUG: date: Mon, 16 Nov 2015 23:23:31 GMT
DEBUG: content-type: application/json
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"1","response_version":"1"}
DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.2.0
DEBUG: content-encoding: gzip
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: HTTP server did not include a Content-Length header in response, cannot identify truncated downloads.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Signing the request as pivotal
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating PUT to https://localhost/organizations/org02/cookbooks/zookeeper/2.6.0?force=true
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Content-Type: application/json
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.0;
DEBUG: X-OPS-USERID: pivotal
DEBUG: X-OPS-TIMESTAMP: 2015-11-16T23:23:31Z
DEBUG: X-OPS-CONTENT-HASH: 6BXrdY7cdYAxsv6QSbuONg/Gu7c=
DEBUG: X-OPS-AUTHORIZATION-1: NdjiRp02QDc5qX9fM9DklF7hjs+mi3sjAqiMOolpRKwCkCJc2W1Qrben7LIv
DEBUG: X-OPS-AUTHORIZATION-2: LnqS8kvmyJ2O3QKZwrslRiEhPoP2b3Pd0QpsVPO6slVy8LYc/P9YiiwbYZD7
DEBUG: X-OPS-AUTHORIZATION-3: i7RanAyDM5eNp1n4JFJxsN0kk/nrAq7QKjkUiAHJhH5gKED94o22Sg0Iiozc
DEBUG: X-OPS-AUTHORIZATION-4: EYiVoff/YXHsBrjGFefnU4kP/XdOTA8XysAymxbCoVlMZT/AwqugxVVWQfmW
DEBUG: X-OPS-AUTHORIZATION-5: PpCrz/TsZIuwZL4BLGADeo9B6Gwog8Cgpo95hUK8YUKSjsTety+f2/XCaQVR
DEBUG: X-OPS-AUTHORIZATION-6: Sas85caFCL7IMY8GzEEot3g36Wp2HIgA1fcLZQ0+ag==
DEBUG: HOST: localhost:443
DEBUG: X-Ops-Server-API-Version: 1
DEBUG: X-REMOTE-REQUEST-ID: acdf403a-f8f3-4094-b3c6-8ada106268e3
DEBUG: Content-Length: 3301
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: openresty/1.7.10.1
DEBUG: date: Mon, 16 Nov 2015 23:23:31 GMT
DEBUG: content-type: application/json
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"1","response_version":"1"}
DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.2.0
DEBUG: content-encoding: gzip
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: HTTP server did not include a Content-Length header in response, cannot identify truncated downloads.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
INFO: Upload complete!
Updated cookbooks/yum-mysql-community-0.1.12
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: openresty/1.7.10.1
DEBUG: date: Mon, 16 Nov 2015 23:23:31 GMT
DEBUG: content-type: application/json
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"1","response_version":"1"}
DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.2.0
DEBUG: content-encoding: gzip
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: HTTP server did not include a Content-Length header in response, cannot identify truncated downloads.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
INFO: Upload complete!
Updated cookbooks/zookeeper-2.6.0
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Signing the request as pivotal
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating PUT to https://localhost/organizations/org02/cookbooks/mycompany-snort/0.1.1?force=true
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Content-Type: application/json
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.0;
DEBUG: X-OPS-USERID: pivotal
DEBUG: X-OPS-TIMESTAMP: 2015-11-16T23:23:32Z
DEBUG: X-OPS-CONTENT-HASH: iexBDgZRpQ3eIgJ234QMEI72Euc=
DEBUG: X-OPS-AUTHORIZATION-1: ZxAnoWf8Fzh+sNpJHc6Wc8W83jxh1CSD1zfFStkb4zIuGlEBgLJgB9zofN3d
DEBUG: X-OPS-AUTHORIZATION-2: S9sz4GzwIVCC+bPZwbBO9H912uEkjjmpPS0xUFhp5ln9ALu5yOWZqS8vP68j
DEBUG: X-OPS-AUTHORIZATION-3: M36NLO0FaR0QizlNH1gNwYGXk4I3v8AhH8I3UGzrfT2BTtif4+tKL1h7qSoo
DEBUG: X-OPS-AUTHORIZATION-4: GG0Jn0YCfxI/HPvISpX6qhtoSk0X/6q+s1JybEzotB0a24V1sVMaDiagNMyM
DEBUG: X-OPS-AUTHORIZATION-5: gN9RxOstPRjmE6lTGpyIeJPlBJ1GdM6vsQ9fJU4TxO7FkjGuivaLnIv0g+Ps
DEBUG: X-OPS-AUTHORIZATION-6: pdI6TU52h6AuweCacghz7aBhCyjQpthcymneXXeWlg==
DEBUG: HOST: localhost:443
DEBUG: X-Ops-Server-API-Version: 1
DEBUG: X-REMOTE-REQUEST-ID: acdf403a-f8f3-4094-b3c6-8ada106268e3
DEBUG: Content-Length: 237905
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: openresty/1.7.10.1
DEBUG: date: Mon, 16 Nov 2015 23:23:32 GMT
DEBUG: content-type: application/json
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"1","response_version":"1"}
DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.2.0
DEBUG: content-encoding: gzip
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: HTTP server did not include a Content-Length header in response, cannot identify truncated downloads.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
INFO: Upload complete!
Updated cookbooks/mycompany-snort-0.1.1
... error gets thrown:
ERROR: cookbooks failed to write: HTTP error writing: 400 "Bad Request" cause: {"error":["Field 'metadata.name' invalid"]}
@prithivip
Copy link

Hey, may know what did u do to fix this error ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment