instructure/canvas-lms · error

No exported data to import

Error message

No exported data to import

What it means

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.

Solutions

  1. Re-run the content export step so exported_attachment is created, then retry the import
  2. Inspect the migration's workflow_state/exported_attachment association to confirm the export actually completed
  3. Check attachment retention/cleanup jobs that may have deleted the exported zip

Example fix

# before
migration.download_exported_data
# after
if migration.exported_attachment
  migration.download_exported_data
else
  migration.export_content # regenerate the export first
end
Defensive patterns

Strategy: validation

Validate before calling

raise 'nothing exported yet' unless migration.exported_attachment.present?

Type guard

null

Try / catch

begin
  migration.download_exported_data
rescue RuntimeError => e
  raise e unless e.message == 'No exported data to import'
  migration.export_content # regenerate export then retry
end

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15). Data as JSON: /api/errors/f041d1bdd00e5686. Report an issue: GitHub.

Appendix: source

Thrown at app/models/content_migration.rb:1092

      if send_item_notifications && (shift_dates || remove_dates)
        errors.add(:date_shift_options, t("shift_dates or remove_dates cannot be combined with send_item_notifications"))
      end
    end
  end

  scope :for_context, ->(context) { where(context_id: context, context_type: context.class.to_s) }

  scope :successful, -> { where(workflow_state: "imported") }
  scope :running, -> { where(workflow_state: ["exporting", "importing"]) }
  scope :waiting, -> { where(workflow_state: "exported") }
  scope :failed, -> { where(workflow_state: ["failed", "pre_process_error"]) }

  def complete?
    %w[imported failed pre_process_error].include?(workflow_state)
  end

  def download_exported_data
    raise "No exported data to import" unless exported_attachment

    config = ConfigFile.load("external_migration") || {}
    @exported_data_zip = exported_attachment.open(
      temp_folder: config[:data_folder]
    )
    @exported_data_zip
  end

  def create_all_files_path(temp_path)
    "#{temp_path}_all_files.zip"
  end

  def clear_migration_data
    @zip_file&.close
    @zip_file = nil
  end

  def finished_converting

View on GitHub (pinned to 1c9f0bb801)