pivotal / LicenseFinder

Find licenses for your project's dependencies.
MIT License
1.73k stars 340 forks source link

license_finder crashes when "mix deps" returns nothing #758

Closed dumbbell closed 4 years ago

dumbbell commented 4 years ago

In the Norsk pipeline for RabbitMQ, we get the following crash from license_finder:

Running GOPATH=/tmp/d20200630-1272-843gek  license_finder report --save='lf-results.json' --prepare --project-path='/tmp/d20200630-1272-843gek/src/20200630-1272-1l490s0' --format=json --columns=name version install_path licenses package_manager homepage --gradle_include_groups --maven_include_groups --sbt_include_groups --go_full_version --python-version=3 --log_directory ~/lf_logs/20200630-1272-1l490s0 with {}
LicenseFinder::Rebar: is active
LicenseFinder::Mix: is active
LicenseFinder scanning has failed. More information:

LicenseFinder command:
GOPATH=/tmp/d20200630-1272-843gek  license_finder report --save='lf-results.json' --prepare --project-path='/tmp/d20200630-1272-843gek/src/20200630-1272-1l490s0' --format=json --columns=name version install_path licenses package_manager homepage --gradle_include_groups --maven_include_groups --sbt_include_groups --go_full_version --python-version=3 --log_directory ~/lf_logs/20200630-1272-1l490s0

LicenseFinder stdout:
LicenseFinder::Rebar: is active
LicenseFinder::Mix: is active

LicenseFinder stderr:
/usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/package_managers/mix.rb:100:in `block in mix_output': undefined method `split' for nil:NilClass (NoMethodError)
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/package_managers/mix.rb:100:in `map'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/package_managers/mix.rb:100:in `mix_output'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/package_managers/mix.rb:13:in `current_packages'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/package_manager.rb:101:in `current_packages_with_relations'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/scanner.rb:36:in `each'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/scanner.rb:36:in `flat_map'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/scanner.rb:36:in `active_packages'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/core.rb:83:in `current_packages'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/core.rb:78:in `decision_applier'
    from /usr/share/rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/forwardable.rb:229:in `acknowledged'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/license_aggregator.rb:51:in `block in aggregate_packages'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/license_aggregator.rb:49:in `each'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/license_aggregator.rb:49:in `flat_map'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/license_aggregator.rb:49:in `aggregate_packages'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/license_aggregator.rb:11:in `dependencies'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/lib/license_finder/cli/main.rb:148:in `report'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
    from /usr/share/rvm/gems/ruby-2.7.1/gems/license_finder-6.6.0/bin/license_finder:6:in `<top (required)>'
    from /usr/share/rvm/gems/ruby-2.7.1/bin/license_finder:23:in `load'
    from /usr/share/rvm/gems/ruby-2.7.1/bin/license_finder:23:in `<main>'

The repository in this example is: https://github.com/rabbitmq/stdout_formatter

mix deps prints nothing to stdout. This is an Erlang project by the way, not an Elixir one. Anyway, it has no dependencies.

cf-gitbot commented 4 years ago

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

xtreme-shane-lattanzio commented 4 years ago

Fixed in: https://github.com/pivotal/LicenseFinder/commit/fc34b2813925a709addde675849e199b05fc4a23