-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Connector Name
destination-hubspot
Connector Version
0.0.10
What step the error happened?
During the sync
Relevant information
The HubSpot destination connector throws IllegalStateException when the batch upsert API returns 409 Conflict, failing the entire sync.
java.lang.IllegalStateException: Invalid response with status code 409 while starting ingestion:
{"status":"error","message":"Contact already exists. Existing ID: 100887063864","correlationId":"...","category":"CONFLICT"}
Analysis
The 409 occurs when HubSpot's batch upsert cannot find a contact by the idProperty lookup, falls back to creating a new contact, and the creation fails due to a unique property constraint.
With idProperty: email and no duplicate emails in the source data, I am unsure what is causing Hubspot to return a 409. I suspect this is just a transient issue with the Hubspot API. Either way, these failures should not fail the sync. Some possible issues could be:
- Eventual consistency under load — with ~2,460 batches, HubSpot's email lookup index may temporarily lag behind recent writes, causing the lookup to miss an existing contact while the uniqueness check on creation catches it
- hs_additional_emails collision — if a source record's email doesn't match any contact's primary email but matches another contact's hs_additional_emails, the lookup could fail while creation conflicts. I confirmed this reproduces the exact 409:
curl -X POST '.../batch/upsert' -d '{"inputs": [{
"idProperty": "email",
"id": "new@example.com",
"properties": {"email": "new@example.com", "hs_additional_emails": "existing@example.com"}
}]}'
→ 409: "Contact already exists. Existing ID: 100887063864"
Expected Behavior
A single problematic record should not crash the entire sync. Failed records should be routed to the DLQ while the rest of the batch succeeds.
Relevant log output
Contribute
- Yes, I want to contribute
Internal Tracking: https://github.com/airbytehq/oncall/issues/11580