Hey all, I am having issues with Elasticsearch. I...
# replication-troubleshooting
c
Hey all, I am having issues with Elasticsearch. I am able to create the source and the test passes. Whenever I proceed to creating a connection though I get the following errors:
Copy code
Internal message: java.lang.RuntimeException: io.airbyte.integrations.source.elasticsearch.UnsupportedDatatypeException: Cannot map unsupported data type to Airbyte data type: completion
Failure type: system_error
Copy code
java.lang.RuntimeException: io.airbyte.integrations.source.elasticsearch.UnsupportedDatatypeException: Cannot map unsupported data type to Airbyte data type: completion
	at io.airbyte.integrations.source.elasticsearch.typemapper.ElasticsearchTypeMapper.lambda$formatJSONSchema$0(ElasticsearchTypeMapper.java:133)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at io.airbyte.integrations.source.elasticsearch.typemapper.ElasticsearchTypeMapper.formatJSONSchema(ElasticsearchTypeMapper.java:129)
	at io.airbyte.integrations.source.elasticsearch.typemapper.ElasticsearchTypeMapper.lambda$formatJSONSchema$0(ElasticsearchTypeMapper.java:131)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at io.airbyte.integrations.source.elasticsearch.typemapper.ElasticsearchTypeMapper.formatJSONSchema(ElasticsearchTypeMapper.java:129)
	at io.airbyte.integrations.source.elasticsearch.ElasticsearchSource.discover(ElasticsearchSource.java:78)
	at io.airbyte.cdk.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.java:159)
	at io.airbyte.cdk.integrations.base.IntegrationRunner.run(IntegrationRunner.java:125)
	at io.airbyte.integrations.source.elasticsearch.ElasticsearchSource.main(ElasticsearchSource.java:37)
Caused by: io.airbyte.integrations.source.elasticsearch.UnsupportedDatatypeException: Cannot map unsupported data type to Airbyte data type: completion
	at io.airbyte.integrations.source.elasticsearch.typemapper.ElasticsearchTypeMapper.formatJSONSchema(ElasticsearchTypeMapper.java:127)
	at io.airbyte.integrations.source.elasticsearch.typemapper.ElasticsearchTypeMapper.lambda$formatJSONSchema$0(ElasticsearchTypeMapper.java:131)
	... 9 more
I understand that there's an issue with the "completion" data type. It looks like it's not being handled by the Airbyte connector. But I cannot fork the connector in the connector builder nor can I edit any configs in the source. Does anyone have any advice on what I should do? Do I need to create my own connector from scratch?
k
You’re running into a known limitation of the Elasticsearch source: certain field types aren’t mapped by the connector’s type mapper, which causes discovery to fail with UnsupportedDatatypeException. Similar reports exist for other ES types like match_only_text and percolator, which fail during schema discovery with the same error pattern. [[ES source doc](https://docs.airbyte.com/integrations/sources/elasticsearch); [Issue: match_only_text](https://github.com/airbytehq/airbyte/issues/21479); [Issue: percolator](https://github.com/airbytehq/airbyte/issues/29932)] What you can do: - If possible, remove or ignore indices/fields using unsupported types before discovery, or adjust mappings on the Elasticsearch side so those fields are a supported type. The connector discovers all indices and maps types, and it fails when it hits an unsupported one. [[ES source doc](https://docs.airbyte.com/integrations/sources/elasticsearch)] - Build a custom connector that handles the unsupported type by mapping it to a reasonable Airbyte type (often string). You can: - Use Connector Builder if your source can be read via HTTP/JSON. However, the existing Java ES source can’t be “forked” inside Builder; Builder is for building new HTTP-based connectors, not editing compiled connectors. [[Connector Development](https://docs.airbyte.com/platform/connector-development); [Custom connectors](https://docs.airbyte.com/integrations/custom-connectors)] - If Builder doesn’t fit (likely here), implement a custom connector via the Low-Code CDK or a code-based CDK, and publish it as a custom connector in your workspace. [[Connector Development](https://docs.airbyte.com/platform/connector-development); [Custom connectors](https://docs.airbyte.com/integrations/custom-connectors)] - If you want this fixed upstream, open or upvote a GitHub issue requesting support for the completion type in the ES source; similar issues have been filed for other types. [[Issue: match_only_text](https://github.com/airbytehq/airbyte/issues/21479); [Issue: percolator](https://github.com/airbytehq/airbyte/issues/29932)] - As a practical path: 1) Try excluding indices/fields that use completion (if feasible) to allow discovery/sync to proceed. 2) Otherwise, create a custom connector that maps completion to a supported Airbyte type (e.g., string) and publish it to your workspace as a custom connector. [[Custom connectors](https://docs.airbyte.com/integrations/custom-connectors); [Connector Development](https://docs.airbyte.com/platform/connector-development)] Limitations: The knowledge sources don’t list completion specifically in the supported type map nor document an official workaround within the standard connector. The custom-connector route is the documented way to handle unsupported types today. [[ES source doc](https://docs.airbyte.com/integrations/sources/elasticsearch); [Custom connectors](https://docs.airbyte.com/integrations/custom-connectors)]