chatwoot/chatwoot · error · ArgumentError
Unsupported import source.
Error message
Unsupported import source.
What it means
Raised by DataImports::Source.source_class when data_import.source_provider is not a key of the PROVIDERS map ({ 'freshdesk' => ..., 'intercom' => ... }); PROVIDERS.fetch with a raise block produces ArgumentError 'Unsupported import source.'. This factory resolves which provider-specific Source class backs a DataImport, so an unknown provider has no implementation to instantiate.
Source
Thrown at app/services/data_imports/source.rb:15
class DataImports::Source
PROVIDERS = {
'freshdesk' => 'DataImports::Freshdesk::Source',
'intercom' => 'DataImports::Intercom::Source'
}.freeze
def self.for(data_import)
source_class(data_import.source_provider).new(
access_token: data_import.access_token,
source_metadata: data_import.source_metadata
)
end
def self.source_class(provider)
PROVIDERS.fetch(provider.to_s) { raise ArgumentError, 'Unsupported import source.' }.constantize
end
def self.supported?(provider)
PROVIDERS.key?(provider.to_s)
end
end
View on GitHub (pinned to ed230f9bc0)
Solutions
- Set source_provider to 'freshdesk' or 'intercom' (exact lowercase string).
- Guard the call with DataImports::Source.supported?(provider) and show a clear unsupported-source message instead of raising.
- If adding a new provider, register it in the PROVIDERS map and implement the matching Source class.
Example fix
# before
DataImports::Source.source_class('zendesk') # raises ArgumentError: Unsupported import source.
# after
unless DataImports::Source.supported?(data_import.source_provider)
return unsupported_provider_response
end
source = DataImports::Source.for(data_import) Defensive patterns
Strategy: validation
Validate before calling
unless DataImports::Source.supported?(data_import.source_provider)
render_error('Unsupported import source.') && next
end
source = DataImports::Source.for(data_import) Type guard
def supported_import_source?(provider) %w[freshdesk intercom].include?(provider.to_s) end
Prevention
- Call DataImports::Source.supported?(provider) before .for(data_import).
- Constrain source_provider at the model layer (inclusion validation) so bad rows cannot be created.
- Gate the provider dropdown in the UI to registered providers only.
When it happens
Trigger: DataImports::Source.for(data_import) with source_provider nil, 'zendesk', 'zoho', or any string other than 'freshdesk'/'intercom'; calling source_class('salesforce') directly.
Common situations: DataImport row created via console/API with a typo'd or future provider; provider column written before the supporting code shipped; nil provider from a bad migration or unfiltered params.
Related errors
- Freshdesk domain is required.
- Freshdesk API key is required.
- Select at least one data type to import.
- Intercom access key is required.
- Select at least one data type to import.
AI-assisted analysis of chatwoot/chatwoot@ed230f9bc0 (2026-08-21).
Data as JSON: /api/errors/1960bbf8ab7f180e.
Report an issue: GitHub.