Skip to content

GetEvaluableContent fails on binary material content #2963

Closed

Description

@jiparis

Problem

GetEvaluableContent in pkg/attestation/crafter/api/attestation/v1/crafting_state.go attempts to JSON-decode all material content, which fails for binary materials with errors like:

ERR adding material: error applying policy groups to material: failed to parse input: invalid character '\x7f' looking for beginning of value

The call chain is:

  1. crafter.go → PolicyGroupVerifier.VerifyMaterial()
  2. policy_groups.go:81 → material.GetEvaluableContent(path)
  3. crafting_state.go:158-159 → json.Decoder.Decode() fails on non-JSON content

Expected behavior

GetEvaluableContent should detect binary or non-JSON content and either skip policy evaluation for those materials or handle them gracefully instead of returning an error.

Current behavior

Any material with binary content (e.g., containing control characters like \x7f) causes policy group evaluation to fail, blocking the attestation add command.

Activity

  1. jiparis commented on Mar 30, 2026

    @jiparis
    MemberAuthor

    Bug introduced in #2954 (GetEvaluableContent is called no matter of it being evaluated)

  2. self-assigned this
    on Mar 30, 2026
  3. added a commit that references this issue on Mar 30, 2026
    4ca8373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

User BugbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions