{"record":{"id":"704877c9df1e7eb3","repo":"instructure/canvas-lms","slug":"a-partner-id-is-required-to-use-academic-benchmarks","errorCode":null,"errorMessage":"A partner ID is required to use Academic Benchmarks","messagePattern":"A partner ID is required to use Academic Benchmarks","errorType":"exception","errorClass":"Canvas::Migration::Error","httpStatus":null,"severity":"error","filePath":"gems/plugins/academic_benchmark/lib/academic_benchmark/converter.rb","lineNumber":43,"sourceCode":"      super(settings, \"academic_benchmark\")\n      @ratings_overrides = settings[:migration_options] || {}\n      @course[:learning_outcomes] = []\n      @partner_id = settings[:partner_id]\n      @partner_key = settings[:partner_key]\n    end\n\n    def export\n      unless content_migration\n        raise Canvas::Migration::Error,\n              \"Missing required content_migration settings\"\n      end\n      unless Account.site_admin.grants_right?(content_migration.user, :manage_global_outcomes)\n        raise Canvas::Migration::Error,\n              \"User isn't allowed to edit global outcomes\"\n      end\n      unless @archive_file\n        unless @partner_id.present? || AcademicBenchmark.ensure_partner_id.nil?\n          raise Canvas::Migration::Error, I18n.t(\"A partner ID is required to use Academic Benchmarks\")\n        end\n        unless @partner_key.present? || AcademicBenchmark.ensure_partner_key.nil?\n          raise Canvas::Migration::Error, I18n.t(\"A partner key is required to use Academic Benchmarks\")\n        end\n      end\n      if outcome_data.present?\n        if outcome_data.instance_of? AcademicBenchmarks::Standards::StandardsForest\n          outcome_data.trees.each do |t|\n            @course[:learning_outcomes] << t.root.build_outcomes(@ratings_overrides)\n          end\n        else\n          @course[:learning_outcomes] << outcome_data.root.build_outcomes(@ratings_overrides)\n        end\n      end\n      save_to_file\n      @course\n    end\n","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/gems/plugins/academic_benchmark/lib/academic_benchmark/converter.rb#L25-L61","documentation":"Canvas::Migration::Error raised in Converter#export when no archive file is supplied and neither a settings partner_id nor a plugin-configured partner ID (AcademicBenchmark.ensure_partner_id) is available. The Academic Benchmarks API requires a partner ID to authenticate.","triggerScenarios":"Exporting standards by GUID/authority (no archive_file) with @partner_id blank and AcademicBenchmark.config[:partner_id] nil (plugin not configured).","commonSituations":"Fresh Canvas installs where the academic_benchmark plugin settings were never filled in; partner_id typo'd or stored in the wrong plugin setting; pulling standards from the API in an environment missing config.","solutions":["Configure the plugin: Account site-admin plugin settings for academic_benchmark (partner_id) or AcademicBenchmark.config in the console.","Pass partner_id in the converter settings for this import.","Provide an archive_file of standards data so the API path (and partner id) is not needed.","Check config presence first: AcademicBenchmark.config&.dig(:partner_id)."],"exampleFix":"// before\nconverter = AcademicBenchmark::Converter.new({ content_migration: cm, guid: g })\nconverter.export\n// after\nconverter = AcademicBenchmark::Converter.new({ content_migration: cm, guid: g, partner_id: ENV['AB_PARTNER_ID'] })\nconverter.export","handlingStrategy":"validation","validationCode":"unless settings[:archive_file] || settings[:partner_id].present? || AcademicBenchmark.config&.dig(:partner_id)\n  raise 'configure partner_id or provide an archive file'\nend","typeGuard":null,"tryCatchPattern":"begin\n  converter.export\nrescue Canvas::Migration::Error => e\n  Rails.logger.error(\"AB config problem: #{e.message}\")\nend","preventionTips":["Configure plugin settings during environment provisioning.","Store partner_id in plugin settings, not ad-hoc ENV vars.","Prefer shipping an archive file when API credentials aren't available."],"tags":["configuration","api","migrations"],"backgroundTag":"missing-required-config-field","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"}