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

Invalid JSON on stderr crashes Client #43

Merged
merged 2 commits into from
Aug 16, 2017
Merged

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Aug 16, 2017

The isJSON checked if the output was valid json of any type, but the
logger only unmarshaled into map[string]interface{}. If the line
didn't umarshal correctly, the error was only logged, but the actual
line was lost and the loop continued into a nil pointer dereference.

Always log the raw line if it can't unmarshal into a map.

Fixes hashicorp/terraform#15822

Verify that the Client logging can handle non key-value json output from
the client.
The isJSON checked if the output was valid json of any type, but the
logger only unmarshaled into `map[string]interface{}`. If the line
didn't umarshal correctly, the error was only logged, but the actual
line was lost and the loop continued into a nil pointer dereference.

Always log the raw line if it can't unmarshal into a map.
@jbardin jbardin added the bug label Aug 16, 2017
@jbardin jbardin merged commit a5174f8 into master Aug 16, 2017
@jbardin jbardin deleted the jbardin/stderr-json branch August 16, 2017 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants