Login

    Register

Managed Hosting

PROJECT CATEGORIES

 

(monkeh)Tweet Twitter API
Project Home Blog Known Issues Contact Project

(monkeh)Tweet Twitter API Issue: Unhandled Exception in base.cfc when cfhttp returns "Connection Failure"

Name: Unhandled Exception in base.cfc when cfhttp returns "Connection Failure"
ID: 8
Project: (monkeh)Tweet Twitter API
Type: Bug
Area: Code
Severity: Low
Status: Closed
Related URL:
Creator: Seraph Imalia
Created: 06/20/13 1:52 AM
Updated: 01/17/14 4:52 AM
Description: JSON parsing failure at character 1:'C' in Connection Failure

E:\WebSites\ColdFusion8\www.addynamo.com\5x0x0\gateways\twitter\com\coldfumonkeh\base.cfc (150)
(146)    
(147)    <cffunction name="handleReturnFormat" access="public" output="false" hint="I handle how the data is returned based upon the provided format">
(148)       <cfargument name="data"    required="true"             type="string" hint="The data returned from the API." />
(149)          <cfif getparseResults()>

(150)             <cfreturn DeserializeJSON(arguments.data) />

(151)          <cfelse>
(152)             <cfreturn serializeJSON(DeserializeJSON(arguments.data)) />
(153)          </cfif>

E:\WebSites\ColdFusion8\www.addynamo.com\5x0x0\gateways\twitter\com\coldfumonkeh\base.cfc (476)
E:\WebSites\ColdFusion8\www.addynamo.com\5x0x0\gateways\twitter\com\coldfumonkeh\monkehTweet.cfc (254)
E:\WebSites\ColdFusion8\www.addynamo.com\5x0x0\gateways\twitter\twitterGateway.cfc (188)
E:\WebSites\ColdFusion8\www.addynamo.com\5x0x0\listeners\twitter\twitterlistener.cfm (110)
E:\WebSites\ColdFusion8\www.addynamo.com\5x0x0\listeners\social\socialListener.cfm (544)
E:\WebSites\ColdFusion8\www.addynamo.com\5x0x0\webroot\schedules\twitter\schedule_twitter_update_stats.cfm (12)
History: Created by seraphimalia (Seraph Imalia) : 06/20/13 1:52 AM

Comment by ferrytoth (Ferry Toth) : 12/13/13 2:24 AM
Same here:

JSON parsing failure at character 1:'C' in Connection Failure


The error occurred in C:\Inetpub\wwwroot\monkehTweets\com\coldfumonkeh\base.cfc: line 152
Called from C:\Inetpub\wwwroot\monkehTweets\com\coldfumonkeh\base.cfc: line 476
Called from C:\Inetpub\wwwroot\monkehTweets\com\coldfumonkeh\monkehTweet.cfc: line 277
Called from C:\Inetpub\wwwroot\twitter1.cfm: line 1

150 :             <cfreturn DeserializeJSON(arguments.data) />
151 :          <cfelse>
152 :             <cfreturn serializeJSON(DeserializeJSON(arguments.data)) />
153 :          </cfif>
154 :       <cfabort>

Comment by samh90 (Sam Hannan) : 12/13/13 3:06 AM
I encountered the same issue, and resolved this by changing the api URL from https://api.twitter.com/1.1/, to http://api.twitter.com/1.1/

- base.cfc (line 96)

Apprantly this is something to do with the 'security provider' used by cf when making http requests. More info here: http://www.raymondcamden.com/index.cfm/2011/1/12/Diagnosing-a-CFHTTP-issue--peer-not-authenticated

Comment by ferrytoth (Ferry Toth) : 12/14/13 3:48 AM
@samh90 Thanx. Changing the api URL from https://api.twitter.com/1.1/ to http://api.twitter.com/1.1/ in base.cfc did the job.

Comment by D34F (Peter) : 12/23/13 3:59 PM
I've had this issue as well. While it's true you can change the api url to http instead of https, I simply imported the SSL certificate of Twitter on my ColdFusion server so I can still make use of the secure connection. It seems Twitter updated it's SSL certificate, which caused this bug: https://dev.twitter.com/blog/rest-api-ssl-certificate-updates

Comment by qb84 (Qb) : 01/14/14 1:13 PM
as of today 01/14/14 you need to use https.

Comment by coldfumonkeh (Matt Gifford aka coldfumonkeh) : 01/15/14 2:21 PM
Absolutely.. this appeared to be a temporary certificate issue with Twitter's SSL that other API users have experienced since the Twitter team ran a test blackout on certain methods.

You DO now need to be running the API through https otherwise it will not work at all. The certificate issue has been resolved on the Twitter end.

Updated by coldfumonkeh (Matt Gifford aka coldfumonkeh) : 01/15/14 2:22 PM

Comment by samh90 (Sam Hannan) : 01/17/14 4:52 AM
@D34F Thanks, this did the job.

For those pondering how to do this:
http://stackoverflow.com/questions/20624271/issues-with-monkehtweets-and-coldfusion
(see comment by Miguel-f)

Another guide here: http://helpx.adobe.com/coldfusion/kb/import-certificates-certificate-stores-coldfusion.html

Sam.

To add a comment to this bug, please login using the link above.