instructure/canvas-lms · error · ImportError
Improper status "# " for a user_observer
Error message
Improper status "#{status}" for a user_observer What it means
Validation guard in UserObserverImporter::Work#process_user_observer raised when the status argument is not one of the recognized workflow states (active/deleted etc.). The CSV supplied an unrecognized status string, so the observer-link row is rejected as malformed.
Solutions
- Use 'active' or 'deleted' as status
- Fix the CSV and re-run the batch
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/sis/user_observer_importer.rb:60 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15).
Data as JSON: /api/errors/4347de761edbcefc.
Report an issue: GitHub.
Appendix: source
Thrown at lib/sis/user_observer_importer.rb:60
attr_accessor :success_count,
:users_to_update_account_associations,
:user_observers_to_update_sis_batch_ids
def initialize(batch, root_account, logger)
@batch = batch
@root_account = root_account
@logger = logger
@success_count = 0
@users_to_update_account_associations = Set.new
@user_observers_to_update_sis_batch_ids = []
end
def process_user_observer(observer_id, student_id, status)
raise ImportError, "No observer_id given for a user observer" if observer_id.blank?
raise ImportError, "No user_id given for a user observer" if student_id.blank?
raise ImportError, "Can't observe yourself user #{student_id}" if student_id == observer_id
raise ImportError, "Improper status \"#{status}\" for a user_observer" unless /\A(active|deleted)\z/i.match?(status)
return if @batch.skip_deletes? && status =~ /deleted/i
o_pseudo = @root_account.pseudonyms.active.find_by(sis_user_id: observer_id)
raise ImportError, "An observer referenced a non-existent user #{observer_id}" unless o_pseudo
s_pseudo = @root_account.pseudonyms.active.find_by(sis_user_id: student_id)
raise ImportError, "A student referenced a non-existent user #{student_id}" unless s_pseudo
observer = o_pseudo.user
student = s_pseudo.user
raise ImportError, "Can't observe yourself user #{student_id}" if observer == student
add_remove_observer(observer, student, observer_id, student_id, status)
end
def add_remove_observer(observer, student, observer_id, student_id, status)
case status.downcase
when "active"View on GitHub (pinned to 1c9f0bb801)