chkaufmann 17 Posted September 10, 2019 Hi, I wrote a remote storage for files and manage it using an Indy TIdHttp component with some post request (get file, put file, delete file). So far this works fine local and with a remote server but when I try the script with my hosting provider I get a "Connection reset by peer" for some requests. I can reproduce it when I try to put a specific file. I always use a TIdMultiPartFormDataStream with some text variables and a file upload. I always get an error 5000 and an empty response in this case and the error message "Connection reset by peer". I already had some emails with my provider and the ensure, that there is no firewall or anything blocking my requests. And now comes the most difficult part: I tried to reduce my main application to a small sample application just with this specific request and now the request runs fine, file is uploaded and saved. So as next I put the test request in the MainForm.FormCreate event and it works as well, even when I call it more than once. I always recreate my TIdHttp component but the question remains, why do I get this error? And what could I do to isolate the problem? Christian Share this post Link to post
Remy Lebeau 1436 Posted September 10, 2019 6 hours ago, chkaufmann said: when I try the script with my hosting provider I get a "Connection reset by peer" for some requests. Which provider are you using? What does your code look like? Without seeing the actual HTTP requests, we can only speculate what the problem is, but most likely either the requests are malformed in some way the server does not like, or are not carrying required info the server needs, or the server is simply encountering an error on its end. 6 hours ago, chkaufmann said: I can reproduce it when I try to put a specific file. I always use a TIdMultiPartFormDataStream with some text variables and a file upload. I always get an error 5000 and an empty response in this case and the error message "Connection reset by peer". Do you mean 500 instead of 5000? HTTP status code 500 is a server-side error, likely caused by you sending bad data to the server and making it crash. 6 hours ago, chkaufmann said: I already had some emails with my provider and the ensure, that there is no firewall or anything blocking my requests. Did you ask them to do any debugging on their end, to look at the requests you are sending, and watch how their server reacts? 6 hours ago, chkaufmann said: I tried to reduce my main application to a small sample application just with this specific request and now the request runs fine, file is uploaded and saved. So as next I put the test request in the MainForm.FormCreate event and it works as well, even when I call it more than once. Maybe the provider found a problem on their end and fixed it? You will have to ask them. 6 hours ago, chkaufmann said: why do I get this error? There is not enough info to diagnose the root problem, especially if the error is not happening anymore. Share this post Link to post