Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-780

HTTP error 413 when sending a long string to the Avatica server

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0-incubating
    • Component/s: avatica
    • Labels:
      None

      Description

      When I try to execute a query with a very long string, the server returns error 413 "entity too large". My assumption is that this happens, because the RPC uses a HTTP header to pass the RPC request data and most HTTP parsers do not like long headers. The best solution would be to use the body of the HTTP request. It could be made backward-compatible, by checking the header first and if it's missing, then read the body.

        Issue Links

          Activity

          Hide
          ndimiduk Nick Dimiduk added a comment -

          Bulk edit assigning avatica component to obvious issues.

          Show
          ndimiduk Nick Dimiduk added a comment - Bulk edit assigning avatica component to obvious issues.
          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/03111d2b .
          Hide
          elserj Josh Elser added a comment -

          FYI, looks like CALCITE-696 is a duplicate of this.

          Show
          elserj Josh Elser added a comment - FYI, looks like CALCITE-696 is a duplicate of this.
          Hide
          julianhyde Julian Hyde added a comment -

          Agreed. Good catch.

          Show
          julianhyde Julian Hyde added a comment - Agreed. Good catch.
          Hide
          ndimiduk Nick Dimiduk added a comment -

          I'm a little late on review, but may I ask why it is ever desirable to receive query requests via header? Seems to me like requests should always be sent as body payload.

          Show
          ndimiduk Nick Dimiduk added a comment - I'm a little late on review, but may I ask why it is ever desirable to receive query requests via header? Seems to me like requests should always be sent as body payload.
          Hide
          julianhyde Julian Hyde added a comment -

          So you can do old-school stuff like executing (really simple) requests by clicking on URLs and using tools like curl and wget.

          Show
          julianhyde Julian Hyde added a comment - So you can do old-school stuff like executing (really simple) requests by clicking on URLs and using tools like curl and wget.
          Hide
          lukaslalinsky Lukas Lalinsky added a comment -

          You can't actually do requests by clicking on URLs, because you can't set an HTTP header that way and you can do requests with JSON body with curl by using the -d option.

          I assumed the server supported both for compatibility reasons. I was a bit surprised that the client used both depending on the request, but I assumed it was intentional, so I didn't comment on that before.

          Show
          lukaslalinsky Lukas Lalinsky added a comment - You can't actually do requests by clicking on URLs, because you can't set an HTTP header that way and you can do requests with JSON body with curl by using the -d option. I assumed the server supported both for compatibility reasons. I was a bit surprised that the client used both depending on the request, but I assumed it was intentional, so I didn't comment on that before.
          Hide
          ndimiduk Nick Dimiduk added a comment -

          What Lukas Lalinsky said – I'm all for simple things like having a query exposed via url, but for all the years i've putzed with HTML, i actually have no idea how to build an anchor tag that includes a header. Maybe you're thinking of the request parameters passed in the query string? This is not the same as request headers.

          Show
          ndimiduk Nick Dimiduk added a comment - What Lukas Lalinsky said – I'm all for simple things like having a query exposed via url, but for all the years i've putzed with HTML, i actually have no idea how to build an anchor tag that includes a header. Maybe you're thinking of the request parameters passed in the query string ? This is not the same as request headers.
          Hide
          julianhyde Julian Hyde added a comment -

          You're right, I was thinking of request parameters. I'll remove the support for headers.

          Show
          julianhyde Julian Hyde added a comment - You're right, I was thinking of request parameters. I'll remove the support for headers.
          Hide
          jnadeau Jacques Nadeau added a comment -

          Resolved in release 1.4.0-incubating (2015-08-23)

          Show
          jnadeau Jacques Nadeau added a comment - Resolved in release 1.4.0-incubating (2015-08-23)

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              lukaslalinsky Lukas Lalinsky
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development