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

Fail to scan on user home with ~ #1748

Closed
pombredanne opened this issue Oct 6, 2019 · 9 comments
Closed

Fail to scan on user home with ~ #1748

pombredanne opened this issue Oct 6, 2019 · 9 comments

Comments

@pombredanne
Copy link
Member

Description

A scan to ~/ fails:

$ ./scancode -i ~/misc/licenses/ --json -
Setup plugins...
Collect file inventory...
Removing temporary files...done.
Usage: scancode [OPTIONS] <OUTPUT FORMAT OPTION(s)> <input>...
Try 'scancode --help' for help on options and arguments.

Error: Invalid value: ERROR: failed to collect codebase at: '/home/misc/licenses/'
Traceback (most recent call last):
  File "/scancode-toolkit/src/scancode/cli.py", line 860, in run_scan
    max_in_memory=max_in_memory
  File "/scancode-toolkit/src/scancode/resource.py", line 284, in __init__
    self._populate()
  File "/scancode-toolkit/src/scancode/resource.py", line 443, in _populate
    parent = parent_by_loc.pop(top)
KeyError: '/home/licenses/javascript/rcs

System configuration

For bug reports, it really helps us to know:

@JonoYang
Copy link
Member

JonoYang commented Oct 7, 2019

@pombredanne Is scancode failing to scan a folder in your home directory? I am unable to reproduce the error.

@pombredanne
Copy link
Member Author

pombredanne commented Oct 7, 2019

@JonoYang good catch... this is not the root cause indeed.
The small zip attached fails with:

unzip scan.zip
scancode --json-pp - scan

scan.zip

@JonoYang
Copy link
Member

JonoYang commented Oct 7, 2019

@pombredanne Thanks, I am able to reproduce the error with the attached zip.

@JonoYang
Copy link
Member

JonoYang commented Oct 7, 2019

@pombredanne The issue is with the directory scan.zip/rcs/. ScanCode will ignore the rcs directory since it's shares the same name as RCS, the version control system.

@pombredanne
Copy link
Member Author

OK, I think we can now drop ignoring RCS ten... I have not seen RCS directories in ages, and digging in them if we ever meet some real ones is not a problem IMHO.

We still need to avoid this kind of errors too BEFORE removing skipping rcs

JonoYang added a commit that referenced this issue Oct 8, 2019
    * Create new test

Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang added a commit that referenced this issue Oct 9, 2019
Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang added a commit that referenced this issue Oct 16, 2019
Signed-off-by: Jono Yang <jyang@nexb.com>
pombredanne added a commit that referenced this issue Oct 17, 2019
Remove RCS from list of VCS names to ignore #1748
@JonoYang
Copy link
Member

We now scan the RCS directory and we properly ignore directories when creating the codebase. Closing.

viragumathe5 pushed a commit to viragumathe5/scancode-toolkit that referenced this issue Mar 13, 2020
    * Create new test

Signed-off-by: Jono Yang <jyang@nexb.com>
viragumathe5 pushed a commit to viragumathe5/scancode-toolkit that referenced this issue Mar 13, 2020
Signed-off-by: Jono Yang <jyang@nexb.com>
@adambhere
Copy link

I've come across this same problem running scancode 3.0.2 on ubuntu 18.04. The directory named "rcs" was ignored by scancode, but not its contents. It seems to me that it might be a good idea not only to remove "RCS" from the ignored list but also to make checks case sensitive (except on Windows) -- get_matches() in fileste.py changes the case of the item to be ignored to lower and I suggest it shouldn't.

@pombredanne
Copy link
Member Author

@adambhere Let's create a new ticket for that then. Do you have the same problem using the tip of the develop branh?

@adambhere
Copy link

@pombredanne We have plans to move to it, but the decision is out of my hands.

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

No branches or pull requests

3 participants