{"record":{"id":"b231629bab05f557","repo":"instructure/canvas-lms","slug":"no-outcome-file-or-guid-given","errorCode":null,"errorMessage":"No outcome file or guid given","messagePattern":"No outcome file or guid given","errorType":"exception","errorClass":"Canvas::Migration::Error","httpStatus":null,"severity":"error","filePath":"gems/plugins/academic_benchmark/lib/academic_benchmark/outcome_data.rb","lineNumber":28,"sourceCode":"# Software Foundation, version 3 of the License.\n#\n# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY\n# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more\n# details.\n#\n# You should have received a copy of the GNU Affero General Public License along\n# with this program. If not, see <http://www.gnu.org/licenses/>.\n\nmodule AcademicBenchmark\n  module OutcomeData\n    def self.load_data(options = {})\n      if options.key?(:archive_file)\n        OutcomeData::FromFile.new(options.slice(:archive_file))\n      elsif options.key?(:authority) || options.key?(:publication)\n        OutcomeData::FromApi.new(options)\n      else\n        raise Canvas::Migration::Error, \"No outcome file or guid given\"\n      end\n    end\n  end\nend\n","sourceCodeStart":10,"sourceCodeEnd":33,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/gems/plugins/academic_benchmark/lib/academic_benchmark/outcome_data.rb#L10-L33","documentation":"Canvas::Migration::Error raised by AcademicBenchmark::OutcomeData.load_data when the options hash contains neither :archive_file nor :authority/:publication keys, so there is no source for the outcome data.","triggerScenarios":"Calling OutcomeData.load_data with an empty options hash or options holding only unrelated keys (e.g. guid only without authority/publication/archive_file).","commonSituations":"Scripts importing by a bare GUID without mapping it to authority/publication; callers forgetting to pass the uploaded attachment; refactor dropping the archive_file key from options.","solutions":["Pass an uploaded file: load_data(archive_file: file_or_path).","Or pass API identifiers: load_data(authority: abrv) and/or publication: guid.","If you have a guid, translate it into the authority/publication options the loader expects.","Pre-check options before calling: ensure options[:archive_file] || options[:authority] || options[:publication]."],"exampleFix":"// before\nOutcomeData.load_data(guid: 'abc')\n// after\nOutcomeData.load_data(archive_file: attachment.open) # or authority: 'XYZ'","handlingStrategy":"validation","validationCode":"unless opts[:archive_file] || opts[:authority] || opts[:publication]\n  raise ArgumentError, 'need archive_file or authority/publication'\nend\nOutcomeData.load_data(opts)","typeGuard":null,"tryCatchPattern":"begin\n  data = AcademicBenchmark::OutcomeData.load_data(opts)\nrescue Canvas::Migration::Error => e\n  Rails.logger.warn(\"outcome load skipped: #{e.message}\")\n  data = nil\nend","preventionTips":["Map guids to authority/publication options before calling load_data.","Always pass the uploaded attachment through to options.","Validate option keys at the job boundary."],"tags":["missing-argument","migrations","ruby"],"backgroundTag":"missing-required-option","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"}