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

json-file, unable to save file on a windows system #173

username-is-already-taken2 opened this Issue Dec 2, 2016 · 3 comments


None yet
4 participants

username-is-already-taken2 commented Dec 2, 2016

Cookbook version


Chef-client version


Platform Details

Windows 2012 R2


Trying to save the compliance report to disk using the json-file collector

Steps to Reproduce:

  "audit": {
    "collector": [

Expected Result:

should write the file

Actual Result:

Client run errors and no file is written to disk

[2016-12-02T12:07:44+00:00] WARN: Writing report to file.
[2016-12-02T12:07:44+00:00] WARN: Filename is c:/chef/cache/cookbooks/audit/inspec-2016-12-02_12:07:44_UTC.json
[2016-12-02T12:07:44+00:00] ERROR: Report handler Chef::Handler::AuditReport raised #<Errno::EINVAL: Invalid argument @rb_sysopen - c:/chef/cache/cookbooks/audit/inspec-2016-12-02_12:07:44_UTC.json>

This comment has been minimized.


chris-rock commented Dec 2, 2016

@username-is-already-taken2 Great finding. A colon is an invalid character for a windows file name. We need to change the way the filename is generated


This comment has been minimized.


jeremymv2 commented Dec 3, 2016

I propose we use'%Y%m%d%H%M%S')

This will result in a more sort friendly file name, for example:

irb(main):022:0> "inspec-#{'%Y%m%d%H%M%S')}.json"
=> "inspec-20161202222307.json"

@jeremymv2 jeremymv2 referenced this issue Dec 3, 2016


change json-file filename #177

0 of 4 tasks complete

@binamov binamov added the in progress label Dec 3, 2016


This comment has been minimized.


chris-rock commented Dec 5, 2016

#177 fixed that issue. @username-is-already-taken2 let us know if the issue continues to persist

@chris-rock chris-rock closed this Dec 5, 2016

@chris-rock chris-rock removed the in progress label Dec 5, 2016

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