{"record":{"id":"cf029f1dedd6b514","repo":"instructure/canvas-lms","slug":"the-external-rubric-couldn-t-be-found-for-hash-title","errorCode":null,"errorMessage":"The external Rubric couldn't be found for \"#{hash[:title]}\", creating a copy.","messagePattern":"The external Rubric couldn't be found for \"#(.+?)\", creating a copy\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"app/models/importers/rubric_importer.rb","lineNumber":49,"sourceCode":"        begin\n          import_from_migration(rubric, migration)\n        rescue\n          migration.add_import_warning(t(\"#migration.rubric_type\", \"Rubric\"), rubric[:title], $!)\n        end\n      end\n    end\n\n    def self.import_from_migration(hash, migration, item = nil)\n      context = migration.context\n      hash = hash.with_indifferent_access\n      return nil if hash[:migration_id] && hash[:rubrics_to_import] && !hash[:rubrics_to_import][hash[:migration_id]]\n\n      rubric = nil\n      if !item && hash[:external_identifier]\n        rubric = context.available_rubric(hash[:external_identifier]) unless migration.cross_institution?\n\n        unless rubric\n          Rails.logger.warn(\"The external Rubric couldn't be found for \\\"#{hash[:title]}\\\", creating a copy.\")\n        end\n      end\n\n      if rubric\n        item = rubric\n      else\n        item ||= Rubric.where(context_id: context, context_type: context.class.to_s, id: hash[:id]).first\n        item ||= Rubric.where(context_id: context, context_type: context.class.to_s, migration_id: hash[:migration_id]).first if hash[:migration_id]\n\n        # avoid override a rubric used for grading\n        if item&.rubric_assessments&.any?\n          return migration.add_import_warning(\n            t(\"#migration.rubric_type\", \"Rubric\"),\n            hash[:title],\n            I18n.t(\"A rubric that has been used for grading cannot be overwritten.\")\n          )\n        end\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/models/importers/rubric_importer.rb#L31-L67","documentation":"RubricImporter resolves a rubric referenced by hash[:external_identifier] via context.available_rubric. When the rubric cannot be found (or the migration is cross-institution and lookup is skipped), it logs this warning and proceeds by creating a NEW copy of the rubric from the migration data instead of linking the existing one.","triggerScenarios":"A course-copy/migration item references a rubric by external_identifier that does not exist in the destination context's available rubrics, or migration.cross_institution? is true so the lookup is skipped by design.","commonSituations":"Importing content into a course/account that lacks the referenced rubric; rubric deleted at the destination; cross-institution course copy; importing a package whose rubric IDs are local to another account.","solutions":["Expected behavior in most cases: let the importer create the copy and verify the migrated rubric renders correctly","If linkage was intended, ensure the destination account/course actually contains the referenced rubric before importing","For cross-institution imports, confirm a copy is acceptable or import into the same account","Re-export the source content so rubric data is fully embedded in the migration package"],"exampleFix":"// before\nmigration.cross_institution? ? nil : context.available_rubric(hash[:external_identifier])\n# (cross-institution always warns and copies)\n// after\n# accept the copy, or pre-seed the destination with the referenced rubric so external_identifier resolves","handlingStrategy":"fallback","validationCode":"existing = context.available_rubric(hash[:external_identifier]) unless migration.cross_institution?\nputs(existing ? 'will link existing rubric' : 'will create copy')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-seed destination accounts with referenced rubrics if linkage matters","Expect a copy on cross-institution imports — verify the copied rubric afterwards","Re-export source content so rubric data is embedded in the package","Review migration warnings after import to catch unexpected copies"],"tags":["migrations","rubrics","course-copy","importers"],"backgroundTag":"entity-not-found","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"}