Skip to content

Compressing a directory with --unstructured fails on empty files with the error #2063

@junhaoliao

Description

@junhaoliao

Bug

Compressing a directory with --unstructured fails on empty files with the error:

Received input that was not unstructured logtext

When a directory containing empty log files (e.g., empty syslog rotation files) is compressed using
--unstructured, each empty file causes its compression task to fail. Non-empty files in the same
directory are compressed successfully, but the failed tasks are reported as errors.

Expected behavior: Empty files should be handled gracefully — either skipped silently or
compressed as empty archives — rather than treated as an error.

CLP version

main @ c48968d (0.9.1-dev)

Environment

  • OS: Ubuntu 24.04 (Linux 6.8.0-94-generic)
  • Docker: Docker Compose v2
  • Storage engine: clp-s

Reproduction steps

  1. Start CLP with default config:
    ./sbin/start-clp.sh
    
  2. Create a test directory with an empty file:
    mkdir -p /tmp/test-empty
    echo "2024-01-01 INFO some log line" > /tmp/test-empty/app.log
    touch /tmp/test-empty/empty.log
    
  3. Compress the directory with --unstructured:
    ./sbin/compress.sh --unstructured /tmp/test-empty
    
  4. The compression job reports task errors for each empty file:
    Received input that was not unstructured logtext
    
    Non-empty files are compressed successfully, but the overall job reports failures.

In the original test case, compressing ~/samples/hive-24hr (which contains empty syslog rotation
files) resulted in 7 of ~8 tasks reporting errors despite the non-empty data compressing successfully
(483 MB into 4.52 MB at 106.88x).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions