{"record":{"id":"26768f550c5bba09","repo":"instructure/canvas-lms","slug":"no-old-id-or-old-integration-id-given-for-change-sis-id","errorCode":null,"errorMessage":"No old_id or old_integration_id given for change_sis_id","messagePattern":"No old_id or old_integration_id given for change_sis_id","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/change_sis_id_importer.rb","lineNumber":69,"sourceCode":"    end\n\n    class Work\n      attr_accessor :success_count,\n                    :things_to_update_batch_ids,\n                    :users_to_sync\n\n      def initialize(batch, root_account, logger)\n        @batch = batch\n        @root_account = root_account\n        @logger = logger\n        @success_count = 0\n        @things_to_update_batch_ids = {}\n        @users_to_sync = Set.new\n      end\n\n      def process_change_sis_id(data_change)\n        raise ImportError, \"No type given for change_sis_id\" if data_change.type.blank?\n        raise ImportError, \"No old_id or old_integration_id given for change_sis_id\" if data_change.old_id.blank? && data_change.old_integration_id.blank?\n        raise ImportError, \"No new_id or new_integration_id given for change_sis_id\" if data_change.new_id.blank? && data_change.new_integration_id.blank?\n\n        type = data_change.type.downcase.strip\n        things_to_update_batch_ids[type] ||= Set.new\n\n        types = {\n          \"user\" => { scope: @root_account.pseudonyms, column: :sis_user_id },\n          \"course\" => { scope: @root_account.all_courses },\n          \"section\" => { scope: @root_account.course_sections },\n          \"term\" => { scope: @root_account.enrollment_terms },\n          \"account\" => { scope: @root_account.all_accounts },\n          \"group\" => { scope: @root_account.all_groups },\n          \"group_category\" => { scope: @root_account.all_group_categories },\n        }\n\n        details = types[type]\n        raise ImportError, \"Invalid type '#{type}' for change_sis_id\" unless details\n","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/change_sis_id_importer.rb#L51-L87","documentation":"process_change_sis_id raises this when both old_id and old_integration_id are blank. The importer must be told which existing record to re-key; with neither identifier it cannot find the row to update. Checked immediately after the type check.","triggerScenarios":"A change_sis_id row where the old_id column is empty AND the old_integration_id column is empty (e.g. only new_id supplied).","commonSituations":"CSV export scripts that only emit the new value, template rows filled in partially, or confusion between old_id/old_integration_id vs new_id/new_integration_id column ordering.","solutions":["Provide old_id (the current sis_source_id/sis_user_id) for the record.","Or provide old_integration_id if the record is identified by its integration_id.","Verify column order in the change_sis_id CSV matches the documented header."],"exampleFix":"// before\nuser,,new-sis-id\n// after\nuser,old-sis-id,new-sis-id","handlingStrategy":"validation","validationCode":"if dc.old_id.blank? && dc.old_integration_id.blank?\n  raise ArgumentError, 'old_id or old_integration_id required'\nend\nprocess_change_sis_id(dc)","typeGuard":null,"tryCatchPattern":"begin\n  process_change_sis_id(dc)\nrescue SIS::ImportError => e\n  errors << { row: dc, error: e.message }\nend","preventionTips":["Ensure the exporter always emits old_id (or old_integration_id).","Check column order against the documented header after any CSV template change.","Validate rows with a preflight script before submitting the batch."],"tags":["sis","ruby","import","missing-field"],"backgroundTag":"missing-required-argument","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"}