The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Looks like my IP is filtered

Highlighted
Occasional Participant

Looks like my IP is filtered

Here is my situation:

- API implementation worked fine for more than 1 year at catskillmtn.org

- the site has code implemented to allow people to sign up or update their subscription

- now I noticed that updating is not working anymore http://www.catskillmtn.org/newsletter/ ;  when an existing email address is submitted, the page hangs or shows a blank page

- interesting part is that the subscription part of the site works fine when I run the site from my local server (not public)

 

Looks like there is something wrong between http://www.catskillmtn.org 's server and CC's server. 

 

Can you please let me know what's the solution is this situation?

 

Thanks!

5 REPLIES 5
Highlighted
Trusted Contributor

Re: Looks like my IP is filtered

Hello,

 

I'm sorry your experiencing this, and hope that I can offer some insights here that may be helpful.

 

Is your site currently undergoing maintenance?  I was able to access it to successfully add two test email addresses using your form earlier, which indicates we are definitely not filtering your IP, which is unlikely at any rate, but later, when I cam back to your site, it would not even load in my browser. When it did load, I can tell you that in some browsers I got a blank page response to what would have been the update request in Safari, but in Chrome, an error displayed (Error 324 (net::ERR_EMPTY_RESPONSE).

 

This error appears to be a response from your server, when your form pages post back to themselves upon submissions that would trigger an API request to update contact details. I wasn't able to determine if the updates were successful due to the sight now being inaccessible, but if not, it would appear that either the API request for updates is not getting made, or that for some reason our API's error response upon failure of the request is not being handled properly by your script. 

 

It's possible that a network hardware or server reset may resolve the issue if it is being caused by a runaway process, and you may want to reset, or request such a reset, especially if the current downtime I'm seeing isn't due to scheduled maintenace.

 

In the meantime, in the event that the issue is being caused by our API's response, it may help to learn what CMS you are using to run your site (Joomla, Drupal, Wordpress?), and whether your signup form is a custom integration, or a plugin or widget developed by a third party?  

 

Mark Coleman
Support Engineer
Highlighted
Occasional Participant

Re: Looks like my IP is filtered

Hi,

 

The server was rebooted and the kernel upgraded but the problem is not fixed.

 

Now the code is moved to http://www.catskillmtn.org/newsletter/test.html and here is just a simple call to an existing email address. First 3 times when I open the page I get a blank page and apache process dies and next time the page just hangs.

 

All these never happens if the email address is new.

 

Is there any way to track the calls from our site on your end?

 

Below is the code from test.html . Curl call is copied from the library.

 

$cc = new CC_Contact();
$subscriber_url = $cc->subscriberExists($email);

$row['email_address'] = $email;
$row['first_name'] = "First Name updated";

$xml = $cc->createContactXML($subscriber_url, $row);

$request = $subscriber_url;
$parameter = $xml;

//print_r($xml);

$ch = curl_init();
$request = str_replace('http://', 'https://', $request);
// Convert id URI to BASIC compliant
curl_setopt($ch, CURLOPT_URL, $request);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $cc->requestLogin);
# curl_setopt ($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type:application/atom+xml"));
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$tmpfile = tmpfile();
fwrite($tmpfile, $parameter);
fseek($tmpfile, 0);
curl_setopt($ch, CURLOPT_INFILE, $tmpfile);
curl_setopt($ch, CURLOPT_PUT, 1);
curl_setopt($ch, CURLOPT_INFILESIZE, strlen($parameter));
fclose($tmpfile);

$emessage = curl_exec($ch);
echo $error = curl_error($ch);
curl_close($ch);

echo $emessage;

 

 

 

Thanks,

Radu

Highlighted
Moderator

Re: Looks like my IP is filtered

Have you checked with your hosting provider to see if they have updated your PHP installation or changed the configuration of PHP on your Apache host?  We have seen reports of similar behavior when doing PUT requests on PHP installations which don't support a PUT request through curl.  This is almost always caused by changes done by a host or a configuration change in curl/Apace/PHP on a patch/upgrade.

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Participant

Re: Looks like my IP is filtered

I found the problem. It was an issue with the library we use. Maybe it's an older version but PUT method doesn't work on PHP 5.3 but works find on PHP 5.1 . Here is the issue:

 

In "doServerCall" function you have this switch

 

switch ($type) {
case 'POST':
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameter);
break;
case 'PUT':
$tmpfile = tmpfile();
fwrite($tmpfile, $parameter);
fseek($tmpfile, 0);
curl_setopt($ch, CURLOPT_INFILE, $tmpfile);
curl_setopt($ch, CURLOPT_PUT, 1);
curl_setopt($ch, CURLOPT_INFILESIZE, strlen($parameter));
fclose($tmpfile);
break;
case 'DELETE':
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
break;
default:
curl_setopt($ch, CURLOPT_HTTPGET, 1);
break;
}

$emessage = curl_exec($ch);

 

When a PUT call is made, the file is created, attached to curl object but the file is closed before curl_exec call and this causes Apache to crash on PHP 5.3 (no problem if it's PHP 5.1).

 

If the line with fclose is moved after curl_exec then everything works fine.

 

Highlighted
Moderator

Re: Looks like my IP is filtered

Glad to hear you solved the problem and that's good information to have for future PHP troubleshooting.  Logically, that actually makes a lot of sense as once the file handle is closed, it should not longer be accessibe.  It is most likely a 5.1 one defect which was fixed in 5.3. 

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured