The Wayback Machine - https://web.archive.org/web/20200827032752/https://github.com/nexB/scancode-toolkit/issues/1758
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

Error in `filter-clues` Plugin #1758

Open
AyanSinhaMahapatra opened this issue Oct 12, 2019 · 9 comments
Open

Error in `filter-clues` Plugin #1758

AyanSinhaMahapatra opened this issue Oct 12, 2019 · 9 comments

Comments

@AyanSinhaMahapatra
Copy link
Collaborator

@AyanSinhaMahapatra AyanSinhaMahapatra commented Oct 12, 2019

Description

Running the following Command:

./scancode -clp --json-pp sample_filter_clues.json samples --filter-clues

Gives the Error:

ERROR: failed to run post-scan plugin: filter-clues:
Traceback (most recent call last):
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/src/scancode/cli.py", line 1033, in run_codebase_plugins
    plugin.process_codebase(codebase, **kwargs)
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/src/cluecode/plugin_filter_clues.py", line 90, in process_codebase
    filtered = filter_ignorable_resource_clues(resource, rules_by_id)
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/src/cluecode/plugin_filter_clues.py", line 105, in filter_ignorable_resource_clues
    resource.emails = filtered.emails
AttributeError: 'ScannedResource' object has no attribute 'emails'

Scanning done.
Some files failed to scan properly:
ERROR: failed to run post-scan plugin: filter-clues:
Traceback (most recent call last):
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/src/scancode/cli.py", line 1033, in run_codebase_plugins
    plugin.process_codebase(codebase, **kwargs)
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/src/cluecode/plugin_filter_clues.py", line 90, in process_codebase
    filtered = filter_ignorable_resource_clues(resource, rules_by_id)
  File "/home/ayansm/Desktop/GSoD/scancode-toolkit-versions/scancode-toolkit-3.1.1/src/cluecode/plugin_filter_clues.py", line 105, in filter_ignorable_resource_clues
    resource.emails = filtered.emails
AttributeError: 'ScannedResource' object has no attribute 'emails'

System configuration

For bug reports, it really helps us to know:

  • What OS are you running on? Ubuntu 16.04 LTS
  • What version of scancode-toolkit was used to generate the scan file? v3.1.1
  • What installation method was used to install/run scancode? Source Download
@pombredanne
Copy link
Member

@pombredanne pombredanne commented Oct 15, 2019

@AyanSinhaMahapatra Thanks! can you tell if this also happens in the develop branch latest and greatest?

@AyanSinhaMahapatra
Copy link
Collaborator Author

@AyanSinhaMahapatra AyanSinhaMahapatra commented Oct 20, 2019

@pombredanne Sorry for the delay. Yes, the same error occurs in the develop branch latest.

@pombredanne
Copy link
Member

@pombredanne pombredanne commented Oct 21, 2019

Thanks, I am making this as a must have for the next release candidate!

@pombredanne pombredanne added this to the v3.1 milestone Oct 21, 2019
@Iamshankhadeep
Copy link
Contributor

@Iamshankhadeep Iamshankhadeep commented Oct 23, 2019

@pombredanne Can I work on it?

@pombredanne
Copy link
Member

@pombredanne pombredanne commented Oct 23, 2019

@Iamshankhadeep please go for it!

@Iamshankhadeep
Copy link
Contributor

@Iamshankhadeep Iamshankhadeep commented Oct 25, 2019

@pombredanne how can I solve this? I am not getting any Ideas.

@Iamshankhadeep
Copy link
Contributor

@Iamshankhadeep Iamshankhadeep commented Nov 1, 2019

@pombredanne can you give me any idea about how to solve it?

@pombredanne
Copy link
Member

@pombredanne pombredanne commented Nov 1, 2019

@Iamshankhadeep here are steps:

  1. try to reproduce the problem in the most minimal way with a command line invocation of scancode as outlined above, trying to find a few files that make this fail
  2. once you have a minimally reproducible problem, create a unit test (that is failing for now) that reproduces the problem. Assert the things that should be there in the results.
  3. look at the failure trace and try to understand why this is not working and which places the code may need fixing.

I can start to help you more easily with 3. once you have done 1. and 2. :)

Iamshankhadeep added a commit to Iamshankhadeep/scancode-toolkit that referenced this issue Nov 1, 2019
'./scancode -clp --json-pp bb.json --filter-clues samples/JGroups/licenses/apache-1.1.txt'
when running this command on the apache-1.1.txt having '--filter-clues' args on it
shows 'ERROR: failed to run post-scan plugin: filter-clues' and "AttributeError: 'ScannedResource' object has no attribute 'emails'"
error. So wrote a test script to test this 2 error.
Signed-off-by: Shankhadeep <shankhadeepdey99@gmail.com>
@AyanSinhaMahapatra AyanSinhaMahapatra mentioned this issue Nov 10, 2019
0 of 21 tasks complete
@i-m-vivek
Copy link

@i-m-vivek i-m-vivek commented Jan 28, 2020

hi, I am new to open source. I was looking at some good first issues. Can I work on this?

pombredanne added a commit that referenced this issue Apr 2, 2020
Add test for the AttributeError of ScannedResource #1758
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.