{"record":{"id":"a16f8522902ad740","repo":"instructure/canvas-lms","slug":"failed-creating-an-event-for-the-series-update-not-saved","errorCode":null,"errorMessage":"Failed creating an event for the series, update not saved","messagePattern":"Failed creating an event for the series, update not saved","errorType":"http","errorClass":"ActiveRecord::Rollback","httpStatus":400,"severity":"error","filePath":"app/controllers/calendar_events_api_controller.rb","lineNumber":1101,"sourceCode":"            end\n          end\n          events = events.take(dtstart_list.length)\n        end\n\n        if new_series_head\n          events[0].series_head = true\n        end\n\n        dtstart_list.each_with_index do |dtstart, i|\n          params_for_update = set_series_params(params_for_update, dtstart, duration)\n          event = events[i]\n          event.update_all = true if which != \"one\" && event&.series_uuid && event.series_head\n          if event.nil?\n            event = target_event.context.calendar_events.build(params_for_update)\n            events << event\n            unless event.grants_any_right?(@current_user, session, :create)\n              error = { message: t(\"Failed creating an event for the series, update not saved\"), status: :unauthorized }\n              raise ActiveRecord::Rollback\n            end\n\n            unless event.save\n              error = { message: t(\"Failed creating an event for the series, update not saved\") }\n              raise ActiveRecord::Rollback\n            end\n          else\n            event.updating_user = @current_user\n            unless event.grants_any_right?(@current_user, session, :update)\n              error = { message: t(\"Failed updating an event in the series, update not saved\"), status: :unauthorized }\n              raise ActiveRecord::Rollback\n            end\n\n            unless event.update(params_for_update)\n              error = { message: t(\"Failed updating an event in the series, update not saved\") }\n              raise ActiveRecord::Rollback\n            end\n          end","sourceCodeStart":1083,"sourceCodeEnd":1119,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/controllers/calendar_events_api_controller.rb#L1083-L1119","documentation":"Guard inside update_from_series: while growing a recurring series (the updated RRULE yields more occurrences than existing events), building and saving a new CalendarEvent occurrence failed (grant/save returned false). The transaction rolls back so no partial series is persisted.","triggerScenarios":"Thrown at app/controllers/calendar_events_api_controller.rb:1101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the new event's errors for why creation failed (invalid params_for_update, duration, or context restrictions)","Ensure the caller has permission to create events in the target context","Retry with corrected series update params"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}