Error connecting Airbyte to Mailchimp API

Summary

Error encountered while trying to establish a connection between Airbyte and Mailchimp API, regardless of the API version used. The error message indicates a NameResolutionError when trying to connect to the Mailchimp API endpoint.


Question

Hello,

I’m trying to establish an Airbyte Mailchimp connection, but I always run into an error no matter which Mailchimp API version I use.

'ConnectionError(MaxRetryError(\'HTTPSConnectionPool(host=\\\'ba825b1e076d912.api.mailchimp.com\\\', port=443): Max retries exceeded with url: /3.0/ping (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x769fc3b0d280>: Failed to resolve \\\'ba825b1e076d9123.api.mailchimp.com\\\' ([Errno -2] Name or service not known)"))\'))'


2024-06-14 11:48:45 ERROR i.a.w.i.VersionedAirbyteStreamFactory(internalLog):313 - Check failed
2024-06-14 11:48:45 INFO i.a.w.g.DefaultCheckConnectionWorker(run):117 - Check connection job received output: io.airbyte.config.StandardCheckConnectionOutput@1debe8be[status=failed,message='ConnectionError(MaxRetryError(\'HTTPSConnectionPool(host=\\\'ba825b1e076d91238.api.mailchimp.com\\\', port=443): Max retries exceeded with url: /3.0/ping (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x769fc3b0d280>: Failed to resolve \\\'ba825b1e076d912385.api.mailchimp.com\\\' ([Errno -2] Name or service not known)"))\'))',additionalProperties={}]```

<br>

---

This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. [Click here](https://airbytehq.slack.com/archives/C021JANJ6TY/p1718366614897619) if you want 
to access the original thread.

[Join the conversation on Slack](https://slack.airbyte.com)

<sub>
["error", "connecting", "airbyte-mailchimp-connector", "mailchimp-api", "name-resolution-error"]
</sub>

DNS : the name doesnt exists. I use API key

have you tried to generate another API Key?
from the ending of API key is extracted data center &lt;dc&gt;

https://mailchimp.com/developer/marketing/docs/fundamentals/#api-structure
> The root url for the API is https://&lt;dc&gt;.<http://api.mailchimp.com/3.0/|api.mailchimp.com/3.0/>. The &lt;dc&gt; part of the URL corresponds to the data center for your account. For example, if the data center for your account is us6, all API endpoints for your account are available relative to <https://us6.api.mailchimp.com/3.0/>.
> There are a few ways to find your data center. It’s the first part of the URL you see in the<Login | Mailchimp_gaMTk0MTg5MTk0OS4xNzE4MzY3MTY2*_ga_N5HD1RTH6E*MTcxODM2OTcwMy4yLjEuMTcxODM2OTcwMy4wLjAuMTg4ODE2ODI5Mw…| API keys section> of your account; if the URL is <https://us6.mailchimp.com/account/api/>, then the data center subdomain is us6. It’s also appended to your API key in the form key-dc; if your API key is 0123456789abcdef0123456789abcde-us6, then the data center subdomain is us6. And finally, if you’re connecting via OAuth 2, you can find the data center associated with the token via the OAuth Metadata endpoint; for more information, see the <https://mailchimp.com/developer/marketing/guides/access-user-data-oauth-2/#implement-the-oauth-2-workflow-on-your-server|OAuth guide>.

I have regenerated the API key, but the Airbyte-Mailchimp 2.0.4 connector still doesn’t work. So far, the old version 1.1.0 worked without any issues, but now it doesn’t work either.

Actually, none of them work.

it looks like something has changed on Mailchimp side and connector needs to be updated
I’d recommend to add an issue https://github.com/airbytehq/airbyte/issues

if you would like to build your own fixed version of this connector, let me know; I can help you with that
it looks like changing a bit of code related to data_center should do the trick

Mailchimp is a certified connector, so it’ll get attention faster from Airbyte team

quick check from command line
nslookup <http://ba825b1e076d9123.api.mailchimp.com|ba825b1e076d9123.api.mailchimp.com>
it looks like this subdomain doesn’t exists

I checked related code
https://github.com/airbytehq/airbyte/blob/ff312756204f42ecd917de37837d88c9eebb06a7/airbyte-integrations/connectors/source-mailchimp/source_mailchimp/config_migrations.py#L26-L32|https://github.com/airbytehq/airbyte/blob/ff312756204f42ecd917de37837d88c9eebb06a7[…]nnectors/source-mailchimp/source_mailchimp/config_migrations.py

do you use OAuth 2.0 or API Key as authentication?

I have also tried the newest version of Mailchimp API , but then i got thius error : Unknown error (http.504.kDmgWW6zaGwbMDUqhcuZqQ)