tern icon indicating copy to clipboard operation
tern copied to clipboard

Report result with same command is not constant

Open JustinWonjaePark opened this issue 3 years ago • 8 comments

Describe the bug When you run tern with Scancode extension repeatedly, small parts of the results are different from each other. image image image

To Reproduce Steps to reproduce the behavior:

  1. pull fossology/fossology:3.10.0
  2. Run command tern report -f json -x scancode -i debian:buster -o debian_buster_img_scancode.json

Error in terminal no error occurred

Expected behavior The report on a same docker image should be same.

Environment you are running Tern on Tern at commit 273e3c8 Python 3.6.13 Docker version 19.03.13, build 4484c46d9d

Distributor ID: Ubuntu Description: Ubuntu 16.04.7 LTS Release: 16.04 Codename: xenial

JustinWonjaePark avatar Jul 14 '21 06:07 JustinWonjaePark

Thanks for the issue @JustinWonjaePark -- Is the parts of the code that are differing file-related output from Scancode or package metadata from Tern? If the differences are file related it's possible this could be a Scancode bug, but I'll need to take a closer look.

rnjudge avatar Jul 22 '21 02:07 rnjudge

Can you also confirm which version of scancode you have installed?

rnjudge avatar Jul 22 '21 06:07 rnjudge

Hello @rnjudge , I am sorry for late response. The version of scancode that I use is 21.3.31

JustinWonjaePark avatar Aug 05 '21 02:08 JustinWonjaePark

@rnjudge , it actually looks part that returned from Scancode. (copyright and license information by files)

JustinWonjaePark avatar Aug 05 '21 07:08 JustinWonjaePark

@JustinWonjaePark it looks like this is an issue with scancode then? or is it specific to Tern? Tern simply captures scancode output and reports on it. Are the differences you're seeing after back to back runs on the same image or running with a fresh cache for the same image? I can try to reproduce but a little confused by your steps that say to pull fossology image and then run a tern+scancode report for debian:buster. Can you clarify what you did to produce this error?

rnjudge avatar Aug 11 '21 03:08 rnjudge

It might be issue with the scancode that I run with tern. I'd like to check if scancode provides inconstant result when it is ran independently, but I was not sure what does tern pass to scancode exactly. @rnjudge, can you tell me what to scan to with scancode without tern?

JustinWonjaePark avatar Aug 12 '21 02:08 JustinWonjaePark

@JustinWonjaePark Here are the steps to run scancode without Tern:

  1. tern -k report -i debian:buster. The -k option keeps the containers mounted filesystem so you can run scancode on it independently of Tern.
  2. Find the mounted filesystem by runningls ~/.tern/temp/. The directory under ~/temp for me and the debian:buster image was e63992559353a522e62a73bc137fd023ee97e1226b96947df8e00e73d1a9d627. Whatever the directory there is, use that.
  3. Run scancode on the mounted filesystem (you'll need to switch your username). sudo /home/rjudge/ternenv/bin/scancode -ilpcu --quiet --timeout 300 -n 4 --json - /home/rjudge/.tern/temp/e63992559353a522e62a73bc137fd023ee97e1226b96947df8e00e73d1a9d627/contents

The output of scancode will print directly to the terminal.

rnjudge avatar Aug 12 '21 03:08 rnjudge

Hi @JustinWonjaePark any followup from your investigation?

rnjudge avatar Feb 23 '22 18:02 rnjudge

Closing due to lack of response. Feel free to re-open if you're still hitting this issue.

rnjudge avatar May 24 '23 16:05 rnjudge