Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting non-fatal 400 posting to capture endpoint during initial converge in bootstrap #8532

Closed
Vasu1105 opened this issue May 14, 2019 · 15 comments · Fixed by #8767
Closed

Comments

@Vasu1105
Copy link
Collaborator

Vasu1105 commented May 14, 2019

Description

While doing knife bootstrap it gives following error
ERROR: Failed to post reporting data to server (HTTP 400), saving to c:/chef/cache/failed-reporting-data.json

This does not affect the bootstrap process though.
This probably should be the 404 error as I don't have any reporting enabled and there is no any configuration for Automate 2 also in my config file. It's a simple bootstrap.

Chef Version

Latest Chef 15 version

Platform Version

Windows-2012R2

Replication Case

Just run any knife bootstrap command and use latest Chef 15 release version for bootstrap.

knife bootstrap ec2-54-185-185-29.us-west-2.compute.amazonaws.com -o winrm --node-name vj-winrmssl --connection-user 'Administrator' --connection-password 'password' --connection-port 5986 --winrm-auth-method 'ssl' -c ~/workspace/chef-repo/.chef/knife.rb --bootstrap-version '15.0.293' --winrm-ssl -r 'recipe[windows_task::default]' --winrm-ssl-peer-fingerprint '<certificate-thumbpring>' -E developement -VV

Client Output


Stacktrace

[ec2-54-185-185-29.us-west-2.compute.amazonaws.com] resolving cookbooks for run list: ["windows_task::default"]
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com] Synchronizing Cookbooks:
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com]   - windows_task (0.1.0)
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com] Installing Cookbook Gems:
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com] Compiling Cookbooks...
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com] Converging 2 resources
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com] Recipe: windows_task::default
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com]   * windows_task[chef-client 1] action create
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com]     - windows_task[chef-client 1] task created
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com]   * windows_task[TestTask] action create (up to date)
DEBUG: [WinRM] Waiting for output...
DEBUG: [WinRM] Processing output
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com] 
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com] Running handlers:
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com] Running handlers complete
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com] Chef Infra Client finished, 1/2 resources updated in 11 seconds
 [ec2-54-185-185-29.us-west-2.compute.amazonaws.com] [2019-05-10T19:35:53+00:00] ERROR: Failed to post reporting data to server (HTTP 400), saving to c:/chef/cache/failed-reporting-data.json
DEBUG: [WinRM] cleaning up command_id: 9443BE5E-71B4-40BD-8283-E0111B2E469B on shell_id 58BB214A-3FA6-4C11-806A-606D2CF970CF
DEBUG: [WinRM] @ec2-54-185-185-29.us-west-2.compute.amazonaws.com<{:transport=>:ssl, :disable_sspi=>false, :basic_auth_only=>false, :endpoint=>"https://ec2-54-185-185-29.us-west-2.compute.amazonaws.com:5986/wsman", :user=>"Administrator", :password=>"<hidden>", :no_ssl_peer_verification=>false, :realm=>nil, :service=>nil, :ca_trust_file=>nil, :ssl_peer_fingerprint=>"B98C229959C37F95736F282692786AA8A747E691"}> (If (Test-Path "C:/Users/Administrator/AppData/Local/Temp/86836a04-07c4-4ff5-bd7d-e625bdea9a8f/bootstrap.bat") { Remove-Item -Force -Path "C:/Users/Administrator/AppData/Local/Temp/86836a04-07c4-4ff5-bd7d-e625bdea9a8f/bootstrap.bat" })
DEBUG: [WinRM] Command created for If (Test-Path "C:/Users/Administrator/AppData/Local/Temp/86836a04-07c4-4ff5-bd7d-e625bdea9a8f/bootstrap.bat") { Remove-Item -Force -Path "C:/Users/Administrator/AppData/Local/Temp/86836a04-07c4-4ff5-bd7d-e625bdea9a8f/bootstrap.bat" }
if (!$?) { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } } with id: 27BD1DEA-4F97-47BE-BC4D-61ED303B65F6
DEBUG: [WinRM] creating command_id: 27BD1DEA-4F97-47BE-BC4D-61ED303B65F6 on shell_id 58BB214A-3FA6-4C11-806A-606D2CF970CF
DEBUG: [WinRM] Waiting for output...
DEBUG: [WinRM] Processing output
@Vasu1105 Vasu1105 added the Status: Untriaged An issue that has yet to be triaged. label May 14, 2019
@kvivek1115
Copy link
Contributor

Facing the same issue on windows node with ssh connection with latest stable chef 15.0.193 node side.
Also, this issue is not reproduced on Ubuntu node.

