{"record":{"id":"f041d1bdd00e5686","repo":"instructure/canvas-lms","slug":"no-exported-data-to-import","errorCode":null,"errorMessage":"No exported data to import","messagePattern":"No exported data to import","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/models/content_migration.rb","lineNumber":1092,"sourceCode":"      if send_item_notifications && (shift_dates || remove_dates)\n        errors.add(:date_shift_options, t(\"shift_dates or remove_dates cannot be combined with send_item_notifications\"))\n      end\n    end\n  end\n\n  scope :for_context, ->(context) { where(context_id: context, context_type: context.class.to_s) }\n\n  scope :successful, -> { where(workflow_state: \"imported\") }\n  scope :running, -> { where(workflow_state: [\"exporting\", \"importing\"]) }\n  scope :waiting, -> { where(workflow_state: \"exported\") }\n  scope :failed, -> { where(workflow_state: [\"failed\", \"pre_process_error\"]) }\n\n  def complete?\n    %w[imported failed pre_process_error].include?(workflow_state)\n  end\n\n  def download_exported_data\n    raise \"No exported data to import\" unless exported_attachment\n\n    config = ConfigFile.load(\"external_migration\") || {}\n    @exported_data_zip = exported_attachment.open(\n      temp_folder: config[:data_folder]\n    )\n    @exported_data_zip\n  end\n\n  def create_all_files_path(temp_path)\n    \"#{temp_path}_all_files.zip\"\n  end\n\n  def clear_migration_data\n    @zip_file&.close\n    @zip_file = nil\n  end\n\n  def finished_converting","sourceCodeStart":1074,"sourceCodeEnd":1110,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/models/content_migration.rb#L1074-L1110","documentation":"Guard in ContentMigration#download_exported_data: the migration has no exported data available (the export step never produced/attached a file, or it was cleared), so this error signals there is nothing to import. Typically raised when a migration is resumed/retried without a completed export.","triggerScenarios":"Calling download_exported_data on a ContentMigration whose exported_attachment was never created, was deleted, or belongs to a migration that failed before export completed.","commonSituations":"Migration job retried after the exported attachment was purged; export step failed or was skipped but import was invoked; canvas export plugin removed the attachment during cleanup; migrations queue processing order issues.","solutions":["Re-run the content export step so exported_attachment is created, then retry the import","Inspect the migration's workflow_state/exported_attachment association to confirm the export actually completed","Check attachment retention/cleanup jobs that may have deleted the exported zip"],"exampleFix":"# before\nmigration.download_exported_data\n# after\nif migration.exported_attachment\n  migration.download_exported_data\nelse\n  migration.export_content # regenerate the export first\nend","handlingStrategy":"validation","validationCode":"raise 'nothing exported yet' unless migration.exported_attachment.present?","typeGuard":"null","tryCatchPattern":"begin\n  migration.download_exported_data\nrescue RuntimeError => e\n  raise e unless e.message == 'No exported data to import'\n  migration.export_content # regenerate export then retry\nend","preventionTips":["Only run import steps after export workflow_state indicates completion","Monitor attachment cleanup jobs that could purge exported zips","Retry the full export+import pipeline rather than import alone"],"tags":["ruby","content-migration","attachment"],"backgroundTag":"entity-not-found","analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}