Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"syntax error" while processing a file #2877

Open
rohitn opened this issue May 23, 2024 · 6 comments
Open

"syntax error" while processing a file #2877

rohitn opened this issue May 23, 2024 · 6 comments
Labels

Comments

@rohitn
Copy link

rohitn commented May 23, 2024

TruffleHog Version

trufflehog --version
trufflehog 3.76.3

Trace Output

Invocation
trufflehog git --no-update --no-verification --trace -j file:///data/REDACTED > ~/trufflehog.json 2> ~/log.txt

From log.txt

2024-05-23T02:09:30Z error trufflehog error processing AR files {"source_manager_worker_id": "awK83", "unit": "/data/REDACTED", "unit_kind": "dir", "commit": "1f3cb90", "path": "REDACTED/FpwLib.lib", "timeout": 30, "error": "error reading AR payload: strconv.Atoi: parsing "": invalid syntax"}

Expected Behavior

No errors

Actual Behavior

"invalid syntax" error

Steps to Reproduce

It is a private repository so I cannot provide steps to reproduce

Environment

  • OS: Ubuntu
  • Version 22.04.4 LTS
@rohitn rohitn added the bug label May 23, 2024
@rgmz
Copy link
Contributor

rgmz commented May 23, 2024

Source:

  1. https://github.com/paultag/go-debian/blob/246d63d4a8289011dff5db890058a7d9403f785a/deb/ar.go#L107
  2. https://github.com/paultag/go-debian/blob/246d63d4a8289011dff5db890058a7d9403f785a/deb/ar.go#L153
  3. https://github.com/paultag/go-debian/blob/246d63d4a8289011dff5db890058a7d9403f785a/deb/ar.go#L89
  4. arEntry, err := reader.Next()
    if err != nil {
    if errors.Is(err, io.EOF) {
    ctx.Logger().V(3).Info("AR archive fully processed")
    return nil
    }
    return fmt.Errorf("error reading AR payload: %w", err)

@rgmz
Copy link
Contributor

rgmz commented Jun 6, 2024

I opened a pull request for this in the upstream library: paultag/go-debian#130.

@rgmz
Copy link
Contributor

rgmz commented Jun 6, 2024

I opened a pull request for this in the upstream library: paultag/go-debian#130.

@ahrav Is there an optimal field order for string, *int64?
https://github.com/paultag/go-debian/blob/0efa67c1a811c738589ad900ef2ff8c6a4fed9c8/deb/ar.go#L131-L134

@ahrav
Copy link
Collaborator

ahrav commented Jun 6, 2024

I opened a pull request for this in the upstream library: paultag/go-debian#130.

@ahrav Is there an optimal field order for string, *int64? https://github.com/paultag/go-debian/blob/0efa67c1a811c738589ad900ef2ff8c6a4fed9c8/deb/ar.go#L131-L134

Either order should have the same effect. Personally, I prefer the string first in this case (how you have it), but both should work fine.

Thanks for tracking this down. 🙇

@ahrav
Copy link
Collaborator

ahrav commented Jun 6, 2024

This reminds me, there was also an issue with the rpmutils package causing an IOOR panic. I temporarily band-aided with a recover, but I should submit a proper fix upstream. 😅

@rgmz
Copy link
Contributor

rgmz commented Jun 26, 2024

No movement on the PR yet. It may end up being necessary to fork it to avoid this common and annoying error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants