chatwoot/chatwoot · error · ArgumentError
Select at least one data type to import.
Error message
Select at least one data type to import.
What it means
Raised by both Freshdesk and Intercom credentials validators as an ArgumentError when @import_types is blank. DataImport::IMPORT_TYPES is %w[contacts conversations], and an import that selects nothing has no work to do and cannot run the per-type probe API calls, so the validator rejects it up front.
Source
Thrown at app/services/data_imports/freshdesk/credentials_validator.rb:20
def initialize(domain:, api_key:, import_types:)
@domain = domain
@api_key = api_key.to_s.strip
@import_types = Array(import_types).compact_blank
end
def perform
validate_parameters!
client.list_contacts(per_page: 1) if @import_types.include?('contacts')
client.list_tickets(per_page: 1) if @import_types.include?('conversations')
{}
end
private
def validate_parameters!
raise ArgumentError, 'Freshdesk domain is required.' if @domain.blank?
raise ArgumentError, 'Freshdesk API key is required.' if @api_key.blank?
raise ArgumentError, 'Select at least one data type to import.' if @import_types.blank?
invalid_types = @import_types - DataImport::IMPORT_TYPES
raise ArgumentError, "Unsupported import types: #{invalid_types.join(', ')}" if invalid_types.present?
DataImports::Freshdesk::Client.normalize_domain(@domain)
end
def client
@client ||= DataImports::Freshdesk::Client.new(domain: @domain, api_key: @api_key)
end
end
View on GitHub (pinned to ed230f9bc0)
Solutions
- Select at least one of 'contacts' or 'conversations' and resubmit.
- In code, pass import_types: %w[contacts] or %w[contacts conversations].
- Default the form/UI selection so the request cannot go out with an empty list.
Example fix
# before DataImports::Freshdesk::CredentialsValidator.new(domain: domain, api_key: api_key, import_types: []).perform # raises # after DataImports::Freshdesk::CredentialsValidator.new(domain: domain, api_key: api_key, import_types: %w[contacts conversations]).perform
Defensive patterns
Strategy: validation
Validate before calling
types = Array(params[:import_types]).presence || %w[contacts conversations] raise ArgumentError, 'Select at least one data type to import.' if types.blank?
Prevention
- Default the form to at least one selected data type.
- Use Array() around the param so a single string still becomes a one-element list.
- Disable the submit button while the selection is empty.
When it happens
Trigger: Calling the validator with import_types: nil, import_types: [] or import_types: '' (checkboxes for contacts/conversations both unchecked).
Common situations: UI form submitted with no data-type checkbox selected; front-end defaults failed to preselect a type; programmatic caller forgot to set import_types when creating the DataImport record.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
- Freshdesk domain is required.
- Unsupported import types: #{invalid_types.join(', ')}
- Select at least one data type to import.
- Freshdesk API key is required.
- Intercom access key is required.
AI-assisted analysis of chatwoot/chatwoot@ed230f9bc0 (2026-08-21).
Data as JSON: /api/errors/7b78896b097ea34d.
Report an issue: GitHub.