← Back to Dashboard
Verified Production Fix

[gitlab-org/gitlab] Offline transfer relation exports failing to fail

GL-gitlab-org/gitlab#592632 • Mar 07, 2026

### ROOT CAUSE The `perform_failure` method in `BulkImports::RelationExportWorker` does not account for the `offline_export_id` parameter, causing non-batched relation exports to fail improperly and hang in the started state. ### CODE FIX
ruby
# In app/workers/bulk_imports/relation_export_worker.rb

class BulkImports::RelationExportWorker < BaseWorker
  # ... existing code ...

  def perform_failure(id, offline_export_id = nil)
    # Find the relation exports using the provided offline_export_id
    relation_exports = if offline_export_id
                         RelationExport.where(offline_export_id: offline_export_id)
                       else
                         RelationExport.where(id: id)
                       end

    relation_exports.update_all(state: :failed)
    # Optionally log the failure for debugging
    Gitlab::ApplicationContextSaver.current.save(log_context.merge(action: :relation_export_failure))
  end

  # ... existing code ...
end


This fix ensures that both batched and non-batched relation exports are correctly updated to the failed state when a failure occurs.

Deploy with Vultr

Use this fix in production instantly. Claim your high-performance developer credit.

Get Started with Vultr →