Skip to content

Conversation

bennyyang11
Copy link

Description, Motivation and Context

This PR fixes a critical file path matching issue where textAnalyze analyzers consistently return "No matching file" errors when used with exec collector outputs.

Problem: File path structure mismatch causes preflight check failures

  • Exec collectors store files in nested paths: {collector}/{namespace}/{pod}/{collector}-stdout.txt
  • TextAnalyze analyzers expect simple paths: {collector}/{fileName}
  • Users get frustrated "No matching file" errors despite files being collected successfully

Root Cause: The exec collector saves output to deeply nested directory structures but the textAnalyze analyzer constructs search paths using only the collector name and filename, missing the intermediate namespace/pod directories.

Solution: Added intelligent auto-matching logic that:

  1. Detects exec output files (*-stdout.txt, *-stderr.txt, *-errors.json)
  2. Automatically converts simple filenames to wildcard patterns (collector/*/*/file.txt)
  3. Preserves existing wildcard patterns (no modification if user already provided them)
  4. Only affects exec files - regular files work exactly as before

Customer Impact: This resolves support tickets where users report broken preflight checks when trying to analyze exec command outputs. Now users can use simple filenames like my-collector-stdout.txt instead of having to guess nested paths like */*/my-collector-stdout.txt.

Checklist

  • New and existing tests pass locally with introduced changes.
  • Tests for the changes have been added (for bug fixes / features)
  • The commit message(s) are informative and highlight any breaking changes
  • Any documentation required has been added/updated. For changes to https://troubleshoot.sh/ create a PR here

Does this PR introduce a breaking change?

  • Yes
  • No

@bennyyang11 bennyyang11 added the type::feature New feature or request label Sep 18, 2025
@bennyyang11 bennyyang11 force-pushed the fix/exec-textanalyze-path-clean branch from a0df5dc to 4b39dde Compare September 18, 2025 17:46
- Auto-detect exec output files (*-stdout.txt, *-stderr.txt, *-errors.json)
- Convert simple filenames to wildcard patterns automatically
- Preserve existing wildcard patterns
- Fixes 'No matching file' errors for exec + textAnalyze workflows
@bennyyang11 bennyyang11 force-pushed the fix/exec-textanalyze-path-clean branch from 4b39dde to f407f22 Compare September 18, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants