replicatedhq/troubleshoot

When redactors error, files do not get written back to the support bundle

banjoh opened this issue · 1 comments

banjoh commented

Bug Description

If any of the redactors have an error, any error, and the execution ends up here in this example, the file that was being redacted will not be written back to the support bundle. Instead, and empty file with two new lines will be there.

Expected Behavior

If there is an error from any of the redactors, the error should be logged an that redactor ignored. The file should continue getting redacted by the other redactors in the pipeline and the results written back to the support bundle.

Steps To Reproduce

  • Generate a file, with no newlines, larger than 10MB (the max size of a line to reduct)
base64 /dev/urandom | head -c 20000000 | tr -d '\n' > data.log
  • Collect a support bundle using the spec below - support-bundle spec.yaml
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: sample
spec:
  hostCollectors:
    - copy:
        collectorName: random-data
        path: <absolute_directory_of_generated_file>/data.log
  • Observe that the support bundle will have an empty version of your generated file
tar xf support-bundle-<timestamp>.tar.gz
cat support-bundle-<timestamp>/host-collectors/random-data/data.log

Include the following information.

  • Troubleshoot version. If you built from source, note that including the version of Go you used to build with.
  • Operating system
  • Operating system version
  • Other details that might be helpful in diagnosing the problem

If a redactor fails, we should not include that file in the final output since it may contain un-redacted information leading to a security breach.

We should, however, improve the error logging so that this can be diagnosed more cleanly.