Code Monkey home page Code Monkey logo

Comments (3)

dvjsharma avatar dvjsharma commented on July 19, 2024

Hi @GMishx,

I've looked into this issue. Currently we are using scancode-wrapper.cc file to construct the command to execute runscanonfiles.py. I checked the permissions of both scripts, and I noticed a change in the user and group for the .cache directory.

Screenshot from 2024-03-05 02-45-18

Screenshot from 2024-03-05 02-48-31

This indicates that the fossy user is attempting to create a directory that needs root access. I'm unsure about the ideal solution for this. Any insights would be greatly appreciated. Please take a look.

Thank you!

from fossology.

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

Hi @xsuchy / @GMishx / @dvjsharma ,

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

or enforcing 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

Thank you @kannan-seenivasan.
I discovered a similar solution during my research. The Scancode toolkit already contains a related issue that closely mirrors ours, where the calling users are not the same (#2355 & #357). To tackle this, they have introduced options and environment variables. Please see CHANGELOG.rst.

I tested the solution by adding the SCANCODE_CACHE environment variable at the container level in the docker-compose.yml file, and it worked perfectly. There was no need to modify scancode_wrapper.cc since the issue did not exist in the local installation (which was also tested). However, even if we were to update it, I believe using the --cache-dir option would be a more suitable approach.

I've submitted a PR to update the docker-compose.yml, which will resolve this issue and #2667. I will make the necessary modifications as advised.

EDIT: It was discussed in community meeting to set the environment variable before calling the runscanonfiles.py file, not in the docker-compose.yml file. Additionally it was decided to store cache at /usr/local/share/fossology/scancode/agent/. I have updated the PR accordingly.

EDIT: It was suggested to set the environment variable inside runscanonfiles.py and not to hardcode the part, but get it inside the script itself (using __file__).

CC @GMishx

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.