Clear Filters
Clear Filters

Error using webwrite: "Recv failure: Connection was reset"

20 views (last 30 days)
I am using webwrite and get the following error:
"Error connecting to [targeturl]: Recv failure: Connection was reset"
This is the matlab code:
options = weboptions('MediaType','application/x-www-form-urlencoded','Timeout',Inf);
response = webwrite(url,data,options);
When I execute my equivalent url/data call from Chrome, it works just fine.
It's knowingly a semi-long wait time for the response. (I'm requesting my target server to build a large CSV dataset then respond with the URL for the CSV). 'response' is simply a text string of the CSV url. (Separate code to fetch the CSV works just fine)
The url/data call used to work fine with a Timeout of 900s, then I increased my request to ask for a dataset about 10%-15% larger. Now I keep getting the above error, even though the Timeout upper limit should actually be a little over 2000s. I've also tried manual Timeout thesholds at 1000, 1200, 1800, etc to no avail.
It seems like even thought the Timeout is 2000+... something is still timing out...

Answers (1)

Naga
Naga on 13 Aug 2024 at 17:21
Hi Donavan,
I came across a similar issue and the error might be because of an issue outside MATLAB. To test this hypothesis, please try downloading the same file using the curl command:
curl --cookie nada --location-trusted --output foo.txt --url <url>
For more information on using curl, please use the documentation link below:
If the curl command successfully downloads the file, the issue may lie within MATLAB. For further assistance, please contact MathWorks Technical Support using the following link:
  1 Comment
Donavan Haidinger
Donavan Haidinger on 13 Aug 2024 at 21:04
I am able to successfully execute my call from a Browser UI (chrome), so I know it is not a server-side issue. Something is snagging on the Matlab side.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!