Copy link to clipboard
Copied
Currently my cfhttp process works for the API I am calling on CF10 Enterprise version running on Windows Server 2008R2 but, on my CF2018 editon it will run once (sometimes) and then fail every call after that. I applied update 10 when I first noticed the issue to see if that may help but it did not and I recently applied Update 11 with same results. I am running ColdFusion 2018 Enterprise Version: 2018.0.11.326016 on Windows Server 2016 Standard.
I then did as BKBK recommended in another post and installed latest Java from http://adobe.com/support/coldfusion/downloads.html which was 11.0.10 and pointed my jvm.config to the new Java home directory.
When I dump out value for the version using
<cfdump var="#server.system.properties.java.version#"> just to make sure, it does indeed show "11.0.10+8-LTS-162" is being used. I restarted both the server and ColdFusion service and still get this issue:
Another thing I tried was importing the SSL cert for the API site into the CF Certstore using Certman but since I am able to connect at least once I don't really think that is the issue, especially since I did not need to do that step on my CF10 version which is working.
Here is my cfhttp call:
<cfhttp method="GET" url="https://fleet.badger-technologies.com/api/web/v1/cleansweep?from=#fullStDtTime2#&to=#fullEndDtTime2#..." result="MartyData" throwonerror="yes" >
<cfhttpparam type="header" name="Authorization" value="Basic #ToBase64("myuser:pwd")#"/>
<cfhttpparam type="header" name="Content-Type" value="application/json; charset=utf-8" />
</cfhttp>
Kind of at a loss as to what to try next. Any further ideas or did I miss a step somewhere? Attached is the cfdump.
Copy link to clipboard
Copied
Once again, the test I am eager to hear about is:
<cfloop index="i" from="1" to="6">
<cfhttp method="GET" url="https://fleet.badger-technologies.com/api/web/v1/cleansweep?from=#fullStDtTime2#&to=#fullEndDtTime2#..." result="MartyData" throwonerror="yes" >
<cfhttpparam type="header" name="Authorization" value="Basic your-auth-string-in-full"/>
<cfhttpparam type="header" name="Content-Type" value="application/json;charset=utf-8" />
<!--- Log the results to look at later (in the current folder)--->
<cfdump var="#MartyData#" format="html" output="#expandPath('httpResults.html')#" >
<!--- 10 second wait between cfhttp calls --->
<cfset sleep(10000)>
</cfhttp>
</cfloop>
Copy link to clipboard
Copied
Yes, I did perform a test with sleep() on the cfhttp call that is failing and it did not help or make a difference. I still get the connection failure error. I actually perform <cfset sleep(15000)> for every 50 calls in my exiting code on CF10 that works. I tried that here on CF18 but as I mentioned, after 1 successful call it just fails on the 2nd and goes no further and then if I rerun the code within a minute or so it fails on the first call so sleep would not even be hit at that point. I usually have to wait about 10 minutes before i can get a successfull call again.
Copy link to clipboard
Copied
Clear. Thanks for sharing that. We can now search further.
I thought of another reason why you should uninstall and reinstall ColdFusion. It's to do with RMI. You have those RMI exception messages in your logs telling you to set the RMI JVM flags to true. Yet when you do, you can't even run cfhttp. That suggests there might be an underlying connection.
I would therefore uninstall and reinstall ColdFusion. If we have a clean installation, without any RMI exceptions, then that will be a much better place to start looking for answers.
Copy link to clipboard
Copied
You shared with me, by private-messaging, how you can connect to official-joke-api.appspot.com - using the same cfhttp settings. However I have just seen one reason why we cannot compare. There is one major difference between the domains official-joke-api.appspot.com and fleet.badger-technologies.com.
The first accepts TLS versions 1.0, 1.1, 1.2 and 1.3. Whereas the second only accepts TLS v1.2. You can see this yourself by scanning the domains on https://www.ssllabs.com/ssltest/index.html
Incidentally, one consequence of this finding is that you should use the TLS flags you originally had in your jvm.config:
-Djdk.tls.client.protocols=TLSv1.2 -Dhttps.protocols=TLSv1.2
Copy link to clipboard
Copied
@Jdsplicer , I am hoping that when you reinstall ColdFusion 2018 - and, in doing so, get rid of the RMI error - the cfhttp issue will go away.
In any case, here's yet something else to try:
<cfscript>
for (i=1; i <= 10; i=i+1) {
cfhttp(method="GET", url="https://fleet.badger-technologies.com/api/web/v1/cleansweep?from=2021-04-20%2015:00:00&to=2021-04-20%2015:59:59&ahold_store_id=0003", result="MartyData", throwonerror=true) {
cfhttpparam( name="Authorization", type="header", value="Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" );
cfhttpparam( name="Content-Type", type="header", value="application/json;charset=utf-8" );
}
writeDump( var=MartyData );
}
</cfscript>
Copy link to clipboard
Copied
BKBK, thank you for your suggestions. My schedule ir pretty busy this week so it may be several days until I can get the time or chance to try the CF2018 reinstall. I quickly tried your <cfscript> code above but continue to get a error 500 Connection Failure: Status code unavailable, which is the same error in my previous code. Quick question, when you install CF2018 is there a install log that would tell me if anything failed, kind of like when you apply the updates there is a log that shows if it was successfull or not. Thanks again.
Copy link to clipboard
Copied
No worries. Take your time.
Though the cfscript didn't work, it adds information. One more pointer to a broken connection, plus we can rule out tags.
When you install ColdFusion the installer creates an installation log. In the same directory as the installer file (if my memory serves me right; I cannot remember where exactly.) If you're like me, you will have deleted the file the moment you thought ColdFusion had been installed correctly.
But there are other ways to get a snapshot at the moment of installation. Start with the date-time of the very first entry in /cfusion/logs/server.log. Then check what all the other logs recorded at that date-time.
Copy link to clipboard
Copied
My experience/observation has been that the cf installation log is rather in the root cf folder. And yes, jd, like the update install log it has a table near the top which tracks a count of successes and fatalerrors.
Copy link to clipboard
Copied
... the cf installation log is rather in the root cf folder.
By @Charlie Arehart
Nice one. Thanks for that.