{"record":{"id":"a26062803deb88a2","repo":"instructure/canvas-lms","slug":"no-new-id-or-new-integration-id-given-for-change-sis-id","errorCode":null,"errorMessage":"No new_id or new_integration_id given for change_sis_id","messagePattern":"No new_id or new_integration_id given for change_sis_id","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/sis/change_sis_id_importer.rb","lineNumber":70,"sourceCode":"\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\n        column = details[:column] || :sis_source_id","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/sis/change_sis_id_importer.rb#L52-L88","documentation":"process_change_sis_id raises this when both new_id and new_integration_id are blank. A change_sis_id entry exists to set a new SIS or integration identifier; with neither present there is nothing to write, so the row is rejected before any lookup.","triggerScenarios":"A change_sis_id row where new_id is empty AND new_integration_id is empty (e.g. only old_id supplied), such as a delete-style row submitted through the change endpoint.","commonSituations":"Attempting to 'clear' a SIS id by leaving new_id blank (unsupported — deletions go through the sis CSV delete path), or column-shifted CSV rows where new_id fell into the wrong column.","solutions":["Supply new_id with the desired new SIS identifier.","Or supply new_integration_id (use the literal <delete> to clear integration_id).","If the goal is removing an SIS id, use the standard SIS CSV delete mechanism instead of change_sis_id."],"exampleFix":"// before\nuser,old-sis-id,\n// after\nuser,old-sis-id,new-sis-id","handlingStrategy":"validation","validationCode":"if dc.new_id.blank? && dc.new_integration_id.blank?\n  raise ArgumentError, 'new_id or new_integration_id required'\nend\nprocess_change_sis_id(dc)","typeGuard":null,"tryCatchPattern":"begin\n  process_change_sis_id(dc)\nrescue SIS::ImportError => e\n  logger.warn(\"no-op row dropped: #{e.message}\")\nend","preventionTips":["Never submit change rows whose new columns are entirely empty; deletions use the SIS CSV delete path.","Guard against column drift in generated CSVs with a header+row width check.","Filter no-op rows (old == new) before import."],"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"}