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

sqlite3.IntegrityError #4138

Open
jbulow opened this issue Dec 14, 2023 · 0 comments
Open

sqlite3.IntegrityError #4138

jbulow opened this issue Dec 14, 2023 · 0 comments

Comments

@jbulow
Copy link

jbulow commented Dec 14, 2023

Describe the bug
Trying to store reports

CodeChecker version

[INFO 2023-12-14 19:20] - CodeChecker analyzer version:
---------------------------------------------------------------
Kind                 | Version
---------------------------------------------------------------
Base package version | 6.24.0
Package build date   | 2023-12-14T12:58
Git commit ID (hash) | 40f0a2a3b7b67a802e2035e7b554a1bac628299c
Git tag information  | 6.24
---------------------------------------------------------------

[INFO 2023-12-14 19:20] - CodeChecker web version:
------------------------------------------------------------------------------
Kind                                | Version
------------------------------------------------------------------------------
Base package version                | 6.24.0
Package build date                  | 2023-12-14T12:58
Git commit ID (hash)                | 40f0a2a3b7b67a802e2035e7b554a1bac628299c
Git tag information                 | 6.24
Server supported Thrift API version | 6.54
Client Thrift API version           | 6.54
------------------------------------------------------------------------------

To Reproduce
Follow to getting started instructions:

CodeChecker analyze --ctu ./compile_commands.json --enable sensitive --output ./reports-ctu
CodeChecker server --workspace ./ws --port 8890
CodeChecker store ./reports-ctu -n XXX --url http://localhost:8890/Default

Expected behaviour
Successfull import of reports

Desktop (please complete the following information)

  • Linux
  • N/A but planned to use chrome when imported
  • 109

Additional context
From CodeChecker server output:

[ERROR 2023-12-14 18:43] - Failed to store results: RequestFailed(errorCode=2, message='(sqlite3.IntegrityError) UNIQUE constraint failed: bug_path_events.order, bug_path_events.report_id\n[SQL: INSERT INTO bug_path_events (line_begin, col_begin, line_end, col_end, "order", msg, file_id, report_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)]\n[parameters: ((37, 10, 37, 21, 0, \'Entering loop body\', 7647, 1), (43, 11, 43, 52, 1, \'Assuming the condition is true\', 7647, 1), (37, 3, 37, 7, 2, \'Looping back to the head of the loop\', 7647, 1), (37, 10, 37, 21, 3, \'Entering loop body\', 7647, 1), (62, 11, 62, 20, 4, "Assuming field \'m_datasize\' is not equal to 0", 7647, 1), (64, 9, 64, 41, 5, "\'howmuchcanbewritten\' initialized here", 7647, 1), (65, 13, 65, 45, 6, "Assuming \'howmuchcanbewritten\' is < field \'m_datasize\'", 7647, 1), (74, 15, 74, 33, 7, "Assuming \'howmuchcanbewritten\' is not equal to 0", 7647, 1)  ... displaying 10 of 322220 total bound parameter sets ...  (284, 78, 284, 78, 0, "implicit conversion loses integer precision: \'uint32_t\' (aka \'unsigned int\') to \'szl_uint16\' (aka \'unsigned short\')", 10193, 75918), (290, 30, 290, 30, 0, "\'data\' should be used for accessing the data pointer instead of taking the address of the 0-th element", 10193, 75919))]\n(Background on this error at: http://sqlalche.me/e/13/gkpj)', extraInfo=None)
Traceback (most recent call last):
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1256, in _execute_context
    self.dialect.do_executemany(
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 605, in do_executemany
    cursor.executemany(statement, parameters)
sqlite3.IntegrityError: UNIQUE constraint failed: bug_path_events.order, bug_path_events.report_id

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/jonasbu/codechecker/build/CodeChecker/lib/python3/codechecker_server/api/mass_store_run.py", line 820, in __add_report_context
    session.flush()
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2540, in flush
    self._flush(objects)
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2681, in _flush
    with util.safe_reraise():
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.raise_(
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2642, in _flush
    flush_context.execute()
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
    rec.execute(self)
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 586, in execute
    persistence.save_obj(
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py", line 239, in save_obj
    _emit_insert_statements(
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py", line 1083, in _emit_insert_statements
    c = cached_connections[connection].execute(statement, multiparams)
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
    ret = self._execute_context(
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
    self._handle_dbapi_exception(
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
    util.raise_(
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1256, in _execute_context
    self.dialect.do_executemany(
  File "/home/jonasbu/.local/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 605, in do_executemany
    cursor.executemany(statement, parameters)
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: bug_path_events.order, bug_path_events.report_id
[SQL: INSERT INTO bug_path_events (line_begin, col_begin, line_end, col_end, "order", msg, file_id, report_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ((37, 10, 37, 21, 0, 'Entering loop body', 7647, 1), (43, 11, 43, 52, 1, 'Assuming the condition is true', 7647, 1), (37, 3, 37, 7, 2, 'Looping back to the head of the loop', 7647, 1), (37, 10, 37, 21, 3, 'Entering loop body', 7647, 1), (62, 11, 62, 20, 4, "Assuming field 'm_datasize' is not equal to 0", 7647, 1), (64, 9, 64, 41, 5, "'howmuchcanbewritten' initialized here", 7647, 1), (65, 13, 65, 45, 6, "Assuming 'howmuchcanbewritten' is < field 'm_datasize'", 7647, 1), (74, 15, 74, 33, 7, "Assuming 'howmuchcanbewritten' is not equal to 0", 7647, 1)  ... displaying 10 of 322220 total bound parameter sets ...  (284, 78, 284, 78, 0, "implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'szl_uint16' (aka 'unsigned short')", 10193, 75918), (290, 30, 290, 30, 0, "'data' should be used for accessing the data pointer instead of taking the address of the 0-th element", 10193, 75919))]
(Background on this error at: http://sqlalche.me/e/13/gkpj)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jonasbu/codechecker/build/CodeChecker/lib/python3/codechecker_server/api/mass_store_run.py", line 1285, in store
    self.__store_reports(
  File "/home/jonasbu/codechecker/build/CodeChecker/lib/python3/codechecker_server/api/mass_store_run.py", line 1098, in __store_reports
    self.__add_report_context(session, file_path_to_id)
  File "/home/jonasbu/codechecker/build/CodeChecker/lib/python3/codechecker_server/api/mass_store_run.py", line 823, in __add_report_context
    raise codechecker_api_shared.ttypes.RequestFailed(
codechecker_api_shared.ttypes.RequestFailed: RequestFailed(errorCode=2, message='(sqlite3.IntegrityError) UNIQUE constraint failed: bug_path_events.order, bug_path_events.report_id\n[SQL: INSERT INTO bug_path_events (line_begin, col_begin, line_end, col_end, "order", msg, file_id, report_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)]\n[parameters: ((37, 10, 37, 21, 0, \'Entering loop body\', 7647, 1), (43, 11, 43, 52, 1, \'Assuming the condition is true\', 7647, 1), (37, 3, 37, 7, 2, \'Looping back to the head of the loop\', 7647, 1), (37, 10, 37, 21, 3, \'Entering loop body\', 7647, 1), (62, 11, 62, 20, 4, "Assuming field \'m_datasize\' is not equal to 0", 7647, 1), (64, 9, 64, 41, 5, "\'howmuchcanbewritten\' initialized here", 7647, 1), (65, 13, 65, 45, 6, "Assuming \'howmuchcanbewritten\' is < field \'m_datasize\'", 7647, 1), (74, 15, 74, 33, 7, "Assuming \'howmuchcanbewritten\' is not equal to 0", 7647, 1)  ... displaying 10 of 322220 total bound parameter sets ...  (284, 78, 284, 78, 0, "implicit conversion loses integer precision: \'uint32_t\' (aka \'unsigned int\') to \'szl_uint16\' (aka \'unsigned short\')", 10193, 75918), (290, 30, 290, 30, 0, "\'data\' should be used for accessing the data pointer instead of taking the address of the 0-th element", 10193, 75919))]\n(Background on this error at: http://sqlalche.me/e/13/gkpj)', extraInfo=None)
[WARNING 2023-12-14 18:43] - massStoreRun:
(sqlite3.IntegrityError) UNIQUE constraint failed: bug_path_events.order, bug_path_events.report_id
[SQL: INSERT INTO bug_path_events (line_begin, col_begin, line_end, col_end, "order", msg, file_id, report_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ((37, 10, 37, 21, 0, 'Entering loop body', 7647, 1), (43, 11, 43, 52, 1, 'Assuming the condition is true', 7647, 1), (37, 3, 37, 7, 2, 'Looping back to the head of the loop', 7647, 1), (37, 10, 37, 21, 3, 'Entering loop body', 7647, 1), (62, 11, 62, 20, 4, "Assuming field 'm_datasize' is not equal to 0", 7647, 1), (64, 9, 64, 41, 5, "'howmuchcanbewritten' initialized here", 7647, 1), (65, 13, 65, 45, 6, "Assuming 'howmuchcanbewritten' is < field 'm_datasize'", 7647, 1), (74, 15, 74, 33, 7, "Assuming 'howmuchcanbewritten' is not equal to 0", 7647, 1)  ... displaying 10 of 322220 total bound parameter sets ...  (284, 78, 284, 78, 0, "implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'szl_uint16' (aka 'unsigned short')", 10193, 75918), (290, 30, 290, 30, 0, "'data' should be used for accessing the data pointer instead of taking the address of the 0-th element", 10193, 75919))]
(Background on this error at: http://sqlalche.me/e/13/gkpj)
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

No branches or pull requests

1 participant