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

Unable to convert from Github Generated SPDX to CycloneDX #370

Open
bhafner13 opened this issue May 22, 2024 · 2 comments
Open

Unable to convert from Github Generated SPDX to CycloneDX #370

bhafner13 opened this issue May 22, 2024 · 2 comments

Comments

@bhafner13
Copy link

Converting between SPDX (JSON) format to CycloneDX (JSON or XML) does not seem to work. To test it I:

  1. Downloaded an SPDX file from Gitub as a sample Firefox
  2. Downloaded the latest CLI tool
  3. Changed the name of the tool to make it easier to use from the command line
  4. I have attached the offending SPDX SBOM
  5. Attempted to do the conversion using the following command
    cyclonedx.exe convert --input-file firefox-ios_mozilla-mobile_5021.spdx --output-file firefox-ios_mozilla-mobile_5021.json --input-format spdxjson
  6. The following errors are reported:
    Unhandled exception: System.IO.FileNotFoundException: Could not find file 'C:\Users\tstUser\Desktop\tstFolder\firefox-ios_mozilla-mobile_5021.spdx'.
    File name: 'C:\Users\tstUser\Desktop\tstFolder\firefox-ios_mozilla-mobile_5021.spdx'
    at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
    at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
    at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
    at System.IO.File.OpenRead(String path)
    at CycloneDX.Cli.CliUtils.InputBomHelper(String filename, ConvertFormat format)
    at CycloneDX.Cli.Commands.ConvertCommand.Convert(ConvertCommandOptions options)
    at System.CommandLine.Invocation.CommandHandler.GetExitCodeAsync(Object value, InvocationContext context)
    at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
    at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext()
    --- End of stack trace from previous location ---
    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<b__0>d.MoveNext()
    --- End of stack trace from previous location ---
    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<b__0>d.MoveNext()
    --- End of stack trace from previous location ---
    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<b__1>d.MoveNext()
    --- End of stack trace from previous location ---
    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<b__0>d.MoveNext()
    --- End of stack trace from previous location ---
    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__24_0>d.MoveNext()
    --- End of stack trace from previous location ---
    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<b__0>d.MoveNext()
    --- End of stack trace from previous location ---
    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<b__0>d.MoveNext()
    --- End of stack trace from previous location ---
    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__10_0>d.MoveNext()
    --- End of stack trace from previous location ---
    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<b__0>d.MoveNext()
@mtsfoni
Copy link

mtsfoni commented May 22, 2024

Stack kind of clearly says it cannot find the file.
Could not find file 'C:\Users\tstUser\Desktop\tstFolder\firefox-ios_mozilla-mobile_5021.spdx'.

I assume you triple checked that the file is really there in the right folder and the name is written 100% correctly and so on.
Maybe try the absolute path after --input-file

@bhafner13
Copy link
Author

bhafner13 commented May 22, 2024 via email

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

No branches or pull requests

2 participants