Skip to content

Remove "ghost" papers from MongoDB where GCS file is deleted #545

Open

Description

@Rithish-2914

We currently have several "ghost" records in our MongoDB database. These are paper records where the underlying PDF file was deleted (or failed to upload) to our Google Cloud Storage bucket, but the database record was never removed.
Because the file_url points to a missing object, Google Cloud returns a 404 NoSuchKey XML error when users try to view or download them.
So users get infinte loading screen and download button not working

Activity

  1. Dx-Alz-xD commented on Nov 11, 2026

    @Dx-Alz-xD

    The userfacing part is handled on staging since #544
    the viewer checks the file first and shows "Paper Not Found" instead of loading forever, and downloads show "This paper is no longer available"
    whats left is deleting the ghost records themselves which needs access to the production database and bucket. If it helps, I can write a script that lists papers whose file is missing (dry run by default) for a maintainer to run

  2. Rithish-2914 commented on Nov 12, 2026

    @Rithish-2914
    ContributorAuthor

    The user-facing side is handled the viewer shows "Paper Not Found" and downloads block gracefully instead of hanging.

    What's left: a maintenance script to audit and hard-delete MongoDB records whose GCS file no longer exists. you can surely work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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