{"record":{"id":"319cfbbcd392992b","repo":"instructure/canvas-lms","slug":"missing-rubric-name-in-some-rows","errorCode":null,"errorMessage":"Missing 'Rubric Name' in some rows.","messagePattern":"Missing 'Rubric Name' in some rows\\.","errorType":"validation","errorClass":"DataFormatError","httpStatus":null,"severity":"error","filePath":"app/models/rubric_import.rb","lineNumber":110,"sourceCode":"      update!(error_count: 1, error_data: [{ message: I18n.t(\"The file is not a valid CSV file.\"), exception: e.message }])\n      track_error\n    rescue => e\n      ErrorReport.log_exception(\"rubrics_import\", e)\n      update!(error_count: 1, error_data: [{ message: I18n.t(\"An error occurred while importing rubrics.\"), exception: e.message }])\n      track_error\n      job_failed!\n    end\n  end\n\n  def process_rubrics\n    rubrics_by_name = RubricCSVImporter.new(attachment).parse\n    raise DataFormatError, I18n.t(\"The file is empty or does not contain valid rubric data.\") if rubrics_by_name.empty?\n\n    total_rubrics = rubrics_by_name.keys.count\n    error_data = []\n\n    rubrics_by_name.each_with_index do |(rubric_name, rubric_data), rubric_index|\n      raise DataFormatError, I18n.t(\"Missing 'Rubric Name' in some rows.\") if rubric_name.blank?\n\n      rubric = context.rubrics.build(rubric_imports_id: id)\n      criteria_hash = {}\n      rubric_data.each_with_index do |criterion, criterion_index|\n        raise DataFormatError, \"Missing 'Criteria Name' for #{rubric_name}\" if criterion[:description].blank?\n        raise DataFormatError, \"Missing ratings for #{criterion[:description]}\" if criterion[:ratings].empty?\n\n        ratings_hash = {}\n        criterion[:ratings].each_with_index do |rating, rating_index|\n          ratings_hash[rating_index.to_s] = {\n            \"description\" => rating[:description],\n            \"long_description\" => rating[:long_description],\n            \"points\" => rating[:points]\n          }\n        end\n        criteria_hash[criterion_index.to_s] = {\n          \"description\" => criterion[:description],\n          \"long_description\" => criterion[:long_description],","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/models/rubric_import.rb#L92-L128","documentation":"RubricImport#process_rubrics raises DataFormatError when a parsed rubric row has a blank rubric name key — the CSV has rows but at least one row is missing the 'Rubric Name' value, so the rubric cannot be identified or grouped.","triggerScenarios":"A data row in the rubric CSV with an empty 'Rubric Name' cell — e.g. the name was deleted, a criterion row was left without its rubric name repeated, trailing blank-ish rows, or a comma-shift caused values to fall into wrong columns.","commonSituations":"Deleting the rubric name while keeping criteria rows; spreadsheets converting empty cells to whitespace; CSV rows with missing commas shifting the name column; appending rows below the template without copying the name.","solutions":["Fill in the 'Rubric Name' cell for every data row in the CSV","Remove empty/blank rows at the end of the file","Open the CSV in a text editor to check that each row has the correct number of comma-separated fields","Re-download the template and rebuild the file, ensuring the name column is never blank"],"exampleFix":"// before\n,Criteria,Ratings\nEssay Rubric,Quality,\"Great:10\"\n// after\nEssay Rubric,Quality,\"Great:10\"","handlingStrategy":"validation","validationCode":"rows = CSV.read(uploaded_path, headers: true)\nblank_names = rows.select { |r| r[\"Rubric Name\"].to_s.strip.blank? }\nraise \"rows with blank Rubric Name: #{blank_names.size}\" unless blank_names.empty?","typeGuard":null,"tryCatchPattern":"begin\n  import.process\nrescue DataFormatError => e\n  flash[:error] = e.message\nend","preventionTips":["Repeat the rubric name on every criteria row of the CSV","Delete blank trailing rows before saving","Check column alignment in a text editor (no shifted commas)","Never leave the 'Rubric Name' cell empty when adding criteria"],"tags":["csv","import","rubrics","validation"],"backgroundTag":"empty-required-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"}