Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept error values of any type in TriblerProcess.set_error #7537

Merged
merged 1 commit into from Jul 10, 2023

Conversation

kozlovsky
Copy link
Collaborator

I see a significant number of the following errors in GUI logs on my machine and some test machines:

[tribler-gui PID:17032] 2023-07-10 08:19:50,079 - ERROR - tribler.gui.start_gui(82) - Error binding parameter 7 - probably unsupported type.
Traceback (most recent call last):
  File "tribler\core\utilities\process_manager\utils.py", line 29, in new_method
  File "tribler\core\utilities\process_manager\process.py", line 74, in save
  File "tribler\core\utilities\process_manager\process.py", line 224, in _update
sqlite3.InterfaceError: Error binding parameter 7 - probably unsupported type.

During the handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "tribler\gui\start_gui.py", line 79, in run_gui
  File "tribler\core\utilities\process_manager\manager.py", line 112, in sys_exit
  File "tribler\core\utilities\process_manager\process.py", line 204, in finish
  File "tribler\core\utilities\process_manager\utils.py", line 32, in new_method
  File "tribler\core\utilities\process_manager\process.py", line 74, in save
  File "tribler\core\utilities\process_manager\process.py", line 224, in _update
sqlite3.InterfaceError: Error binding parameter 7 - probably unsupported type.

The "parameter 7" is error_msg in the following SQL query (the parameters are counting from zero):

UPDATE processes
SET row_version = ?, "primary" = ?, canceled = ?, creator_pid = ?, api_port = ?,
    finished_at = ?, exit_code = ?, error_msg = ?
WHERE rowid = ? and row_version = ? and pid = ? and kind = ? and app_version = ? and started_at = ?

It is expected for the TriblerProcess.error_msg to be an str or exception instance, but it seems that in some situations, when the TriblerProcess.set_error method is called, the value of another type is passed into it.

To handle this situation and understand what the actual error is, this PR converts any error_msg value to an str even if it is a value of an unknown type.

@kozlovsky kozlovsky requested a review from a team as a code owner July 10, 2023 15:07
@kozlovsky kozlovsky requested review from drew2a and removed request for a team July 10, 2023 15:07
@kozlovsky kozlovsky merged commit 7908cf8 into Tribler:release/7.13 Jul 10, 2023
17 checks passed
@kozlovsky kozlovsky deleted the fix/process_set_error branch July 10, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants