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

Failure to print resource error message on Windows #3055

Closed
tyrken opened this issue Mar 11, 2015 · 2 comments · Fixed by #3357
Closed

Failure to print resource error message on Windows #3055

tyrken opened this issue Mar 11, 2015 · 2 comments · Fixed by #3357
Assignees
Labels
Platform: Windows Type: Bug Does not work as expected.

Comments

@tyrken
Copy link

tyrken commented Mar 11, 2015

Version:

Chef-Client 12.1.0

Environment:

Windows Server 2012 R2

Scenario:

Execute a chef-solo run & view the chef log

Steps to Reproduce:

Add an resource with a forced error, where the cookbooks are in a subdirectory starting with "p" like "C:\Windows\Temp\packer\cookbooks"

Expected Result:

Get the nice display listing the source code of the resource & its values

Actual Result:

C:/opscode/chef/embedded/apps/chef/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb:66: warning: invalid Unicode Property \p

What I think is happening is that the "file" variable in the below line has Windows back-slashes. Hence when used as a regex direct (without other processing or escaping) parts will be interpreted as special escape codes & so block the desired functionality. Not sure but would hope there's an easy way in ruby to regex-escape an arbitrary string.

https://github.com/chef/chef/blob/master/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb#L66

@lonniev
Copy link

lonniev commented May 8, 2015

My little one-liner recipe that states chocolatey wget also gets this nasty warning from resource_failure_inspector.rb.

I have seen other exceptions on Windows guests that cause the file-path-parser regex in this resource_failure_inspector.rb file to puke. Generally, it does not appear to be savvy about Windows pathname tokens.

@jaym
Copy link
Contributor

jaym commented May 8, 2015

That should probably the wrapped in a Regexp.escape

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Windows Type: Bug Does not work as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants