glassfish
  1. glassfish
  2. GLASSFISH-18731

Errow when posting data with "Expect: 100-continue" header via ajp with mod_proxy_ajp in apache

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2_b23
    • Fix Version/s: None
    • Component/s: grizzly-kernel
    • Labels:
      None
    • Environment:

      Ubuntu 11.04

      Description

      Hi, not sure if this is a grizzly issue or mod_proxy_ajp in apache. Anyway the problem is as follows:
      If a client does a POST (presumably other methods do the same) and specifies a Expect header (tested with 100-continue as the value) then apache accepts the headers, marshalls them for ajp and returns a 100-continue response. It then starts to read the body of the message but gets a bad signature from glassfish. This results in glassfish getting a "connection reset from peer" error and return a 500 error back to apache.

      I've attached dumps of the process for both a working and not working (with Expects) content.

      1. failed.txt
        8 kB
        jsl123
      2. working.txt
        10 kB
        jsl123

        Activity

        Hide
        jsl123 added a comment -

        possible although not great work around are to switch apache to http 1.0 only or ignore the expect header and hope the client doesn't stick to the spec and sends the data straight after the headers without waiting for a response.

        Show
        jsl123 added a comment - possible although not great work around are to switch apache to http 1.0 only or ignore the expect header and hope the client doesn't stick to the spec and sends the data straight after the headers without waiting for a response.
        Hide
        Bas van Gils added a comment -

        I experienced the same issue with the Expect header. After thorough investigation we found out that this caused it. As a workaround we strip this header in Apache.

        We also had another problem, like described here: http://marc.info/?l=tomcat-user&m=121467240210359.
        The suggested solution to add JkOptions +DisableReuse in mod_jk solved it.

        Show
        Bas van Gils added a comment - I experienced the same issue with the Expect header. After thorough investigation we found out that this caused it. As a workaround we strip this header in Apache. We also had another problem, like described here: http://marc.info/?l=tomcat-user&m=121467240210359 . The suggested solution to add JkOptions +DisableReuse in mod_jk solved it.
        Hide
        jsl123 added a comment -

        I've worked around it by making apache remove the header effectively ignoring it by adding "RequestHeader unset Expect early" to the config. Although this isn't ideal, as it should break any client that sticks to the specifications (luckily most don't) as they should wait for a response before sending the rest of their request body.

        Show
        jsl123 added a comment - I've worked around it by making apache remove the header effectively ignoring it by adding "RequestHeader unset Expect early" to the config. Although this isn't ideal, as it should break any client that sticks to the specifications (luckily most don't) as they should wait for a response before sending the rest of their request body.
        Hide
        oleksiys added a comment -

        fixed

        mirror Grizzly issue
        http://java.net/jira/browse/GRIZZLY-1267

        the patch for GF 3.1.2 can be downloaded here:
        http://java.net/jira/browse/GLASSFISH-18446

        Show
        oleksiys added a comment - fixed mirror Grizzly issue http://java.net/jira/browse/GRIZZLY-1267 the patch for GF 3.1.2 can be downloaded here: http://java.net/jira/browse/GLASSFISH-18446
        Hide
        jsl123 added a comment -

        Looks to work, thanks for your quick turnaround..

        Show
        jsl123 added a comment - Looks to work, thanks for your quick turnaround..

          People

          • Assignee:
            oleksiys
            Reporter:
            jsl123
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: