openmainframeproject / software-discovery-tool

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

[URGENT] fixes empty data loading #226

Closed rachejazz closed 1 week ago

rachejazz commented 2 months ago

commits that caused the issues: https://github.com/openmainframeproject/software-discovery-tool/pull/207 https://github.com/openmainframeproject/software-discovery-tool/commit/063e460ac4743d59177357e0af3b97016e7c6221 and few more cumulative bugs

@Apurv428 @deveshidwivedi till this gets merged into master, you can use this branch to switch and check if data updates for you

deveshidwivedi commented 2 months ago

Hey @rachejazz, I am still unable to get packages on searching for them. I see the landing page and can view FAQs. However, when I try to search for a package after selecting an operating system, I see no updates. I am on the data-update-fixes branch.

rachejazz commented 2 months ago

interesting, lmk if you can come on a debug session. What does the sdt.log say? It is pretty late for you now, lets try tomorrow @deveshidwivedi

deveshidwivedi commented 2 months ago

interesting, lmk if you can come on a debug session.

Yes, let's have a debug session tomorrow please.

This is from sdt.log:

2024-07-13 20:27:29,393 Exception on /sdt/searchPackages [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 883, in full_dispatch_request
    return self.finalize_request(rv)
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 902, in finalize_request
    response = self.make_response(rv)
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1174, in make_response
    raise TypeError(
TypeError: The view function for 'searchPackages' did not return a valid response. The function either returned None or ended without a return statement.
rachejazz commented 1 month ago

Issue is solved now. Thanks @deveshidwivedi Solved by renaming .example files to their original. This can be merged now.

rachejazz commented 1 month ago

Got a new bug from the newest 15.6 opensuse data. Solved now. This PR is ready to be merged/reviewed. cc: @pleia2

pleia2 commented 1 month ago

Can you confirm that bin/database_build.py is working for you in the current state? I'm a traceback (below) that are sends me down a whole rabbit hole. It looks like the changes around line 30 seemed to have changed how the user adds the username and password on the command line, and causes problems.

elizabeth@sdt:/opt/software-discovery-tool/bin$ ./database_build.py Enter password for connecting to MariaDB server : root Traceback (most recent call last): File "/opt/software-discovery-tool/bin/./database_build.py", line 126, in db_init() File "/opt/software-discovery-tool/bin/./database_build.py", line 39, in db_init connectdb(username,password,dbName) File "/opt/software-discovery-tool/bin/./database_build.py", line 22, in connectdb conn = pymysql.connect(host=HOST,user=username,password=password) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pymysql/connections.py", line 353, in init self.connect() File "/usr/lib/python3/dist-packages/pymysql/connections.py", line 633, in connect self._request_authentication() File "/usr/lib/python3/dist-packages/pymysql/connections.py", line 907, in _request_authentication auth_packet = self._read_packet() ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pymysql/connections.py", line 725, in _read_packet packet.raise_for_error() File "/usr/lib/python3/dist-packages/pymysql/protocol.py", line 221, in raise_for_error err.raise_mysql_exception(self._data) File "/usr/lib/python3/dist-packages/pymysql/err.py", line 143, in raise_mysql_exception raise errorclass(errno, errval) pymysql.err.OperationalError: (1698, "Access denied for user 'elizabeth'@'localhost'")

rachejazz commented 4 weeks ago

Hey @pleia2 couple of questions. Firstly, yeah this is working for me even after changing localhost to a remote db (I'm using docker and mariadb so different networks)

  1. Since you're giving password as root, does it mean elizabeth is your root account?
  2. Since it says access denied, could you manually check logging into sql on terminal, then use information_schema then select * from USER_PRIVILEGES
pleia2 commented 4 weeks ago
  1. My administrative user is root, so I input that on the command line. But then the script completely ignores that input and falls back to my local user on the system (elizabeth) when it fails, which is why 'elizabeth'@'localhost' shows up
  2. Due to 1, this isn't the problem :smile:

It really just totally falls over (traceback) after I type "root" when the expected behavior is asking for a password. I'm using Ubuntu 24.04.