Skip to content

error in returning edit history for cells previously connected to multi soma object #526

@bpdanskin

Description

@bpdanskin

Running through the edit history in the V1DD dataset, I found the chunkedgraph function get_change_log() times out for some root ids. Seemingly if part of their lineage graph overlaps with a massively merged object. This happens even when the filtered=True argument is included.

observed this in the V1DD dataset for 50 root ids

client = CAVEclient(datastack_name='v1dd')
cg = client.chunkedgraph

root_id = 864691132664065604
client.chunkedgraph.get_change_log(root_id, filtered=True)


HTTPError Traceback (most recent call last)
1 root_id = 864691132664065604 # 864691132716483917
----> 2 client.chunkedgraph.get_change_log(root_id, filtered=True)

File ~\anaconda3\envs\microns_2025\Lib\site-packages\caveclient\chunkedgraph.py:349, in ChunkedGraphClient.get_change_log(self, root_id, filtered)
346 params = {"filtered": filtered}
347 response = self.session.get(url, params=params)
--> 349 return handle_response(response)

File ~\anaconda3\envs\microns_2025\Lib\site-packages\caveclient\base.py:94, in handle_response(response, as_json, log_warning)
92 """Deal with potential errors in endpoint response and return json for default case"""
93 # NOTE: consider adding "None on 404" as an option?
---> 94 _raise_for_status(response, log_warning=log_warning)
95 _check_authorization_redirect(response)
96 if as_json:

File ~\anaconda3\envs\microns_2025\Lib\site-packages\caveclient\base.py:84, in _raise_for_status(r, log_warning)
76 http_error_msg = "%s Server Error: %s for url: %s content:%s" % (
77 r.status_code,
78 reason,
79 r.url,
80 r.content,
81 )
83 if http_error_msg:
---> 84 raise requests.HTTPError(http_error_msg, response=r)
85 if log_warning:
86 warning = r.headers.get("Warning")

HTTPError: 500 Server Error: for url: https://api.em.brain.allentech.org/segmentation/api/v1/table/aibs_v1dd/root/864691132664065604/change_log?filtered=True content:b'{\n "code": 500,\n "duration": 38270.03836631775,\n "message": "",\n "timestamp": "2025-06-27 01:36:59.553357",\n "traceback": [\n "Traceback (most recent call last):\n",\n " File \"/app/pychunkedgraph/graph/chunkedgraph.py\", line 207, in get_parents\n parents.append(parent_rows[id_][0].value)\n ~~~~~~~~~~~^^^^^\n",\n "KeyError: 667658644762236064\n",\n "\nThe above exception was the direct cause of the following exception:\n\n",\n "Traceback (most recent call last):\n",\n " File \"/app/venv/lib/python3.11/site-packages/flask/app.py\", line 1484, in full_dispatch_request\n rv = self.dispatch_request()\n ^^^^^^^^^^^^^^^^^^^^^^^\n",\n " File \"/app/venv/lib/python3.11/site-packages/flask/app.py\", line 1469, in dispatch_request\n return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",\n " File \"/app/venv/lib/python3.11/site-packages/middle_auth_client/decorators.py\", line 296, in decorated_function\n return f(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^\n",\n " File \"/app/venv/lib/python3.11/site-packages/middle_auth_client/decorators.py\", line 418, in decorated_function\n return f(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^\n",\n " File \"/app/pychunkedgraph/app/app_utils.py\", line 50, in decorated_function\n return f(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^\n",\n " File \"/app/pychunkedgraph/app/segmentation/v1/routes.py\", line 428, in change_log\n log = common.change_log(table_id, root_id, filtered)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",\n " File \"/app/pychunkedgraph/app/segmentation/common.py\", line 813, in change_log\n return history.change_log_summary(filtered=filtered)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",\n " File \"/app/pychunkedgraph/graph/segmenthistory.py\", line 206, in change_log_summary\n tabular_changelog = self.tabular_changelog(root_id, filtered=filtered)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",\n " File \"/app/pychunkedgraph/graph/segmenthistory.py\", line 300, in tabular_changelog\n tabular_changelog = self.tabular_changelogs[root_id].copy()\n ^^^^^^^^^^^^^^^^^^^^^^^\n",\n " File \"/app/pychunkedgraph/graph/segmenthistory.py\", line 92, in tabular_changelogs\n self._tabular_changelogs = self._build_tabular_changelogs()\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",\n " File \"/app/pychunkedgraph/graph/segmenthistory.py\", line 143, in _build_tabular_changelogs\n root_lookup(edited_sv_ids, root_ts)\n",\n " File \"/app/pychunkedgraph/graph/segmenthistory.py\", line 128, in \n self.cg.get_roots(sv_ids, time_stamp=ts),\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",\n " File \"/app/pychunkedgraph/graph/chunkedgraph.py\", line 409, in get_roots\n temp_ids = self.get_parents(\n ^^^^^^^^^^^^^^^^^\n",\n " File \"/app/pychunkedgraph/graph/chunkedgraph.py\", line 212, in get_parents\n raise KeyError from exc\n",\n "KeyError\n"\n ]\n}\n'

checking the lineage graph for the same root returns a nonsensical 30k nodes in the lineage

len(client.chunkedgraph.get_lineage_graph(root_id)['nodes'])

30986

many of the nodes in the lineage history have no overlap with the final root that I can see, at best very minimally. ngl view with the first node in the lineage (red) and root id of interest (cyan): https://spelunker.cave-explorer.org/#!middleauth+https://global.daf-apis.com/nglstate/api/v1/5569223731445760

Here is a list of all the root ids this failed for, for troubleshooting:
[864691132908154757, 864691132716483917, 864691132664065604,
864691132908802693, 864691132604748205, 864691132574630714,
864691133000884661, 864691133063965256, 864691132741556889,
864691132940985566, 864691132719417002, 864691132810268041,
864691132710361131, 864691132654010227, 864691132831149945,
864691132558380553, 864691132685809013, 864691132656157894,
864691133121018469, 864691132686920900, 864691132548989250,
864691133121058917, 864691132841859508, 864691133012237008,
864691132645783678, 864691132564267726, 864691132663317060,
864691132906545134, 864691132734943964, 864691132681891923,
864691132726306202, 864691132713267013, 864691132841479686,
864691132670826769, 864691132708580390, 864691132739953347,
864691132796160751, 864691132586397666, 864691132713050693,
864691132670901967, 864691132712062021, 864691132762917470,
864691132804428390, 864691132738754152, 864691132779830688,
864691132835761544, 864691132785806732, 864691132598451263,
864691132619337159, 864691132687247431]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions