Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Writing report file fails (json/cyclonedx json) #874

@oddcb

Description

@oddcb

What happened:

After updating to syft 0.41.0 writing cyclonedx files fail. Both for json and xml.

Running

syft packages sonatype/nexus:pro-2.11.3-01 -v -o cyclonedx-json --file nexus-pro-2.11.3.json

gives:

(....)
[0023]  WARN unable to convert relationship from CycloneDX 1.3 JSON, dropping: {From:Pkg(name="python-libs" version="2.7.5-16.el7" type="rpm" id="f6e0ce12fa86058e") To:Pkg(name="wsgiref" version="0.1.2" type="python" id="b2c1f33571a69567") Type:ownership-by-file-overlap Data:{Files:[/usr/lib64/python2.7/wsgiref.egg-info]}}
[0023]  WARN unable to convert relationship from CycloneDX 1.3 JSON, dropping: {From:Pkg(name="python-pycurl" version="7.19.0-17.el7" type="rpm" id="888b745b29eddfa5") To:Pkg(name="pycurl" version="7.19.0" type="python" id="eab7a7e530e408b0") Type:ownership-by-file-overlap Data:{Files:[/usr/lib64/python2.7/site-packages/pycurl-7.19.0-py2.7.egg-info]}}
[0023]  WARN unable to convert relationship from CycloneDX 1.3 JSON, dropping: {From:Pkg(name="python-urlgrabber" version="3.10-6.el7" type="rpm" id="d36722766bd35a7d") To:Pkg(name="urlgrabber" version="3.10" type="python" id="20826a0880f972dc") Type:ownership-by-file-overlap Data:{Files:[/usr/lib/python2.7/site-packages/urlgrabber-3.10-py2.7.egg-info]}}
[0023]  WARN unable to show catalog image finished event: unable to show package catalog report: 1 error occurred:
	* write nexus-pro-2.11.3.json: file already closed


[0023]  WARN unable to write to report destination: %!w(*multierror.Error=&{[0xc013b6c000] <nil>})

Also:

syft packages sonatype/nexus:pro-2.11.3-01 -v -o json --file nexus-pro-2.11.3.json
[0000]  INFO syft version: 0.41.0
[0012]  INFO identified distro: CentOS Linux 7 (Core)
[0012]  INFO cataloging image
[0019]  WARN unable to show catalog image finished event: unable to show package catalog report: 1 error occurred:
	* write nexus-pro-2.11.3.json: file already closed


[0019]  WARN unable to write to report destination: %!w(*multierror.Error=&{[0xc00c22f710] <nil>})

What you expected to happen:

The json-file to be written

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

There is free disk space.

Environment:

  • Output of syft version:

Application: syft
Version: 0.41.0
BuildDate: 2022-03-07T18:09:31Z
GitCommit: 5123f07
GitDescription: v0.41.0
Platform: darwin/amd64
GoVersion: go1.17.7
Compiler: gc

Installed via Homebrew.

  • OS (e.g: cat /etc/os-release or similar): MacOS 12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions