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

20 次查看(过去 30 天)
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...

回答(1 个)

Naga
Naga 2024-8-13,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 个评论
Donavan Haidinger
Donavan Haidinger 2024-8-13,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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by