openmainframeproject / software-discovery-tool

Software Discovery Tool
Apache License 2.0
31 stars 40 forks source link

Couldn't update submodule `distro_data` when cloning it into `/opt/` #127

Closed xtanion closed 4 months ago

xtanion commented 1 year ago

installation.md suggests that in order to

Cloning Data Directory (Only First Time) openmainframeproject/software-discovery-tool-data contains all OMP created json files. To add the data files, we will use git submodule map the submodule directory with the directory path and update the directory:

git submodule init && git submodule update

It doesn't work if we try to execute it in /opt/ as it's not executed with sudo permissions. I'm getting the following errors:

fatal: could not create directory '/opt/software-discovery-tool/.git/modules/distro_data'
Failed to clone 'distro_data'. Retry scheduled
fatal: could not create directory '/opt/software-discovery-tool/.git/modules/distro_data'
Failed to clone 'distro_data' a second time, aborting

The command that works for me: git submodule init && sudo git submodule update.

arshPratap commented 1 year ago

@xtanion thanks for the issue! The thing is I had encountered the same bug while setting up the project and it all boil down towards the system permissions ...which trust me is extremely dynamic in nature. I had 2 different setups one was a newly added Ubuntu 20.04 which needed the sudo command to be run and another was an old trusty system having 18.04 which didn't run into the same issue. The point I am trying to make is that adding sudo to such commands is not a out an out documentation error but more on the lines of the difference in the state of the current system. I will like to have @deadaf to take a look at this thread as he is currently assigned with the documentation changes. Thanks

pleia2 commented 1 year ago

From a security position, we want to restrict the amount we use sudo with root permissions as much as possible. These instructions should be improved to use a non-root system user that's created during installation and throughout maintenance of the tool. This is a good one for the mentorship since it will likely end up being a little tedious, but I'm happy to take the time to walk someone through the concepts and strategies to avoid the state of the system getting to where sudo as root needs to be used.

deadaf commented 1 year ago

Hello @pleia2 and @arshPratap,

I would like to work on resolving this problem and updating the instructions. However, I currently have a pending pull request (#128 ) that addresses the issues with the Contribute.md and README.md files. Since that PR hasn't been reviewed yet, I would appreciate it if you could take a look at it and provide feedback on whether the changes are acceptable.

Once I receive feedback on my first PR, I will have a better understanding of whether my work meets the project's requirements. This will help me determine if I should proceed with working on this installation issue. Please let me know your thoughts.

Thank you!

rachejazz commented 4 months ago

Stale and resolved issue. Closing