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

12 Ansichten (letzte 30 Tage)
Donavan Haidinger
Donavan Haidinger am 13 Aug. 2024
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...

Antworten (1)

Naga
Naga am 13 Aug. 2024
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 Kommentar
Donavan Haidinger
Donavan Haidinger am 13 Aug. 2024
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.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by