instructure/canvas-lms · error · Canvas::Migration::Error

Not importing academic benchmark data because the Academic…

Error message

Not importing academic benchmark data because the Academic Benchmarks #{err}

What it means

ensure_ab_credentials validates Academic Benchmark partner credentials from plugin settings; it collects the first missing piece (partner id or partner key) and raises Canvas::Migration::Error naming it. Without a partner id/key, AB API calls cannot authenticate, so imports abort before any network work.

Solutions

  1. Configure the Academic Benchmark plugin settings: partner_id and partner_key (Account settings / plugin config)
  2. Verify credentials with your Academic Benchmark representative and re-enter them
  3. Ensure config is set for the correct root account/shard running the migration
  4. Guard imports by checking AcademicBenchmark.config before enqueuing migrations

Example fix

// before (plugin settings empty)
# => raises on import
// after: Account settings -> Plugins -> Academic Benchmark
# set Partner ID and Partner Key, then retry the import
Defensive patterns

Strategy: validation

Validate before calling

cfg = AcademicBenchmark.config
raise 'partner_id missing' unless cfg[:partner_id].present?
raise 'partner_key missing' unless cfg[:partner_key].present?

Try / catch

begin
  AcademicBenchmark.import(...)
rescue Canvas::Migration::Error => e
  raise unless e.message.include?('Academic Benchmarks partner')
  Rails.logger.error('Configure AB partner credentials')
end

Prevention

When it happens

Trigger: Running an Academic Benchmark import while the `academic_benchmark` plugin settings lack partner_id or partner_key (ensure_partner_id / ensure_partner_key returned an error string).

Common situations: Fresh Canvas install with the plugin enabled but never configured; settings cleared during migration between environments; AB account credentials expired/rotated and removed.

Related errors


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

Appendix: source

Thrown at gems/plugins/academic_benchmark/lib/academic_benchmark.rb:186

  end

  def self.auth?(guid)
    api_handle.standards.authorities.map(&:guid).include?(guid)
  end

  def self.check_args(authority, publication)
    if authority.nil? && publication.nil?
      raise Canvas::Migration::Error,
            "You must specify either an Authority or a Publication to import (both were nil)"
    end
  end

  def self.ensure_ab_credentials
    err = nil
    err ||= ensure_partner_id
    err ||= ensure_partner_key
    if err
      raise Canvas::Migration::Error,
            "Not importing academic benchmark data because the Academic Benchmarks #{err}"
    end
  end

  def self.ensure_partner_id
    unless AcademicBenchmark.config[:partner_id].present?
      "Partner ID is not set"
    end
  end

  def self.ensure_partner_key
    unless AcademicBenchmark.config[:partner_key].present?
      "Partner key is not set"
    end
  end

  def self.authorized?
    check_for_import_rights(

View on GitHub (pinned to 1c9f0bb801)