fsockopen warning in PHP 1.3 API?

537 views
Skip to first unread message

Victorio Chavarria

unread,
Nov 4, 2013, 10:32:52 AM11/4/13
to mailchimp-...@googlegroups.com
Hi,

I use the PHP 1.3 API to add customers to my lists. Recently PHP has been reporting the following error in MCAPI.class.php:

E_WARNING: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://us4.api.mailchimp.com:443 (php_network_getaddresses: getaddrinfo failed: Name or service not known)

I happens when I call the listSubscribe function in MCAPI.class.php. Any idea what could cause this? It had been working great for several months and I'm able to ping us4.api.mailchimp.com from the server I'm using.

Thanks,

Victorio

Eric Muntz

unread,
Nov 5, 2013, 8:27:49 AM11/5/13
to mailchimp-api-discuss
When getaddrinfo fails with "Name or service not known" it's a DNS issue.  There's not much anybody can do to debug DNS without access to your servers and the ability to run some scripts.  I like this post about debugging DNS, in case you need some help figuring out what to do there: http://networking.ringofsaturn.com/Unix/dnstroubleshooting.php


--
You received this message because you are subscribed to the Google Groups "MailChimp API Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailchimp-api-di...@googlegroups.com.
To post to this group, send email to mailchimp-...@googlegroups.com.
Visit this group at http://groups.google.com/group/mailchimp-api-discuss.
For more options, visit https://groups.google.com/groups/opt_out.


Victorio Chavarria

unread,
Nov 11, 2013, 6:03:03 PM11/11/13
to mailchimp-...@googlegroups.com
Thanks, that helped. The DNS name server my server was using sometimes wouldn't work for the Mailchimp API. I edited /etc/resolv.conf (CentOS 6) to add Google's public name servers. Hopefully that'll take care of the problem.


On Tuesday, November 5, 2013 5:27:49 AM UTC-8, Eric Muntz wrote:
When getaddrinfo fails with "Name or service not known" it's a DNS issue.  There's not much anybody can do to debug DNS without access to your servers and the ability to run some scripts.  I like this post about debugging DNS, in case you need some help figuring out what to do there: http://networking.ringofsaturn.com/Unix/dnstroubleshooting.php
On Mon, Nov 4, 2013 at 10:32 AM, Victorio Chavarria <vict...@scavatec.com> wrote:
Hi,

I use the PHP 1.3 API to add customers to my lists. Recently PHP has been reporting the following error in MCAPI.class.php:

E_WARNING: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://us4.api.mailchimp.com:443 (php_network_getaddresses: getaddrinfo failed: Name or service not known)

I happens when I call the listSubscribe function in MCAPI.class.php. Any idea what could cause this? It had been working great for several months and I'm able to ping us4.api.mailchimp.com from the server I'm using.

Thanks,

Victorio

--
You received this message because you are subscribed to the Google Groups "MailChimp API Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailchimp-api-discuss+unsub...@googlegroups.com.

Eric Muntz

unread,
Nov 12, 2013, 8:16:53 AM11/12/13
to mailchimp-api-discuss
Awesome, I'm glad the link was helpful.  Google's name servers do a pretty solid job, so hopefully that'll solve everything for you.


To unsubscribe from this group and stop receiving emails from it, send an email to mailchimp-api-di...@googlegroups.com.

Vincent Pazeller

unread,
Feb 7, 2014, 5:30:31 AM2/7/14
to mailchimp-...@googlegroups.com
Hi, 

I am having a similar error since recently, and only occasionaly... So I wonder if this can also be a DNS problem (wouldn't it occur consistently?).

The error I get is 
fsockopen('us2.api.mailchimp.com', 80, 0, 'php_network_getaddresses: getaddrinfo failed: Name or service not known

I am using API v 1.3

Thank you for your help!

Vincent 

On Tuesday, November 12, 2013 2:16:53 PM UTC+1, Eric Muntz wrote:
Awesome, I'm glad the link was helpful.  Google's name servers do a pretty solid job, so hopefully that'll solve everything for you.
On Mon, Nov 11, 2013 at 6:03 PM, Victorio Chavarria <vict...@scavatec.com> wrote:
Thanks, that helped. The DNS name server my server was using sometimes wouldn't work for the Mailchimp API. I edited /etc/resolv.conf (CentOS 6) to add Google's public name servers. Hopefully that'll take care of the problem.


On Tuesday, November 5, 2013 5:27:49 AM UTC-8, Eric Muntz wrote:
When getaddrinfo fails with "Name or service not known" it's a DNS issue.  There's not much anybody can do to debug DNS without access to your servers and the ability to run some scripts.  I like this post about debugging DNS, in case you need some help figuring out what to do there: http://networking.ringofsaturn.com/Unix/dnstroubleshooting.php
On Mon, Nov 4, 2013 at 10:32 AM, Victorio Chavarria <vict...@scavatec.com> wrote:
Hi,

I use the PHP 1.3 API to add customers to my lists. Recently PHP has been reporting the following error in MCAPI.class.php:

E_WARNING: fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to ssl://us4.api.mailchimp.com:443 (php_network_getaddresses: getaddrinfo failed: Name or service not known)

I happens when I call the listSubscribe function in MCAPI.class.php. Any idea what could cause this? It had been working great for several months and I'm able to ping us4.api.mailchimp.com from the server I'm using.

Thanks,

Victorio

--
You received this message because you are subscribed to the Google Groups "MailChimp API Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailchimp-api-discuss+unsubscri...@googlegroups.com.
To post to this group, send email to mailchimp-...@googlegroups.com.

MailChimp Support

unread,
Feb 19, 2014, 7:56:34 AM2/19/14
to mailchimp-...@googlegroups.com
Hi Vincent,

This is going to be a DNS. I would recommend referencing the debugging post in Eric's reply above to resolve the issue.

Tyler

David Minor

unread,
Feb 20, 2014, 8:17:42 PM2/20/14
to mailchimp-...@googlegroups.com
I'm also getting occasional DNS errors, 1-2 per day. I added Google's public DNS to resolv.conf, but that did not solve the issue.

Could this be something in MailChimp's infrastructure?

MailChimp Support

unread,
Feb 21, 2014, 6:15:22 AM2/21/14
to mailchimp-...@googlegroups.com
Hi David,

Doubtful. Would you mind providing more specifics to the errors you're seeing and what conditions they are occurring under?

-Tyler

David Minor

unread,
Feb 21, 2014, 1:36:45 PM2/21/14
to mailchimp-...@googlegroups.com
We're using Spring's RestTemplate to interact with the API. Once or twice a day we see this in our logs:

org.springframework.web.client.ResourceAccessException: I/O error: us1.api.mailchimp.com; nested exception is java.net.UnknownHostException: us1.api.mailchimp.com

We make around 150 calls/day from a colo server.

MailChimp Support

unread,
Feb 24, 2014, 6:35:50 AM2/24/14
to mailchimp-...@googlegroups.com
Hey David,

Thanks for the information.  This error is more than likely going to be the result of a connectivity issue rather an an issue with the code being run. It indicates that the connection to our servers is unable to be resolved. This could be the result of a proxy or firewall issue that is interfering with access to us1.api.mailchimp.com or there's some other form of network issue preventing you from seeing us1.api.mailchimp.com (such as a DNS) issue.

Eric's post above about about debugging DNS, would be a great place to start in case you need some help figuring out what to do there: http://networking.ringofsaturn.com/Unix/dnstroubleshooting.php

-Tyler
Reply all
Reply to author
Forward
0 new messages