scancode-toolkit icon indicating copy to clipboard operation
scancode-toolkit copied to clipboard

Error: 'ScannedResource' object has no attribute 'holders'

Open bwjohnson-ss opened this issue 2 years ago • 1 comments

Description

Running scancode with --package and --summary options produces the following error:

Scanning done.
Some files failed to scan properly:
ERROR: failed to run post-scan plugin: summary:
Traceback (most recent call last):
  File "/opt/scancode-toolkit-v31.1.1/venv/lib/python3.9/site-packages/scancode/cli.py", line 1077, in run_codebase_plugins
    plugin.process_codebase(codebase, **kwargs)
  File "/opt/scancode-toolkit-v31.1.1/venv/lib/python3.9/site-packages/summarycode/summarizer.py", line 102, in process_codebase
    ) = get_origin_info_from_top_level_packages(
  File "/opt/scancode-toolkit-v31.1.1/venv/lib/python3.9/site-packages/summarycode/summarizer.py", line 273, in get_origin_info_from_top_level_packages
    holders = [h['holder'] for h in key_file_resource.holders]
AttributeError: 'ScannedResource' object has no attribute 'holders'

How To Reproduce

  1. scancode --processes 4 --license --package --json-pp ../scancode-output.json --summary --classify .

System configuration

  • What OS are you running on? MacOS
  • What version of scancode-toolkit was used to generate the scan file?
    • ScanCode version: 31.1.1
    • ScanCode Output Format version: 2.0.0
    • SPDX License list version: 3.17
  • What installation method was used to install/run scancode? download tarball from GH

bwjohnson-ss avatar Sep 16 '22 21:09 bwjohnson-ss

@bwjohnson-ss Thanks for the report. I'm working on fixing this, just for reference, can you provide the files/package you were scanning when the error occured (if they are public and can be shared, otherwise ignore this), it'll be easier to test my fix then. Thanks!

AyanSinhaMahapatra avatar Sep 21 '22 13:09 AyanSinhaMahapatra

Unfortunately it's proprietary code and can't be shared. Sorry. Let me know if you have trouble reproducing it with something that's open source. Thanks.

bwjohnson-ss avatar Sep 22 '22 00:09 bwjohnson-ss

@bwjohnson-ss Thanks! This was an easy fix, and I could also reproduce the bug and add a test for that.

AyanSinhaMahapatra avatar Sep 22 '22 10:09 AyanSinhaMahapatra

The fix is now merged and released, closing this.

AyanSinhaMahapatra avatar Oct 05 '22 14:10 AyanSinhaMahapatra