theforeman/foreman · error · ArgumentError

Invalid input format. Please use the format '${id}-[Users|Us

Error message

Invalid input format. Please use the format '${id}-[Users|Usergroups]'.

What it means

Error "Invalid input format. Please use the format '${id}-[Users|Usergroups]'." thrown in theforeman/foreman.

Source

Thrown at app/services/owner_classifier.rb:23

  def self.classify_owner(id_and_type)
    return nil if id_and_type.blank?

    validate_input_format!(id_and_type)

    owner_type = id_and_type.end_with?('Users') ? User : Usergroup
    owner_type.find(id_and_type.to_i)
  end

  def user_or_usergroup
    Foreman::Deprecation.deprecation_warning("3.12", "`user_or_usergroup` is deprecated, use `classify_owner` instead.")

    OwnerClassifier.classify_owner(@id_and_type)
  end

  def self.validate_input_format!(id_and_type)
    unless id_and_type.is_a?(String) && id_and_type.match?(/^\d+-(Users|Usergroups)$/)
      raise ArgumentError, _("Invalid input format. Please use the format '${id}-[Users|Usergroups]'.")
    end
  end
end

View on GitHub (pinned to 6b05625475)

When it happens

Trigger: Thrown at app/services/owner_classifier.rb:23 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of theforeman/foreman@6b05625475 (2026-08-23). Data as JSON: /api/errors/d56174c2b8030dd6. Report an issue: GitHub.