Skip to content

Debug logging causes panic while looking for secrets to redact #12459

Closed
@obi1kenobi

Description

A cargo metadata call spuriously causes a panic while downloading dependencies, possibly during a time of intermittent network issues on GitHub. The panic is in some cargo debug logging code that is attempting to redact secret information like cookies as headers are being logged.

Error:

thread 'main' panicked at 'byte index 14 is not a char boundary; it is inside 'ꓦ' (bytes 12..15) of `>iꓦ>iꓦ>iꓦ>iꓦ>iꓦ>i`', src/cargo/ops/registry.rs:715:17

The line in question:

line[..line.len().min(text.len())].eq_ignore_ascii_case(text)

Log file:
error.log

Similar issues here:
https://github.com/libp2p/rust-libp2p/actions/runs/5782756485/job/15670482772#step:41:715
https://github.com/libp2p/rust-libp2p/actions/runs/5782750882/job/15670392407

Underlying cause of: obi1kenobi/cargo-semver-checks#513

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions