You need to sign in to do that
Don't have an account?
Rockjack
remoteFunction returning Read Timeout
I have an s-control that uses the AJAX proxy remoteFunction to connect to an external URL. It has been working correctly for several months. Over night the remoteFunction stopped working and only returns a read timeout error.
"400 Unable to forward request due to: Read timed out"
I have eliminated and/or tested all of the other factors: connection to external site, browser, data error, IP address whitelists, etc. I have tried using version 11 and 12 of the API. I have also contacted the Sales Force support line with no avail. I know that this can occur when Sales Force slows down, but it has never happened for this long 12+ hours.
I am left to assume that some issue with Sales Force occurred over night. Any Ideas?
Code:
function postRequest(envelope) { sforce.connection.remoteFunction({ url : "https://<deleted>", requestHeaders: { "Content-Type":"application/x-www-form-urlencoded; charset=utf-8" }, requestData: envelope, method: "POST", onSuccess : postSuccess, onFailure : postFailure }); }
I just tried this and it is working fine:
sforce.connection.remoteFunction({
url : "http://www.cheenath.com",
method: "GET",
onSuccess : function (result){alert(result)},
onFailure : function (error) {alert(error)},
});
Thanks for the response. I tested our site connection this morning and it responded within 1-2 seconds.
I am going to reboot the firewall for our external site to see if that makes a differance. Possibly the server as well if the firewall reboot doesn't help.
I'll be able to tell fairly quickly.
Clay
Unfortunately, rebooting the server and firewall on our external site didn't work. We are still getting the "400 Read timed out" error. We have tried everything we can think of.
Something must have changed over night for the remoteFunction to stop working after working for several months and many transactions. The only other time this has occurred is when Sales Force connections get slow in the afternoon.
I'll keep working on it.
If any body has any other ideas please let me know.
Clay
Message Edited by Rockjack on 06-19-2008 04:49 PM
I've also checked the site it's going to - it responds instantly and have even tried it by returning a single string to avoid any doubt in processing times.
Perhaps this is to do with the HTTPS rather than HTTP as I'm only using HTTPS requests?
I think it's definitely something on the Salesforce side.
sforce.connection.remoteFunction({
url : "https://www.salesforce.com",
method: "GET",
onSuccess : function (result){alert(result)},
onFailure : function (error) {alert(error)},
});
Please contact support. I am not sure what is going wrong in your case.
Mike
Your request type is GET or POST?
If it's some sites (as some are suggesting) and not all, perhaps it's a routing issue from SF servers? I'm on the European server: emea.salesforce.com
I have not logged this with SF support:I find this quite a challenge - emails do not get replied to and the online service doesn't get an intelligent response either. Especially whenever it's to do with any custom code which SF is pushing us to write!
Somehow there should be a way to log these system problems rather than use this discussion board.
It's possible that I'm not posting correctly (although it has been working fine for a month until the other day).
If someone can try the HTTPS POST, it would be useful to see if it works for them.
Thanks.
This seems to work fine for me:
sforce.connection.remoteFunction({
url : "http://cheenath.com/tutorial/sfdc/sample2/echo.php?a=b",
method: "POST",
requestData: "userid=joe&password=guessme",
onSuccess : function (result){alert(result)},
onFailure : function (error) {alert(error)},
});
I have traced through the javascript code (connection.js) and it appears as though the body of the POST is properly submitted to the Salesforce proxy URL so it's somewhere inside of Salesforce that the body gets messed up before being sent to the remote endpoint.
In addition, I have found these two HTTP headers arriving at my web service endpoint that do NOT arrive for properly formed (non-truncated) requests. Not sure if it helps:
salesforceproxy-sid: 4c3200D400000009Ddg!AR0AQPyCenj_QS0_Q5AvrnCR9QYl0raZ67SldW2U8wy3oMk9TA80_4TmTTMR2gDUpvoCvgJeGt5VYCX_xSM1Pbf4Tcsqikjf
salesforceproxy-endpoint: <the URL to my endpoint>
Thanks,
Dave
Above code appears to work OK as there is no timeout, however the parameters are not posted to the website. Even though they appear in the POST as "a=aaaa&b=bbbb&c=cccc&d=dddd" (when checking with firebug).
The above code results in a timeout error and the website never gets contacted. In this case the POST request contacts each parameter on seperate lines like this:
a aaaa
b bbbb
c cccc
d dddd
So I'm still confused - what should the requestHeaders be? Either way there seems to be a problem.
cheenath - do you see the parameters you post to your web page from the web page?
edit: by the way I've only tried this on Firefox.
Message Edited by jeremy_w on 06-24-2008 01:31 PM
One thing that is that the HTTP POST request will work if the "Content-Type" is set to "text/xml" or "text/plain". But the PHP script that receives this POST request requires a proper 'application/x-www-form-urlencoded' header and that somehow causes the SF proxy to timeout.
It works the same every time. If it set the "Content-Type" header to 'text/xml', the SF proxy handles the request just fine, but if I set the "Content-Type" header to ''application/x-www-form-urlencoded', the SF proxy times out.
The PHP script that handles this POST request is working correctly and is not timing out or sending back very much data ( it's just a couple lines of XML ). So I'm pretty sure its a SF proxy or AJAX Toolkit issue.
Mike
I opened a case for this problem ( and linked to this thread, so they could see what others were experiencing ), and the guy that was handling my case told me that he had determined that the cause of my problem was ( in his exact words and spelling ) "that yore firewall is interfering with your HTMl code. This is why you are timing out."
I'm not even using any HTML code yet, I'm just working with JavaScript and the Ajax toolkit. So I don't know what he meant by that.
Also if it was a firewall issue, then why would just changing the 'Content-Type' header cause it to work or time out based on that header?
I tested the code with other ( reliable ) servers, and got the same results. So if it is a firewall issue, then there are a LOT of other people need to fix their firewalls :smileyvery-happy:
I'm pretty sure that he made a mistake, but if he is right, could someone else explain what he meant?
Peter
We are working on a fix for it.
It took longer to resolve because we were not able to
reproduce the problem, till someone pointed out the
problem is specific to application/x-www-form-urlendoded
content type.
Thanks,
Has this bug been fixed?
Was the bug in the server-side proxy or was it in the AJAX toolkit? If it was in the AJAX toolkit, do I need to use a specific version of the toolkit?
Or has this bug not been fixed yet, and the code just started to work for no reason at all?
Thanks
Peter
Can someone from Salesforce investigate to see if this bug has been fixed (as it doesn't seem to be) or is still in progress.
Thanks.
error:
400 Unable to forward request due to: Timeout waiting for connection
Message Edited by jeremy_w on 08-26-2008 01:59 AM
Seems to be a bit erratic.
Hi Cheenath,
Has this bug been fixed? I am still receiving a 400 "Read timed out error" when the "Content-Type" is set to "multipart/form-data". Any updates, would be greatly appreciated.
-Thanks
The issue addressed in this thread, which was fixed in August 2008, has recently cropped up again. We are again experiencing "400 Unable to forward request due to: Read timed out" when running the same form submission thru remotefunction that was originally complained about.
Currently the form post is actually successful but returns the above error. This is different from the previous case where the post failed.It is not a file upload but a form post that has been working for several years (except when it has not.)
Somehow the issue got fixed last year so hopefully that could happen again. According to cheenath it is Bug #192181. Our case # was 01937347.
Can I get a update of this issue. I am still getting Read time out error when I am trying to upload a file to 3rd part services. But other services like getToken, login (post method), logout works perfectly using the same remoteaction method.
So any help is really appreciate.
I am still getting the readtimeout error. Any help is really appreciate.
FYI.. I am trying v25.0 connection.js
Console stack trace
Response
Hi.
Try this solution. Valid for servers that only support binary content and for servers that support base64 encoding.
http://salesforceafondo.wordpress.com/2013/01/08/post-multipartform-data-out-of-salesforce-com-with-...
Hope this helps.
José Luis Almazán.