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

Yaml format for Dataflow report returns error #1506

Closed
saurabhlime opened this issue Feb 20, 2024 · 1 comment · Fixed by #1517
Closed

Yaml format for Dataflow report returns error #1506

saurabhlime opened this issue Feb 20, 2024 · 1 comment · Fixed by #1517
Assignees
Labels
bug Something isn't working

Comments

@saurabhlime
Copy link

Description & Reproduction

There is an error when generating a dataflow report in the yaml format

Expected Behavior

Actual Behavior

Analyzing codebase
⠹ (211303/-) [0s]
Loading rules
Scanning target .
└ 100% [===============] (3315/3315) [23s]
Running Detectors
Generating dataflow
panic: duplicated key 'filename' in struct types.Error [recovered]
panic: duplicated key 'filename' in struct types.Error

goroutine 1 [running]:
gopkg.in/yaml%2ev3.handleErr(0x1400650c9e8)
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/yaml.go:294 +0x80
panic({0x106a073e0?, 0x1400a79b9e0?})
/Users/runner/hostedtoolcache/go/1.21.5/x64/src/runtime/panic.go:914 +0x218
gopkg.in/yaml%2ev3.(*encoder).structv(0x14001a0f800, {0x0, 0x0}, {0x106a9ef40?, 0x1400aff8240?, 0x106ae3260?})
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:217 +0xe0
gopkg.in/yaml%2ev3.(*encoder).marshal(0x14001a0f800, {0x0, 0x0}, {0x106a9ef40?, 0x1400aff8240?, 0x104a0cd74?})
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:168 +0x6f4
gopkg.in/yaml%2ev3.(*encoder).slicev(0x14001a0f800, {0x0?, 0x0}, {0x1069b0240?, 0x1400a5603d8?, 0x104dc9cdc?})
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:281 +0x178
gopkg.in/yaml%2ev3.(*encoder).marshal(0x14001a0f800, {0x0, 0x0}, {0x1069b0240?, 0x1400a5603d8?, 0x0?})
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:170 +0x6b4
gopkg.in/yaml%2ev3.(*encoder).structv.func1()
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:235 +0x1ac
gopkg.in/yaml%2ev3.(*encoder).mappingv(0x14001a0f800, {0x0?, 0x0}, 0x1400650c2d8)
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:265 +0xfc
gopkg.in/yaml%2ev3.(*encoder).structv(0x14001a0f800, {0x0, 0x0}, {0x106af0560?, 0x1400a560360?, 0x0?})
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:219 +0xc0
gopkg.in/yaml%2ev3.(*encoder).marshal(0x14001a0f800, {0x0, 0x0}, {0x106af0560?, 0x1400a560360?, 0x0?})
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:168 +0x6f4
gopkg.in/yaml%2ev3.(*encoder).marshal(0x14001a0f800, {0x0, 0x0}, {0x106998f60?, 0x1400a560360?, 0x0?})
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:166 +0x694
gopkg.in/yaml%2ev3.(*encoder).marshal(0x14001a0f800, {0x0, 0x0}, {0x1069fae20?, 0x1400a39b930?, 0x0?})
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:162 +0x624
gopkg.in/yaml%2ev3.(*encoder).marshal(0x14001a0f800, {0x0, 0x0}, {0x1069ab3e0?, 0x1400a39b930?, 0x104de2f4c?})
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:166 +0x694
gopkg.in/yaml%2ev3.(*encoder).marshalDoc(0x14001a0f800, {0x0, 0x0}, {0x1069ab3e0?, 0x1400a39b930?, 0xb2d05e00?})
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/encode.go:105 +0x11c
gopkg.in/yaml%2ev3.Marshal({0x1069ab3e0, 0x1400a39b930})
/Users/runner/go/pkg/mod/gopkg.in/yaml.v3@v3.0.1/yaml.go:222 +0x270
github.com/bearer/bearer/internal/util/output.ReportYAML({0x106998f60, 0x1400a560360})
/Users/runner/work/bearer/bearer/internal/util/output/output.go:110 +0x6c
github.com/bearer/bearer/internal/report/output/dataflow.Formatter.Format({0x14001a3ea00, {0x0, {0x8bb2c97000, 0x12a05f200, 0x6fc23ac00, 0x3e8, 0xdf8475800, 0x1e8480, {0x0, 0x0}}, ...}}, ...)
/Users/runner/work/bearer/bearer/internal/report/output/dataflow/formatter.go:27 +0xf8
github.com/bearer/bearer/internal/report/output.FormatOutput(, {0x0, {0x8bb2c97000, 0x12a05f200, 0x6fc23ac00, 0x3e8, 0xdf8475800, 0x1e8480, {0x0, 0x0}}, ...}, ...)
/Users/runner/work/bearer/bearer/internal/report/output/output.go:128 +0x6ec
github.com/bearer/bearer/internal/commands/artifact.(*runner).Report(0x14001caefc0, {0x14002018000?, 0xcf3, 0x8?}, 0x0?)
/Users/runner/work/bearer/bearer/internal/commands/artifact/run.go:425 +0x430
github.com/bearer/bearer/internal/commands/artifact.Run({
, _}, {{{0x16b40389f, 0x4}, {0x16b40388d, 0x8}, {0x0, 0x0}, 0x140010eb110, 0x140010eb140, ...}, ...})
/Users/runner/work/bearer/bearer/internal/commands/artifact/run.go:343 +0x590
github.com/bearer/bearer/internal/commands.NewScanCommand.func2(0x140012a9200, {0x1400054bc80?, 0x1, 0x6})
/Users/runner/work/bearer/bearer/internal/commands/scan.go:87 +0x2bc
github.com/spf13/cobra.(*Command).execute(0x140012a9200, {0x1400054bc20, 0x6, 0x6})
/Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0x840
github.com/spf13/cobra.(*Command).ExecuteC(0x140012a8600)
/Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(0x105a21a84?)
/Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039 +0x1c
main.main()
/Users/runner/work/bearer/bearer/cmd/bearer/main.go:12 +0x40

Possible Fix

Your Environment

  • Operating System and version:
    Software:

    System Software Overview:

    System Version: macOS 12.4 (21F79)
    Kernel Version: Darwin 21.5.0
    Boot Volume: Untitled
    Boot Mode: Normal
    Computer Name: <HIDDEN>
    User Name: <HIDDEN>
    Secure Virtual Memory: Enabled
    System Integrity Protection: Enabled
    
  • Output of 'bearer version':

bearer version 1.38.0
sha: a40d59aa6c98a55b5389e7675ed58a4c094632c6
@saurabhlime saurabhlime added the bug Something isn't working label Feb 20, 2024
@saurabhlime saurabhlime changed the title Yaml format for Dataflow report Yaml format for Dataflow report returns error Feb 20, 2024
@gotbadger gotbadger self-assigned this Feb 22, 2024
@gotbadger
Copy link
Contributor

Thanks for this report the trace really helped me out on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants