{"record":{"id":"159466d4edd3efbb","repo":"instructure/canvas-lms","slug":"not-importing-academic-benchmark-data-because-the-academic","errorCode":null,"errorMessage":"Not importing academic benchmark data because the Academic Benchmarks #{err}","messagePattern":"Not importing academic benchmark data because the Academic Benchmarks #(.+?)","errorType":"exception","errorClass":"Canvas::Migration::Error","httpStatus":null,"severity":"error","filePath":"gems/plugins/academic_benchmark/lib/academic_benchmark.rb","lineNumber":186,"sourceCode":"  end\n\n  def self.auth?(guid)\n    api_handle.standards.authorities.map(&:guid).include?(guid)\n  end\n\n  def self.check_args(authority, publication)\n    if authority.nil? && publication.nil?\n      raise Canvas::Migration::Error,\n            \"You must specify either an Authority or a Publication to import (both were nil)\"\n    end\n  end\n\n  def self.ensure_ab_credentials\n    err = nil\n    err ||= ensure_partner_id\n    err ||= ensure_partner_key\n    if err\n      raise Canvas::Migration::Error,\n            \"Not importing academic benchmark data because the Academic Benchmarks #{err}\"\n    end\n  end\n\n  def self.ensure_partner_id\n    unless AcademicBenchmark.config[:partner_id].present?\n      \"Partner ID is not set\"\n    end\n  end\n\n  def self.ensure_partner_key\n    unless AcademicBenchmark.config[:partner_key].present?\n      \"Partner key is not set\"\n    end\n  end\n\n  def self.authorized?\n    check_for_import_rights(","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/gems/plugins/academic_benchmark/lib/academic_benchmark.rb#L168-L204","documentation":"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.","triggerScenarios":"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).","commonSituations":"Fresh Canvas install with the plugin enabled but never configured; settings cleared during migration between environments; AB account credentials expired/rotated and removed.","solutions":["Configure the Academic Benchmark plugin settings: partner_id and partner_key (Account settings / plugin config)","Verify credentials with your Academic Benchmark representative and re-enter them","Ensure config is set for the correct root account/shard running the migration","Guard imports by checking AcademicBenchmark.config before enqueuing migrations"],"exampleFix":"// before (plugin settings empty)\n# => raises on import\n// after: Account settings -> Plugins -> Academic Benchmark\n# set Partner ID and Partner Key, then retry the import","handlingStrategy":"validation","validationCode":"cfg = AcademicBenchmark.config\nraise 'partner_id missing' unless cfg[:partner_id].present?\nraise 'partner_key missing' unless cfg[:partner_key].present?","typeGuard":null,"tryCatchPattern":"begin\n  AcademicBenchmark.import(...)\nrescue Canvas::Migration::Error => e\n  raise unless e.message.include?('Academic Benchmarks partner')\n  Rails.logger.error('Configure AB partner credentials')\nend","preventionTips":["Configure AB credentials during environment provisioning","Smoke-check AcademicBenchmark.config on deploy","Rotate credentials on schedule"],"tags":["academic-benchmark","credentials","plugin-configuration"],"backgroundTag":"missing-credentials","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"}