Code Monkey home page Code Monkey logo

Comments (8)

GMishx avatar GMishx commented on July 19, 2024

Hey @g-sahil22 , can you please share how the FOSSology was installed? I see in the logs it says scancode failed to create the dir /root/.cache which should ideally be $HOME/.cache. Which means the scancode was started by root user instead of fossy user.

from fossology.

g-sahil22 avatar g-sahil22 commented on July 19, 2024

Hi @GMishx , I use https://fossology.osuosl.org/ and in local deploy via Docker image

from fossology.

g-sahil22 avatar g-sahil22 commented on July 19, 2024

I build the https://github.com/juice-shop/juice-shop/ code and then zip it and upload it

from fossology.

submachine avatar submachine commented on July 19, 2024

I get an identical error when trying to run fossology on a recent glibc tarball. My installation method was to use podman pull fossology/fossology on my Fedora 39 box, and using from within the container, i.e. docker run -p 8081:80 fossology/fossology.

from fossology.

submachine avatar submachine commented on July 19, 2024

@GMishx just @'ing you here since I'm unable to remove the needs-clarification label :)

from fossology.

dineshr93 avatar dineshr93 commented on July 19, 2024

@GMishx @its-sushant I am getting the same error when i tried to install in stable release version.

[4.4.0], Branch: [HEAD], Commit: [#903df0] 2024/01/15 09:27 +00:00 built @ 2024/02/15 09:21 +00:00

deploy method: Docker compose

this fixed issue in the token generation #2682 but met with below issue slightly different from this original issue

2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "Traceback (most recent call last):"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "  File "/usr/local/share/fossology/scancode/agent/runscanonfiles.py", line 11, in "
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "    from scancode import api"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "  File "/home/fossy/pythondeps/scancode/__init__.py", line 16, in "
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "    from commoncode import fileutils"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "  File "/home/fossy/pythondeps/commoncode/fileutils.py", line 21, in "
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "    from scancode_config import scancode_temp_dir as _base_temp_dir"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "  File "/home/fossy/pythondeps/scancode_config.py", line 148, in "
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "    _create_dir(scancode_cache_dir)"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "  File "/home/fossy/pythondeps/scancode_config.py", line 52, in _create_dir"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "    os.makedirs(location)"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "  File "/usr/lib/python3.9/os.py", line 215, in makedirs"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "    makedirs(head, exist_ok=exist_ok)"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "  File "/usr/lib/python3.9/os.py", line 215, in makedirs"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "    makedirs(head, exist_ok=exist_ok)"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "  File "/usr/lib/python3.9/os.py", line 225, in makedirs"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "    mkdir(name, mode)"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "PermissionError: [Errno 13] Permission denied: '/root/.cache'"
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: "FATAL ../src/scancode/agent/scancode_wrapper.cc.80: could not execute scancode command: PYTHONPATH='/home/fossy/pythondeps/' python3 runscanonfiles.py -lceu -m 50 /tmp/filewAwMvv /tmp/file1pUHhu "
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: agent failed with error code 1
2024-02-15 09:29:23 scancode [0] :: JOB[2206].scancode[718.localhost]: agent failed, code: 1

update: Inside the container the file has no execute permission
image

I had no execute permission so I change the file permission

/usr/local/src/fossology$ ll src/scancode/agent/runscanonfiles.py
-rwxr-xr-x 1 dinesh users 6667 Feb 15 09:15 src/scancode/agent/runscanonfiles.py*

and there is .cache folder in the docker in path /root/.cache where permission denied error occured as mentioned in my error log above in this same comment.
image

i enabled write permission

next error is

LOG_FATAL("could not execute scancode command: %s \n", command.c_str());

while executing this script

"python3 runscanonfiles.py -" + state.getCliOptions() + " " +

improved the permission of this file runscanonfiles.py
image

Restarted apache server to take effect above changes.
sudo service apache2 restart

But I am still getting the same error

Traceback (most recent call last):"
  File "/usr/local/share/fossology/scancode/agent/runscanonfiles.py", line 11, in "
    from scancode import api"
  File "/home/fossy/pythondeps/scancode/__init__.py", line 16, in "
    from commoncode import fileutils"
  File "/home/fossy/pythondeps/commoncode/fileutils.py", line 21, in "
    from scancode_config import scancode_temp_dir as _base_temp_dir"
  File "/home/fossy/pythondeps/scancode_config.py", line 148, in "
    _create_dir(scancode_cache_dir)"
  File "/home/fossy/pythondeps/scancode_config.py", line 52, in _create_dir"
    os.makedirs(location)"
  File "/usr/lib/python3.9/os.py", line 215, in makedirs"
    makedirs(head, exist_ok=exist_ok)"
  File "/usr/lib/python3.9/os.py", line 215, in makedirs"
    makedirs(head, exist_ok=exist_ok)"
  File "/usr/lib/python3.9/os.py", line 225, in makedirs"
    mkdir(name, mode)"
PermissionError: [Errno 13] Permission denied: '/root/.cache'"
FATAL ../src/scancode/agent/scancode_wrapper.cc.80: could not execute scancode command: PYTHONPATH='/home/fossy/pythondeps/' python3 runscanonfiles.py -lceu -m 50 /tmp/filelIQKq3 /tmp/fileH1T0M2 "
2024-02-15 13:01:23 scancode [0] :: JOB[2246].scancode[2749.localhost]: agent failed with error code 1
2024-02-15 13:01:23 scancode [0] :: JOB[2246].scancode[2749.localhost]: agent failed, code: 1

FYI: Not sure what more I need to do for the above permission change to take into effect. If I restart the docket the above changes vanishes.

also i think the file runscanonfiles.py with ownership of fossy user and group permission is causing the problem while trying to change the /root/.cache folder which is under file ownership root user and root group permission. while both have write & execute permission clearly.

image


image

I tried to change the ownership of .cache to fossy as well. And ran the scancode agent. it didn't work.

Not sure if the fossology application takes the changes that is made in the container.

from fossology.

kannan-seenivasan avatar kannan-seenivasan commented on July 19, 2024

Hi @g-sahil22 / @dineshr93,

Setting the following environment variable SCANCODE_CACHE='/home/fossy/.cache on the container level, fixed the scan code issue for us.

or enforce in the below.
https://github.com/fossology/fossology/blob/4.4.0/src/scancode/agent/scancode_wrapper.cc#L73

from fossology.

dvjsharma avatar dvjsharma commented on July 19, 2024

Fixed in #2692. PTAL

from fossology.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.