I have admin permissions within our Glean resource. We are in the process of adding a custom data source through the indexing API. We were able to easily index every file necessary, however in order to get a better understanding of the capabilities within the python SDK I tried seeing if I could delete a document and re-index it.
Following this page: Delete document | Glean Developer I was able to successfully delete the file.
However, when trying to re-index the file on the same data source, I received a 200 response, and it seemingly went off without a hitch. This was a few days ago now when I ran this, and since then the document does not appear in the search in glean regardless of what I search for.
I thought maybe after the document was deleted, it needed to be reuploaded with a different doc_id, which I tried as well and got a 200, but still no dice when searching.
I ran
with Glean(
api_token=os.getenv("GLEAN_INDEXING_API_TOKEN", ""), #API token with access to the data source
instance=os.getenv("GLEAN_INSTANCE", ""),
) as glean:
res = glean.indexing.documents.debug(
datasource="mock_data_source", #Data source the doc should be associated with
object_type="mock_object_type",
doc_id="mock_doc_id/README.md" #Doc id of the re-indexed file
)
print(res)
When running the above the output was:
GleanError: Unexpected response received: Status 200. Body: {"status":{"uploadStatus":"UPLOADED","lastUploadedAt":"2025-12-05T20:44:47.660868Z","indexingStatus":"INDEXED","lastIndexedAt":"2025-12-09T14:08:43.39Z","permissionIdentityStatus":"UPLOADED"},"uploadedPermissions":{"allowAllDatasourceUsersAccess":true},"lifeCycleEvents":[]}
Although this raises a GleanError I believe this is just how the debug method works. So, this shows that it should be indexed, but once it still isn't in the search results.
I also checked that I had access to the file using the following:
with Glean(
api_token=os.getenv("GLEAN_INDEXING_API_TOKEN", ""),
instance=os.getenv("GLEAN_INSTANCE", ""),
) as glean:
glean.indexing.documents.check_access(
datasource="mock_data_source",
object_type="mock_object_type",
doc_id="mock_doc_id/README.md",
user_email="my_email.com")
And this returned true, implying I should have access to the file.
I also attempted running the following:
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
instance=os.getenv("GLEAN_INSTANCE", ""),
) as glean:
glean.indexing.documents.process_all()
And once again, this ran without issue implying that the file should be indexed.
I feel like I have exhausted all resources, and the document should appear in my search results, any ideas?