openmainframeproject / software-discovery-tool

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

Cache Data fails to generate for Ubuntu 22.04 #133

Closed arshPratap closed 1 year ago

arshPratap commented 1 year ago

It seems there is a bug in the system , while trying to setup the code on newer systems like Ubuntu 22.04 where when attempting to setup discovery tool (instructions here) it seems that the cached_data.json fails to assemble leading for the tool to not have anything to search for when testing the project locally. @pleia2 any thoughts ?

Princee215 commented 1 year ago

Yes, @arshPratap. When I tried to run it locally I was facing the same issue where cached_data.json is not generating on Ubuntu 22.04.

pleia2 commented 1 year ago

It took some Apache webserver debugging to figure out what was going on here, the following are my steps to re-create once I noticed that the data file wasn't being created:

view /var/log/apache2/error.log

In there, the final line of the file said:

[Tue Jun 06 18:57:38.616881 2023] [wsgi:error] [pid 17795:tid 140569337280064] [remote 192.168.122.1:54082] FileNotFoundError: [Errno 2] No such file or directory: '/opt/software-discovery-tool/distro_data/data_files/IBMZ_container_registry.json'

With this, I realized it wasn't able to find that json file, and so it was halting the creation of cached_data.json.

I copied IBMZ-container-registry.json to IBMZ_container_registry.json but then had a series of other errors in error.log, and ultimately had to remove a bunch of distributions from src/config/supported_distros.py to get it running:

https://gist.github.com/pleia2/9cd300c236761945cda732dfdc1db48f

Obviously we have a bigger problem here since the submodule import isn't pulling in everything we need by default (an issue should be raised for this), but you can solve this manually by grabbing each of the source files that are missing, or just using the above configuration instead, with older versions of the source files.

arshPratap commented 1 year ago

@pleia2 thanks for this..I just checked it and I realized the main issue is with IBMZ-container-registry.json file name incorrectly listed in the supported distros. As far as i remember, we had a PR #99 that included changing its name and the same change needs to be reflected in the data repository. If possible let me add a quick PR there. Plus it seems that the submodule is intializing itself in an incorrect way and seems to focus on getting in the wrong branch/set of files .. it gets IBMZ-container-registry.json instead of IBMZ_container_registry.json

arshPratap commented 1 year ago

@pleia2 oh I think we need to update our git submodule for distro_data currently its pointing towards the commits made for the may-branch

arshPratap commented 1 year ago

@pleia2 @Princee215 I have added another PR with a slight update in the instructions for correctly initialising the git submodules.

Princee215 commented 1 year ago

Thanks @arshPratap I tried and checked, and it is working well now.

arshPratap commented 1 year ago

@Princee215 thanks for the update ! Closing the issue