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

[review_comments_retriever] Phabricator Conduit API error when populating database #4666

Open
benjaminmah opened this issue Dec 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@benjaminmah
Copy link
Contributor

Traceback (most recent call last):
  File "/Users/bmah/bugbug/bugbug/tools/code_review.py", line 402, in load_raw_diff_by_id
    with open(f"patches/{diff_id}.patch", "r") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'patches/230398.patch'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/bmah/bugbug/scripts/review_comments_retriever.py", line 22, in <module>
    main()
  File "/Users/bmah/bugbug/scripts/review_comments_retriever.py", line 18, in main
    comments_db.add_comments_by_hunk(review_data.retrieve_comments_with_hunks())
  File "/Users/bmah/bugbug/bugbug/tools/code_review.py", line 1306, in add_comments_by_hunk
    self.vector_db.insert(vector_points())
  File "/Users/bmah/bugbug/bugbug/vectordb.py", line 75, in insert
    self.client.upload_points(
  File "/Users/bmah/bugbug/venv/lib/python3.12/site-packages/qdrant_client/qdrant_client.py", line 2439, in upload_points
    return self._client.upload_points(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bmah/bugbug/venv/lib/python3.12/site-packages/qdrant_client/qdrant_remote.py", line 2965, in upload_points
    self._upload_collection(
  File "/Users/bmah/bugbug/venv/lib/python3.12/site-packages/qdrant_client/qdrant_remote.py", line 2917, in _upload_collection
    for _ in updater.process(batches_iterator):
  File "/Users/bmah/bugbug/venv/lib/python3.12/site-packages/qdrant_client/uploader/rest_uploader.py", line 80, in process
    for batch in items:
  File "/Users/bmahbugbug/venv/lib/python3.12/site-packages/qdrant_client/uploader/uploader.py", line 34, in iterate_records_batches
    for record_batch in record_batches:
  File "/Users/bmah/bugbug/venv/lib/python3.12/site-packages/qdrant_client/uploader/uploader.py", line 20, in iter_batch
    b = list(islice(source_iter, size))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bmah/bugbug/bugbug/vectordb.py", line 77, in <genexpr>
    (
  File "/Users/bmah/bugbug/bugbug/tools/code_review.py", line 1293, in vector_points
    for hunk, comment in items:
  File "/Users/bmah/bugbug/bugbug/tools/code_review.py", line 500, in retrieve_comments_with_hunks
    patch_set = PatchSet.from_string(self.load_raw_diff_by_id(diff_id))
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bmah/bugbug/bugbug/tools/code_review.py", line 407, in load_raw_diff_by_id
    raw_diff = patch.raw_diff
               ^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/Users/bmah/bugbug/bugbug/tools/code_review.py", line 317, in raw_diff
    raw_diff = phabricator.PHABRICATOR_API.load_raw_diff(self.diff_id)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bmah/bugbug/venv/lib/python3.12/site-packages/libmozdata/phabricator.py", line 280, in load_raw_diff
    return self.request("differential.getrawdiff", diffID=diff_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bmah/bugbug/venv/lib/python3.12/site-packages/libmozdata/phabricator.py", line 675, in request
    ConduitError.raise_if_error(data)
  File "/Users/bmah/bugbug/venv/lib/python3.12/site-packages/libmozdata/phabricator.py", line 199, in raise_if_error
    raise cls(
libmozdata.phabricator.ConduitError: Uninitialized string offset: 0
@benjaminmah benjaminmah added the bug Something isn't working label Dec 6, 2024
@suhaibmujahid
Copy link
Member

Could you specify the revision and the commit where this error happened?

@benjaminmah
Copy link
Contributor Author

Could you specify the revision and the commit where this error happened?

For some reason, when I re-run the script, each time I encounter the ConduitError, it is for a different diff_id.

For example, diff_id = 347446 or diff_id = 230067

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants