Http 408 Apache



I always get a 408 when trying to do form based authentication. In the log file I can see the following debug output: 12:59:41,077 DEBUG org.apache.catalina.authenticator.AuthenticatorBase (http-localhost-127.0.0.1-8080-1) Security checking request POST /shop/app/jsecuritycheck. HTTP Status 408 - The time allowed for the login process has been exceeded. If you wish to continue you must either click back twice and re-click the link you requested or close and re-open your browser The server.log file contains these messages.

On Thu, Dec 28, 2017 at 5:47 AM, Greg Wilkins <gregw@xxxxxxxxxxx> wrote:
Daniel,
check the issue. I have an explanation and a work around. Not yet sure about the fix or even if it should be fixed.
cheers
Http status 408 apache
On 28 December 2017 at 11:34, Greg Wilkins <gregw@xxxxxxxxxxx> wrote:
https://github.com/eclipse/jetty.project/issues/2081

On 28 December 2017 at 11:01, Greg Wilkins <gregw@xxxxxxxxxxx> wrote:
Actually, never mind I will open the issue.
stand by...

On 28 December 2017 at 10:53, Greg Wilkins <gregw@xxxxxxxxxxx> wrote:
Daniel,
well that looks wrong! I can confirm your test fails for me!
I find it hard to believe we don't have a test for this... but we have changed some close handling recently so obviously we have stuffed up somehow. investigating....
Please open this as an issue.
regards


On 28 December 2017 at 01:41, Daniel Gredler <djgredler@xxxxxxxxx> wrote:
I'm upgrading dependencies in a JAX-RS project, and have reached the point where I need to upgrade Jersey, which (via transitive dependencies) involves upgrading Jetty from 9.2.x to 9.4.x.
One of our regression tests verifies that in the case of a request timeout we are sending an HTTP 408 error back to the client. Ignoring all of the JAX-RS layers, the code basically expects that the request handler is able to catch an IOException with getCause() instanceof TimeoutException (see code below for a minimal test case). This was the behavior in Jetty 9.2.x.
This appears to have changed in Jetty 9.3.0 and all subsequent 9.3.x and 9.4.x releases: no IOException is thrown in the request handler when the request timeout expires. Connections and so on seem to be cleaned up on the server side correctly, but we no longer have a hook to send the 408 response back to the client.
What is the best practice in Jetty 9.4.x for hooking into the request timeout mechanism in order to customize the response that is sent back to the client in case of timeouts?
Thanks!!
Daniel
Apache

[code sample]
import static java.nio.charset.StandardCharsets.UTF_8;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.InetAddress;
import java.net.Socket;
import java.util.concurrent.TimeoutException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler;
public class JettyTimeoutTest {
public static void main(String... args) throws Exception {
int port = 8181;
Server jetty = new Server(port);
jetty.setHandler(new TestHandler());
jetty.start();
try (Socket s = new Socket(InetAddress.getByName('localhost'), port)) {
408 String body = 'abcdefghijklmnopqrstuvwxyz';
OutputStreamWriter sw = new OutputStreamWriter(s.getOutputStream(), UTF_8);
sw.write('POST /foo HTTP/1.0rn');
sw.write('Content-Length: ' + body.length() + 'rn');
sw.write('Content-Type: application/x-www-form-urlencodedrn');
sw.write('rn');
sw.flush();
sw.write(body.substring(0, 10));
Thread.sleep(40_000); // a little longer than the server timeout, which is 30 seconds
sw.write(body.substring(10));
sw.flush();
String response = IOUtils.toString(s.getInputStream(), UTF_8);
System.out.println('Response:');
System.out.println(response); // 408 response in Jetty <= 9.2.23, empty response in Jetty >= 9.3.0
} finally {
jetty.stop();
}
}
private static class TestHandler extends AbstractHandler {
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
throws IOException {
int status;

Http Error 408 Apache


String body;
try {
status = HttpServletResponse.SC_OK;
body = IOUtils.toString(request.getInputStream(), UTF_8); // tries to read the entire POST body
} catch (IOException e) {
if (e.getCause() instanceof TimeoutException) {
status = HttpServletResponse.SC_REQUEST_TIMEOUT;
body = 'HTTP ERROR 408';
} else {
status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
body = 'HTTP ERROR 500';
}
}
response.setContentType('text/plain');
response.setStatus(status);
response.getWriter().write(body);
baseRequest.setHandled(true);
}
}
}

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users



--
Greg Wilkins <gregw@xxxxxxxxxxx> CTO http://webtide.com


--
Greg Wilkins <gregw@xxxxxxxxxxx> CTO http://webtide.com


--
Greg Wilkins <gregw@xxxxxxxxxxx> CTO http://webtide.com


--
Greg Wilkins <gregw@xxxxxxxxxxx> CTO http://webtide.com

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
ServerTo change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
Ever since I switched to the beta version I have a problem with sabnzbd + apache proxy redirect + mod_proxy.
Since I want one place to access all my webservices, I set up my apache server with mod_proxy as advised on the wiki.
Here's my apache config:This has worked fine until the day I upgraded to the beta version. Now I have intermittent loading issues.
When I try to navigate to http://server/sabnzbd, it will simply show a blank page. Viewing the html source shows an empty file (literally, 0 characters).
If I refresh 5 or 6 times, it will finally work, but only for about 20 seconds. Then I'll have to refresh multiple times again.

Http Status 408 Apache

I checked my apache access logs and I can see that apache gives out an error HTTP 408 for each of these failed page loads.
HTTP 408 is Request Timeout.
From my google searches, the only thing I could find related to mod_proxy and http 408 is a project called CherryPy which describes exactly the problem I am having. Here is a link to the relevant ticket in their bugtracker: link.
Can anyone help me with this?
Version: 0.5.0 beta 4
OS: Ubuntu Karmic
Install-type: custom ubuntu ppa repo
Skin: Just switched to Plush (problem exists on default skin, if it helps)
Firewall Software: None

Http 408 Apache

Are you using IPV6? no

Http 408 Apache Server

Is the issue reproducible? god yes