instructure/canvas-lms · error · DataFormatError
Missing 'Rubric Name' in some rows.
Error message
Missing 'Rubric Name' in some rows.
What it means
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.
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
Example fix
// before ,Criteria,Ratings Essay Rubric,Quality,"Great:10" // after Essay Rubric,Quality,"Great:10"
Defensive patterns
Strategy: validation
Validate before calling
rows = CSV.read(uploaded_path, headers: true)
blank_names = rows.select { |r| r["Rubric Name"].to_s.strip.blank? }
raise "rows with blank Rubric Name: #{blank_names.size}" unless blank_names.empty? Try / catch
begin import.process rescue DataFormatError => e flash[:error] = e.message end
Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- The file is empty or does not contain valid assessment data.
- The file is empty or does not contain valid rubric data.
- Friendly description is too long (maximum is 255 characters)
- Invalid fields after ratings
- Invalid fields
AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15).
Data as JSON: /api/errors/319cfbbcd392992b.
Report an issue: GitHub.
Appendix: source
Thrown at app/models/rubric_import.rb:110
update!(error_count: 1, error_data: [{ message: I18n.t("The file is not a valid CSV file."), exception: e.message }])
track_error
rescue => e
ErrorReport.log_exception("rubrics_import", e)
update!(error_count: 1, error_data: [{ message: I18n.t("An error occurred while importing rubrics."), exception: e.message }])
track_error
job_failed!
end
end
def process_rubrics
rubrics_by_name = RubricCSVImporter.new(attachment).parse
raise DataFormatError, I18n.t("The file is empty or does not contain valid rubric data.") if rubrics_by_name.empty?
total_rubrics = rubrics_by_name.keys.count
error_data = []
rubrics_by_name.each_with_index do |(rubric_name, rubric_data), rubric_index|
raise DataFormatError, I18n.t("Missing 'Rubric Name' in some rows.") if rubric_name.blank?
rubric = context.rubrics.build(rubric_imports_id: id)
criteria_hash = {}
rubric_data.each_with_index do |criterion, criterion_index|
raise DataFormatError, "Missing 'Criteria Name' for #{rubric_name}" if criterion[:description].blank?
raise DataFormatError, "Missing ratings for #{criterion[:description]}" if criterion[:ratings].empty?
ratings_hash = {}
criterion[:ratings].each_with_index do |rating, rating_index|
ratings_hash[rating_index.to_s] = {
"description" => rating[:description],
"long_description" => rating[:long_description],
"points" => rating[:points]
}
end
criteria_hash[criterion_index.to_s] = {
"description" => criterion[:description],
"long_description" => criterion[:long_description],View on GitHub (pinned to 1c9f0bb801)