phylum-dev / cli

Command line interface for the Phylum API
https://phylum.io
GNU General Public License v3.0
103 stars 11 forks source link

Unexpected birdcage error #1427

Open kylewillmon opened 4 months ago

kylewillmon commented 4 months ago

The following error was obvserved in the phylum-ci docker image...

root@6f5596df19f4:/phylum# phylum parse -t msbuild Foo.csproj
thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/birdcage-0.7.1/src/linux/mod.rs:49:9:
`Sandbox::spawn` must be called from a single-threaded process
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

:exclamation: Error: Could not parse dependency file "Foo.csproj" as "msbuild" type

Caused by:
    Dependency file parsing failed

This is a surprise for two reason:

  1. This is a lockfile. No generation is required, so sandboxing is not expected. (See the phylum docs)
  2. I thought CLI was a single-threaded process...
kylewillmon commented 4 months ago

It looks like CLI has been sandboxing all lockfile parsing since 376bc726. We should update the docs to reflect that change.

As for the error, my suspicion is that we are getting this error because birdcage is unable to get an accurate thread count in this environment. We may need an update to birdcage to improve the error message.