Seems this is not something related to knife bootstrap it raised when chef-client trying to log the end run a report on chef server.
same code work if node having chef-14 version.

begin
rest_client.raw_request(:POST, resource_history_url, headers({ "Content-Encoding" => "gzip" }), compressed_data)
rescue StandardError => e

might be @lamont-granquist can guide us better on this?

Need to check the chef-server logs will try standalone setup of chef server and reproduce the issue.

Thanks

@marcparadise marcparadise changed the title Getting 400 error while doing knife bootstrap Getting non-fatal 400 posting to capture endpoint during initial converge in bootstrap May 14, 2019
@kvivek1115
Copy link
Contributor

Hey, I have tested with latest chef-server version 12.18.14 it works fine.

We have faced this issue only on manage.chef.io so might require to update chef-server version on chef-manage as well?

@Vasu1105
Copy link
Collaborator Author

Vasu1105 commented May 15, 2019

@vsingh-msys yes I am also testing with hosted Chef.

@kmf
Copy link

kmf commented May 15, 2019

I'm getting the same issues. Using the latest Automate.

@kvivek1115
Copy link
Contributor

kvivek1115 commented May 16, 2019

Hi @kmf, I have setup the latest chef-automate and configured data collector over chef-server. Seems works fine for Ubuntu node. could you please let me more detail about the ur automate setup and step that you followed to reproduce the issue?
Thanks

@kmf
Copy link

kmf commented May 16, 2019

@vsingh-msys I'm using chef-server-core-12.17.33 / Automate 20190506101326 ...
I guess we'll upgrade out Chef Server :D

@kmf
Copy link

kmf commented May 16, 2019

Upgraded, still the same issue.

@kmf
Copy link

kmf commented May 16, 2019

Created another issue explaining the problem : #8557

@lamont-granquist
Copy link
Contributor

so same as #8557 need to get -l trace data for this failure to see what automate is actually returning

@kvivek1115
Copy link
Contributor

kvivek1115 commented May 20, 2019

Hi @lamont-granquist Attached chef-client trace logs of hosted chef manage seems issue looks like
API params resources have invalid element {"error":["Invalid element in array value of 'resources'"]}

Running handlers:
[2019-05-20T08:51:52+00:00] INFO: Running report handlers
Running handlers complete
[2019-05-20T08:51:52+00:00] INFO: Report handlers complete
Chef Infra Client finished, 1/1 resources updated in 05 seconds
[2019-05-20T08:51:52+00:00] INFO: Sending resource update report (run-id: 210b13c6-a269-4aa5-95a5-376ca4a1f0bb)
[2019-05-20T08:51:52+00:00] TRACE: {"action"=>"end", "resources"=>[{"type"=>:log, "name"=>"Welcome to Chef, Sam Doe!", "
id"=>"Welcome to Chef, Sam Doe!", "after"=>{:message=>"Welcome to Chef, Sam Doe!", :level=>:info}, "before"=>{}, "durati
on"=>6, "delta"=>"", "result"=>"write", "cookbook_name"=>"starter", "cookbook_version"=>"1.0.0"}], "status"=>"success",
"run_list"=>"[\"recipe[starter::default]\"]", "total_res_count"=>"1", "data"=>{}, "start_time"=>"2019-05-20 08:51:51 UTC
", "end_time"=>"2019-05-20 08:51:52 +0000", "expanded_run_list"=>"{\"id\":\"_default\",\"run_list\":[{\"type\":\"recipe\
",\"name\":\"starter::default\",\"version\":null,\"skipped\":false}]}"}
[2019-05-20T08:51:52+00:00] TRACE: Sending compressed run data...
[2019-05-20T08:51:52+00:00] TRACE: Signing the request as azure-win
[2019-05-20T08:51:52+00:00] TRACE: String to sign: 'Method:POST
Hashed Path:foPSk9RlaTgwxHXJ+HKDZ42KLrQ=
X-Ops-Content-Hash:tUkFLcaTH7uZhxKJXfuy2Ei7nV0=
X-Ops-Timestamp:2019-05-20T08:51:52Z
X-Ops-UserId:dzP+WltTFevlGiKeCCwQO5NvXs8='
[2019-05-20T08:51:52+00:00] TRACE: Header hash: {"X-Ops-Sign"=>"algorithm=sha1;version=1.1;", "X-Ops-Userid"=>"azure-win
", "X-Ops-Timestamp"=>"2019-05-20T08:51:52Z", "X-Ops-Content-Hash"=>"tUkFLcaTH7uZhxKJXfuy2Ei7nV0=", "X-Ops-Authorization
-1"=>"hG8e2Sc+2IOoCnLD00KSehgrOomzN0SGPEDBB67eMURrNUZCyf7sHzbDKQIZ", "X-Ops-Authorization-2"=>"O7fu6F1dF83WRotQ4CfX7Cb8s
lRQtYHT4L3dCOc843rSKZOO0vWPBXhGERcR", "X-Ops-Authorization-3"=>"7ZQLtgunidKReac2SAE+DiM7DfQGmG6Mb7capqCBDrsCcDLRLOpxpoF7
HMIm", "X-Ops-Authorization-4"=>"5QFmGiBhZEYbSfcnuy+hmtmteS+unDtkdmIbpXKg6DPFFggmJr7Z5Gg1RaUq", "X-Ops-Authorization-5"=
>"9iaheMYJaom7ybHP9C73GRYDeGQDOM+d0apRbQ/ThzjTGJR7qMejMSHdfOjS", "X-Ops-Authorization-6"=>"HJenLYKXrpjAj7T52zKH64xbXNZyn
Zacq4lwRmb9xA=="}
[2019-05-20T08:51:52+00:00] TRACE: Initiating POST to https://api.chef.io/organizations/viveksingh_msys/reports/nodes/az
ure-win/runs/210b13c6-a269-4aa5-95a5-376ca4a1f0bb
[2019-05-20T08:51:52+00:00] TRACE: ---- HTTP Request Header Data: ----
[2019-05-20T08:51:52+00:00] TRACE: X-Ops-Reporting-Protocol-Version: 0.1.0
[2019-05-20T08:51:52+00:00] TRACE: Content-Encoding: gzip
[2019-05-20T08:51:52+00:00] TRACE: X-Ops-Server-API-Version: 1
[2019-05-20T08:51:52+00:00] TRACE: X-OPS-SIGN: algorithm=sha1;version=1.1;
[2019-05-20T08:51:52+00:00] TRACE: X-OPS-USERID: azure-win
[2019-05-20T08:51:52+00:00] TRACE: X-OPS-TIMESTAMP: 2019-05-20T08:51:52Z
[2019-05-20T08:51:52+00:00] TRACE: X-OPS-CONTENT-HASH: tUkFLcaTH7uZhxKJXfuy2Ei7nV0=
[2019-05-20T08:51:52+00:00] TRACE: X-OPS-AUTHORIZATION-1: hG8e2Sc+2IOoCnLD00KSehgrOomzN0SGPEDBB67eMURrNUZCyf7sHzbDKQIZ
[2019-05-20T08:51:52+00:00] TRACE: X-OPS-AUTHORIZATION-2: O7fu6F1dF83WRotQ4CfX7Cb8slRQtYHT4L3dCOc843rSKZOO0vWPBXhGERcR
[2019-05-20T08:51:52+00:00] TRACE: X-OPS-AUTHORIZATION-3: 7ZQLtgunidKReac2SAE+DiM7DfQGmG6Mb7capqCBDrsCcDLRLOpxpoF7HMIm
[2019-05-20T08:51:52+00:00] TRACE: X-OPS-AUTHORIZATION-4: 5QFmGiBhZEYbSfcnuy+hmtmteS+unDtkdmIbpXKg6DPFFggmJr7Z5Gg1RaUq
[2019-05-20T08:51:52+00:00] TRACE: X-OPS-AUTHORIZATION-5: 9iaheMYJaom7ybHP9C73GRYDeGQDOM+d0apRbQ/ThzjTGJR7qMejMSHdfOjS
[2019-05-20T08:51:52+00:00] TRACE: X-OPS-AUTHORIZATION-6: HJenLYKXrpjAj7T52zKH64xbXNZynZacq4lwRmb9xA==
[2019-05-20T08:51:52+00:00] TRACE: HOST: api.chef.io:443
[2019-05-20T08:51:52+00:00] TRACE: X-REMOTE-REQUEST-ID: 210b13c6-a269-4aa5-95a5-376ca4a1f0bb
[2019-05-20T08:51:52+00:00] TRACE: Content-Length: 340
[2019-05-20T08:51:52+00:00] TRACE: ---- End HTTP Request Header Data ----
[2019-05-20T08:51:53+00:00] TRACE: ---- HTTP Status and Header Data: ----
[2019-05-20T08:51:53+00:00] TRACE: HTTP 1.1 400 Bad Request
[2019-05-20T08:51:53+00:00] TRACE: date: Mon, 20 May 2019 08:51:51 GMT
[2019-05-20T08:51:53+00:00] TRACE: server: openresty/1.11.2.1
[2019-05-20T08:51:53+00:00] TRACE: content-length: 59
[2019-05-20T08:51:53+00:00] TRACE: connection: Close
[2019-05-20T08:51:53+00:00] TRACE: ---- End HTTP Status/Header Data ----
[2019-05-20T08:51:53+00:00] TRACE: ---- HTTP Response Body ----
[2019-05-20T08:51:53+00:00] TRACE: {"error":["Invalid element in array value of 'resources'"]}
[2019-05-20T08:51:53+00:00] TRACE: ---- End HTTP Response Body -----
[2019-05-20T08:51:53+00:00] TRACE: ---- HTTP Request Body ----
@v☺↔T#��<�ʧ�↑e:♂S♠G쬣���mtr��@☼�A↕�t►u���S☺��X{>�/�♠|�.���\��eo��]����ҙ:v�y��I↑e0→∟��O�/i♦�♦e
�ç�|J~�T�Q♥▲�tU�b'�r͡&6� � 1��Ѥ����L2��9L♦5K*��i��6e���jW�ao�{
j���m���"�D����j↑0���8�‼L?k��+Y☻  x��vf$
[2019-05-20T08:51:53+00:00] TRACE: ---- End HTTP Request Body ----
[2019-05-20T08:51:53+00:00] INFO: HTTP Request Returned 400 Bad Request:
[2019-05-20T08:51:53+00:00] ERROR: Failed to post reporting data to server (HTTP 400), saving to c:/chef/cache/failed-re
porting-data.json

@jeffbyrnes
Copy link

I can confirm that I’m seeing the same

TRACE: {"error":["Invalid element in array value of 'resources'"]}

as @vsingh-msys reports above with their trace-level logs.

Version info:

jeffbyrnes@aws-jb:/etc/datadog-agent$ chef-client -v
Chef Infra Client: 15.0.300

and I’m using Hosted Chef.

@xacaxulu
Copy link

+1

@glasschef
Copy link
Contributor

This seems to be due to the duration field no longer using .to_i.to_s, so the non-stringified integer breaks the legacy Reporting ingestion:

https://github.com/chef/chef/blob/master/lib/chef/resource_reporter.rb#L38

lamont-granquist added a commit that referenced this issue Jul 23, 2019
Somehow this got converted to a bare integer in Chef-15 refactoring
which causes the server-side to reject it, so reverting back to the
old format.

Closes #8532

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
@stellarsquall
Copy link

+1

Any bootstrap I perform with Hosted Chef using Chef 15 produces this result.

@lock
Copy link

lock bot commented Aug 16, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 16, 2019
kaypeter87 added a commit to kaypeter87/chef that referenced this issue Aug 26, 2019
* Bump version to 15.1.34 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump train-core to 2.1.13

This pull request was triggered automatically via Expeditor when train-core 2.1.13 was promoted to Rubygems.

This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required.

* Bump version to 15.1.35 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Add Chef 15.1 release notes

Add the release notes for Chef 15.1

Signed-off-by: Tim Smith <tsmith@chef.io>

* Move the perf improvements to 15.0

The majority of this work actually happened in 15.0

Signed-off-by: Tim Smith <tsmith@chef.io>

* Update RELEASE_NOTES.md

Signed-off-by: Tim Smith <tsmith@chef.io>

Co-Authored-By: mjingle <mjingle@users.noreply.github.com>

* Update RELEASE_NOTES.md

Signed-off-by: Tim Smith <tsmith@chef.io>

Co-Authored-By: mjingle <mjingle@users.noreply.github.com>

* Update RELEASE_NOTES.md

Signed-off-by: Tim Smith <tsmith@chef.io>

Co-Authored-By: mjingle <mjingle@users.noreply.github.com>

* Update RELEASE_NOTES.md

Signed-off-by: Tim Smith <tsmith@chef.io>

Co-Authored-By: mjingle <mjingle@users.noreply.github.com>

* Update RELEASE_NOTES.md

Signed-off-by: Tim Smith <tsmith@chef.io>

Co-Authored-By: mjingle <mjingle@users.noreply.github.com>

* Update RELEASE_NOTES.md

Signed-off-by: Tim Smith <tsmith@chef.io>

Co-Authored-By: mjingle <mjingle@users.noreply.github.com>

* Update RELEASE_NOTES.md

Signed-off-by: Tim Smith <tsmith@chef.io>

Co-Authored-By: mjingle <mjingle@users.noreply.github.com>

* Update RELEASE_NOTES.md

Signed-off-by: Tim Smith <tsmith@chef.io>

Co-Authored-By: mjingle <mjingle@users.noreply.github.com>

* Remove the performance mention

Some of it was in 15.0 and some in 15.1 and it's tricky to call out the
impact and the exact time that stuff landed so let's skip it

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.1.36 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Update the codeowners format

** isn't what we wanted here

Signed-off-by: Tim Smith <tsmith@chef.io>

* Update CHANGELOG.md to reflect the promotion of 15.1.36

Obvious fix; these changes are the result of automation not creative thinking.

* Bump inspec-core to 4.6.9

This pull request was triggered automatically via Expeditor when inspec-core 4.6.9 was promoted to Rubygems.

This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required.

* Bump version to 15.1.37 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* update bldr config with new package name

This should fix package promotion from unstable->current in expeditor,
too.

Signed-off-by: Robb Kidd <robb@thekidds.org>

* Bump version to 15.1.38 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.1.39 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* fixes for chefstyle bump

result of automation

chef/chefstyle#72

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Bump version to 15.1.40 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* fix Layout/AlignArguments

this is using:

Layout/AlignArguments:
  Enabled: true
  EnforcedStyle: with_fixed_indentation

the default style can use really excessive whitespace.  on starting
lines which are already long, it fully indents across to where the
arguments start and then begins the line there.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* expeditor/buildkite: turn on debug level for builds

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* missing a colon?

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Bump version to 15.1.41 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* fix Layout/EmptyLineAfterGuardClause

i like this one, gives visual priority to returns or raises that are
buried in the middle of things.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Style/SymbolArray

start enforcing using %i{} instead of arrays of symbols

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Style/MethodCallWithoutArgsParentheses

zero args methods don't get parens.

this certainly reads better than the inverse.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Layout/MultilineMethodCallIndentation

Layout/MultilineMethodCallIndentation:
  Enabled: true
  EnforcedStyle: indented

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* tweak Lint/BlockAlignment

Lint/BlockAlignment:
  Enabled: true
  EnforcedStyleAlignWith: start_of_block

this works better with Layout/MultilineMethodCallIndentation to
force indentation of multiline method calls that wind up with multiline
blocks.

i'd probably pull back the end to match with the start of the expression
but this gets the indentation level inside the block correct.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Style/EmptyMethod

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* fix bugs from Style/SymbolArray autocorrect cop

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* fix more Style/SymbolArray autocorrect bugs

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Parse day param value into string

Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>

* Deprecate Ubuntu-14

Signed-off-by: Jaymala Sinha <jsinha@chef.io>

* Bump version to 15.1.42 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Style/EmptyLiteral

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Style/NegatedIf

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Style/RegexpLiteral

given how many regexps we have with /'s in the match this seems like
a very good one.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Style/ClassCheck

convert kind_of? to is_a?

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Style/StringLiteralsInInterpolation

since we use double quotes, be consistent everywhere.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Style/SymbolProc

enforce pretzels.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* fix 4 cops

- Layout/MultilineMethodCallBraceLayout
- Layout/ClosingParenthesisIndentation
- Layout/IndentFirstArgument
  EnforcedStyle: consistent
- Layout/BlockEndNewline

the first of these autocorrected to horrible looking code which exposed
that we really needed the other three as well, which also cleaned up a
bunch of other terrible looking code.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* lazy procs are instance_exec in the resource already

exposed by Style/SymbolProc mangling some bad code.

no idea how this ever worked.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Improve generation of docs site resource pages

1) Fix the indentation
2) Avoid extra new lines
3) Show example data if we have it
4) Chef Infra Client vs. the Chef Infra Client

Signed-off-by: Tim Smith <tsmith@chef.io>

* Use the funky marketing names for Chef Client

Also prevent more extra spaces

Signed-off-by: Tim Smith <tsmith@chef.io>

* Fix more line endings

Signed-off-by: Tim Smith <tsmith@chef.io>

* Chefstyle fixes

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.1.43 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.1.44 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Style/NegatedUnless

found one.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* fix multiline string

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Bump version to 15.1.45 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Add examples to the resources

Add examples in markdown to the resources. We'll be using this on the
docs site in the future and if we need to display it we can use
tty-markdown which does a really nice job of displaying markdown in the
terminal

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.1.46 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump inspec-core to 4.7.3

This pull request was triggered automatically via Expeditor when inspec-core 4.7.3 was promoted to Rubygems.

This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required.

* Remove rspec config for Travis

We're running this all in buildkite w/o issues.

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump openSSL to 1.0.2s

This is a bugfix only release.

Signed-off-by: Tim Smith <tsmith@chef.io>

* Roll back Rubygems to 3.0.3 to prevent double bundler install

There's nothing important in this release other than a few minor bugfixes. The other alternative was to roll bundler forward to 1.17.3 so that the embedded rubygems bundler matched, but this meant we had bundler 1.17.2 built into ruby 2.6.3 and then 1.17.3 installed on top of that. There's little value in that and it bloats our package size. Let's not do that unless there's a critical bug or CVE we need in rubygems / bundler.

This also bumps omnibus-software to include the new ruby cleanup def that fails if we have double bundler and the new rubygems def that removes the rubygems-update gem once rubygems is installed.

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.1.47 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.1.48 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Fix the codeowners to work correctly

Github skips empty groups even if they have child groups that have users
in them.

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.1.49 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.1.50 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Pull in latest omnibus-software to fix Windows builds

Signed-off-by: Bryan McLellan <btm@loftninjas.org>

* Bump version to 15.1.51 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Fix RDoc copy-pasta in Chef::Mixin::ParamsValidate#validate

Signed-off-by: Reuben Garrett <ruby@rubydono.net>

The RDoc for `Chef::Mixin::ParamsValidate#validate`
appears to have inadvertently copied the (helpful)
inline pseudocode of the `:is` option to the `:equal_to` option
in commit 28f17b3.

Obvious fix.

* Remove the rspec kitchen tests

We're not longer using these

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.1.52 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.1.53 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* create application base class for de-duplication

all of the changes in this commit should be mechanical and identical

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* normalize fetch_recipe_tarball

this makes solo behave like client does.

client was modified in these pulls:

chef#7223
chef#7523

but those changes were never "ported" to solo.

* add --once to base class

this was not present in chef-solo for whatever reason even though
the code is there, it has always been broken

* change some uses of CLIENT to PRODUCT in the base class

* copy --ez to base class

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* add --target-mode to base class

this adds it to chef-solo

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Copy the daemon loop from client to base

These improvements never made it into solo and should be backwards
compatible.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* migrate --delete-entire-chef-repo to base class

this is a trivial duplication

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* missing SELF_PIPE for the daemon loop

* add some comments on deprecation of the solo class

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* --fips, --fatal-windows-admin-check and --disable-config

should fix fips mode for chef-solo, adds the windows admin check
feature, but the distable-config option needs some future work to the
base class to support it.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* consolidate some options in the base class

most of these are options that apply to either chef-client -z or
to chef-solo without legacy mode, so they are justifiably common
options (that are handled by the trampolining into the Client
code from Solo right now.

the --legacy-mode switch is solo-specific (although we should wire it
up for chef-client eventually once all the code is merged).

old-reporting and skip-cookbook-sync only make sense for actual
chef-client runs so are marked as such in the help text

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* support named run list on commandline in solo

this has to fix a bug for someone.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Tidy up awkward reading comment

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Implement disable for disabling kernel_modules

This allows inspec kernel_module be_disabled to work

Signed-off-by: Tom Doherty <tom.doherty@fixnetix.com>

* test that inspec binstub is in the omnibus artifact

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Bump version to 15.1.54 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* only check for the embedded/bin file being there

we've never wired up the symlinks, they should be owned by the
inspec package instead.  we require these to exist though and this
catches if inspec-core-bin slips out of the installed gemfile.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Bump version to 15.1.55 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* dnf_package fixes for RHEL8

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* allow_downgrades by default

somewhere we broke this along the way and had no test coverage for DNF
apparently

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* only test these on rhel >= 8 where they work

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Bump version to 15.1.56 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Remove leftover rspec testing config in travis

Signed-off-by: Tim Smith <tsmith@chef.io>

* Remove travis notifications

Signed-off-by: Tim Smith <tsmith@chef.io>

* Run our Kitchen test on Ruby 2.6

Signed-off-by: Tim Smith <tsmith@chef.io>

* Add rspec testing on Fedora in Buildkite

Let's further verify our changes before merging.

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.1.57 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.1.58 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump InSpec, Ohai, and appbundler to the latest

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.2.0 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.2.1 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump train-core to 2.1.19

This pull request was triggered automatically via Expeditor when train-core 2.1.19 was promoted to Rubygems.

This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required.

* Bump version to 15.2.2 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Duration field in resource report needs to be String

Somehow this got converted to a bare integer in Chef-15 refactoring
which causes the server-side to reject it, so reverting back to the
old format.

Closes chef#8532

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Update bzip2 from 1.0.6 -> 1.0.8 to resolve CVEs

* bzip2recover: Fix use after free issue with outFile (CVE-2016-3189)
* Make sure nSelectors is not out of range (CVE-2019-12900)

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.2.3 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.2.4 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Tweak data collector exception handling

This isn't Java and Net::HTTP can throw a billion things, so just rescue
(nearly) everything.  I have a hard time imagining that there's a
failure here that we wouldn't want to ignore, other than the ones like
OOM thrown by Exception that indicate internal failures.

Also only throw the "this is normal" info message on 404s, other
responses like 500s should be warns even if it is set to ignore
failures (people with data collectors correctly setup need to know about
500s even if we keep going, since that is abnormal).

This also fixes a bug in handling exceptions like Timeout::Error which
do not have a response.code at all which would throw NoMethodError.

closes chef#8749

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* drop the info message down to debug

a 404 is probably unlikely in any circumstance other than when the user
really does not intend to use the data collector at all (hosted,
automate 1, older chef servers, etc).

i don't know how you'd get into a situation where the user wanted to
setup the data collector against an automate 2 server, but the
data collector endpoint didn't exist -- presumably because they
accidentally pointed it at a valid old chef server accidentally, which
is going to be an incredibly infrequent edge condition.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* and don't forget to fix the test i just added...

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Bump version to 15.2.5 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Fix zypper test failures

Resolve error from kill for leftover rspec processes

Cloud testers have as many as 10 zypper repos configured and enabled, so the zypper searches from specs take longer to run on our testers as too many repos with most of them enabled were slowing down the zypper process, locking it during the test runs and failing the zypper package functional tests. Since we do not use these repos in our testing we delete them.

Signed-off-by: Jaymala Sinha <jsinha@chef.io>

* Bump version to 15.2.6 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Property: Reorder comparison with NOT_PASSED.

The original comparison `value == NOT_PASSED` ends up calling `.<=>` on
value under the hood. This relies on the implementation of `<=>`/`cmp`
not being broken in that class.

Unfortunately, some classes like OpenSSL::X509::Name have broken
implementations of `<=>` that raise TypeError instead of returning nil
for mismatched types. ruby/openssl#264

As a result, currently, if you attempt to set a resource property to an
OpenSSL::X509::Name object, the result is a TypeError.

With this change, we use the implementation of comparison from the
NOT_PASSED object instead, which we know will work no matter what.

Signed-off-by: Andy Brody <git@abrody.com>

* Enable RHEL 8 packages

Signed-off-by: Jaymala Sinha <jsinha@chef.io>

* Update Gemfile.lock to latest omnibus

Signed-off-by: Jaymala Sinha <jsinha@chef.io>

* Bump version to 15.2.7 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Enable Kitchen dockken tests with BK linux executor

Signed-off-by: Jaymala Sinha <jsinha@chef.io>

* Bump version to 15.2.8 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump mixlib-shellout to 3.0.7

This pull request was triggered automatically via Expeditor when mixlib-shellout 3.0.7 was promoted to Rubygems.

This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required.

* Remove Travis / Jenkins config / docs

Update some of our build docs to reflect the current process. Nuke the old Travis config. We're Buildkite + appveyor only at this point.

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.2.9 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.2.10 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Cleanup habitat/plan.sh for chef-infra-client

Signed-off-by: Salim Afiune <afiune@chef.io>

* Update .bldr.toml

Signed-off-by: Salim Afiune <afiune@chef.io>

* Add artifactory to omnibus/Gemfile and update omnibus gem

A new version of omnibus is required and the artifactory gem
is required for the publish part of the build stage.

Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>

* Fix platform names in release.omnibus.yml

Fix platform names in release.omnibus.yml to conform with what
the new package publishing code in the omnibus gem expects.

Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>

* Bump inspec-core-bin to 4.10.4

This pull request was triggered automatically via Expeditor when inspec-core-bin 4.10.4 was promoted to Rubygems.

This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required.

* Bump Ohai to 15.2.4 with Openstack improvements

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.2.11 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.2.12 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* fix regex matching interface name with dash

Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>

* fix knife node environment set

Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>

* preserve earlier output pattern with correct fix

Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>

* Fix for rhsm_repo disable does not support wildcard

Signed-off-by: Kapil chouhan <kapil.chouhan@msystechnologies.com>

* fix to avoid conflicts with pattern of other data

Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>

* Make temp dir using mkdir instead of mktemp
 - mktemp does not exist for AIX system.

Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>

* Stop building Chef Infra Client on SLES 11

As of March 31st 2019, SLES 11 is no longer generally supported. Per our
support process we will no longer officially support SLES 11.

See https://docs.chef.io/platforms.html#platform-end-of-life-policy

Signed-off-by: Tim Smith <tsmith@chef.io>

* fix review comments

Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>

* Fix chown: Operation not permitted
 - Added sudo chown to fix permission denied error.

Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>

* Bump version to 15.2.13 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.2.14 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.2.15 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.2.16 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.2.17 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.2.18 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Add comment to property call method order

Let's make sure we don't revert this by accident

Signed-off-by: Tim Smith <tsmith@chef.io>

* Consistently use NOT_PASSED over alternatives

We have four different versions of this now, and this converts to
just using the one convention in `lib/chef/constants.rb`

Interestingly `Chef::NIL_ARGUMENT` is used nowhere in the codebase, that
probably got refactored out in 12.5.1.

Node objects still use `NIL` but that is a different kind of `Object.new`
which really is semantically private to the implementation of
attributes.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Bump version to 15.2.19 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Add retries to the GitHub PRs in Buildkite

We keep seeing random failures on our PRs.  This resolves that.

Signed-off-by: Tim Smith <tsmith@chef.io>

* Fix config level

Signed-off-by: Tim Smith <tsmith@chef.io>

* Revert the zypper test failures fix

We don't need this fix anymore. Updating the test systems
resolved the issue.

Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>

* Bump ohai to 15.2.5

This pull request was triggered automatically via Expeditor when ohai 15.2.5 was promoted to Rubygems.

This change falls under the obvious fix policy so no Developer Certificate of Origin (DCO) sign-off is required.

* Remove explicit debug log level from omnibus pipelines

The omnibus pipelines now default to "internal" log
level so setting this here is no longer necessary.

Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>

* Bump version to 15.2.20 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Add Chef 15.2 release notes

Signed-off-by: Tim Smith <tsmith@chef.io>

* Update release notes per docs review

Signed-off-by: Tim Smith <tsmith@chef.io>

* Another release notes update

This was actually wrong

Signed-off-by: Tim Smith <tsmith@chef.io>

* Update CHANGELOG.md to reflect the promotion of 15.2.20

Obvious fix; these changes are the result of automation not creative thinking.

* Improve the auto-generated docs

Formatting fixes and updates to the text to make the generated text match what's currently on the site.

Signed-off-by: Tim Smith <tsmith@chef.io>

* Hide a state property from the docs

Signed-off-by: Tim Smith <tsmith@chef.io>

* Backport another description from the docs site

Signed-off-by: Tim Smith <tsmith@chef.io>

* Fix Chef Client vs. Chef Infra Client logic

It helps to not pass a nil in

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.2.21 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Update the link to our release cadence information

Don't link to a boneyard repo anymore

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.2.22 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Add unified_mode switch for resources

This is inspired by "use_inline_resources".

Setting `unified_mode false` in a resource would be the existing
behavior with separate compile/converge phases.

Setting `unified_mode true` in a resource will eliminate the converge
phase.  Reverse notifications and delayed notifications will still
fire.  The resource action will behave like all resources are executing
at compile time.

As a aside, notifications have never worked for resources firing at
compile time.  This implementation gets that behavior correct so
that notifications will work.

Of course forward immediate notifications to resources not yet declared will not
be possible.

Setting `resource_unified_mode_default true` in `Chef::Config` would
turn off the split compile/converge mode for every custom resource.

NOTE: This does not affect recipe mode at all.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Stop building Chef Infra Client on FreeBSD 10

Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>

* Updated knife cookbook metadata from file command banner
- Added file in banner

Signed-off-by: Amol Shinde <amol.shinde@msystechnologies.com>

* Bump version to 15.2.23 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Begin signing MSI's with renewed Windows Signing Cert

Signed-off-by: Seth Chisamore <schisamo@chef.io>

* Bump version to 15.2.24 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* remove debugging

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>

* Update omnibus build deps to the latest

Pull in the latest omnibus and omnibus-software updates.

Signed-off-by: Tim Smith <tsmith@chef.io>

* Bump version to 15.2.25 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.2.26 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Fix crash when showing error about missing profile

Before:

    /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/chef-config-15.1.36/lib/chef-config/mixin/credentials.rb:92:in `load_credentials': undefined local variable or method `credentials_file' for #<ChefConfig::WorkstationConfigLoader:0x00007fe01c8321e8> (NameError)

After:

    ERROR: CONFIGURATION ERROR:Profile xyz doesn't exist. Please add it to /Users/developer/.chef/credentials.

It looks like this was missed as part of the refactoring in
d730505.

Signed-off-by: Andrew Neitsch <andrew@neitsch.ca>

* Add AIX 7.2 tester

Signed-off-by: Jaymala Sinha <jsinha@chef.io>

* Bump version to 15.2.27 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* Bump version to 15.2.28 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.

* updated code according to regex

Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>

* Fix the build arguments in the Dockerfile

We need to support the prefixed `EXPEDITOR_` build arguments in our
Dockerfile. We are leaving the non-prefixed arguments in there for
back-compat.

Signed-off-by: Tom Duffield <tom@chef.io>

* Bump version to 15.2.29 by Chef Expeditor

Obvious fix; these changes are the result of automation not creative thinking.
@lamont-granquist lamont-granquist removed the Status: Untriaged An issue that has yet to be triaged. label Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants