RecordNotFound CI exception is spamming log files, cancelling job results in 404

I have an issue where my exceptions log is being spammed with multiple gigabytes of data every day, the problem seems to be related to a build that is stuck somehow, but I cannot figure out which build, probably because the record for it is missing. I haven’t been able to find any related issues to this one. How can I clear this build that is giving me problems?

GitLab version: 13.1.2 (2e7a6f64b07)
GitLab type: self-hosted

edit: I was able to find the build, but clicking on any of the links or trying to cancel it gives me a 404 not found:

production.log:

StuckCiJobsWorker: Dropping outdated build 3807 for runner 3 (status: running, timeout: 3600, reason: stuck_or_timeout_failure)

exceptions_json.log:

{
  "severity":"ERROR",
  "time":"2020-07-12T15:45:55.875Z",
  "correlation_id":"97fa5f83b955e98f5e401128f0c72837",
  "extra.sidekiq":{
    "queue":"cronjob:stuck_ci_jobs",
    "args":[

    ],
    "class":"StuckCiJobsWorker",
    "retry":false,
    "queue_namespace":"cronjob",
    "jid":"1d57f00f2a88a47728516ef8",
    "created_at":1594126802.2809052,
    "meta.caller_id":"Cronjob",
    "correlation_id":"97fa5f83b955e98f5e401128f0c72837",
    "enqueued_at":1594126802.306701
  },
  "extra.build_id":3807,
  "extra.build_name":"assemble",
  "extra.build_stage":"assemble",
  "extra.pipeline_id":1000,
  "extra.project_id":6,
  "exception.class":"ActiveRecord::RecordNotFound",
  "exception.message":"Couldn't find Ci::Build with 'id'=3807 [WHERE \"ci_builds\".\"type\" = $1]",
  "exception.backtrace":[
    "lib/gitlab/optimistic_locking.rb:17:in `rescue in retry_lock'",
    "lib/gitlab/optimistic_locking.rb:7:in `retry_lock'",
    "app/workers/stuck_ci_jobs_worker.rb:73:in `drop_build'",
    "app/workers/stuck_ci_jobs_worker.rb:42:in `block in drop'",
    "app/workers/stuck_ci_jobs_worker.rb:65:in `block (3 levels) in search'",
    "app/workers/concerns/worker_context.rb:63:in `block in with_context'",
    "lib/gitlab/application_context.rb:52:in `block in use'",
    "lib/gitlab/application_context.rb:52:in `use'",
    "app/workers/concerns/worker_context.rb:63:in `with_context'",
    "app/workers/stuck_ci_jobs_worker.rb:65:in `block (2 levels) in search'",
    "app/workers/stuck_ci_jobs_worker.rb:64:in `each'",
    "app/workers/stuck_ci_jobs_worker.rb:64:in `block in search'",
    "app/workers/stuck_ci_jobs_worker.rb:56:in `loop'",
    "app/workers/stuck_ci_jobs_worker.rb:56:in `search'",
    "app/workers/stuck_ci_jobs_worker.rb:41:in `drop'",
    "app/workers/stuck_ci_jobs_worker.rb:22:in `perform'",
    "lib/gitlab/application_context.rb:52:in `block in use'",
    "lib/gitlab/application_context.rb:52:in `use'",
    "lib/gitlab/with_request_store.rb:17:in `enabling_request_store'",
    "lib/gitlab/with_request_store.rb:10:in `with_request_store'",
    "lib/gitlab/sidekiq_daemon/monitor.rb:49:in `within_job'"
  ]
}