PERL API error 500 server closed connection without sending any data back
Asked Answered
C

3

7

I am running a Perl API that uses LWP::UserAgent to post form data to a file.

Occasionally I receive this error on large files:

"500 server closed connection without sending any data back"

The timeout doesn't seem to be the issue as its set to an astronomical number.

Capitalize answered 16/5, 2013 at 18:46 Comment(6)
500 isn't a timeout error, it's a server error. The server had issues while processing your request. Go check the logs on that server to figure out what happened.Discrepancy
500 errors would have more details in the server's error log. look there to see what's blowing up.Bookworm
Unfortunately checking the log is not a possibility as it is not mine, but are you certain this would be the server end causing it?Capitalize
Any 5xx errors are by definition server-side errors: en.wikipedia.org/wiki/…Discrepancy
And this only happens with large files? It's possible that your script is taking too long to complete and so getting killed off by the host. From Apache's perspective (as it's not party to the decision to kill off your process) it's just getting a premature end of script headers, and properly reports an internal server error.Aquiculture
no, this wouldn't be the server; LWP returns 500 with some errors that are detected on the client side, with appropriate error messages (like this one)Algin
R
7

If the response that you get has Client-Warning header, as seen in response below, then it is a tcp level error and response is produced by LWP client and not the server:

500 Server closed connection without sending any data back
Content-Type: text/plain
Client-Date: Thu, 19 Sep 2013 08:04:28 GMT
Client-Warning: Internal response
Rathskeller answered 19/9, 2013 at 9:21 Comment(0)
G
0

I solved this by adding https://{host}/path.

example: http://localhost:6543/carnelian ssh -v -N -L 6543:[remotehost]:[port] result: error 500 server closed connection without sending any data back

example: https://localhost:6543/carnelian ssh -v -N -L 6543:[remotehost]:[port] It works.

Guitarfish answered 29/1, 2021 at 2:37 Comment(0)
P
0

Use 'gopher':

# For a single scheme:
$ua->proxy('gopher', 'http://proxy.sn.no:8001/');
 
Pepito answered 13/3, 2023 at 14:18 Comment(1)
Why would the ancient gopher protocol make a difference and why do you think the server would even support it?Semidome

© 2022 - 2024 — McMap. All rights reserved.