Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-17688

Zabbix 4.0 Scroll Delete sends Content-Length: -1

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • None
    • 4.0.19
    • Server (S)
    • None

      "as recommended by the elasticsearch documentation, we close the scroll search through a DELETE request"

      https://github.com/zabbix/zabbix/blob/da0e68e91a55320fdd1d5f42154788364f02f999/src/libs/zbxhistory/history_elastic.c#L834

      While sending a DELETE to close the _scroll request is proper behavior, the linked code sends the DELETE request with a Content-Length: -1.  This is against RFC https://tools.ietf.org/html/rfc7230#section-3.3.2
      Any Content-Length field value greater than or equal to zero is
      valid. Since there is no predefined limit to the length of a
      payload, a recipient MUST anticipate potentially large decimal
      numerals and prevent parsing errors due to integer conversion
      overflows
      Elasticsearch does not care about Content-Length: -1, but web proxies such as NGINX will reject the request with 400, which is undesired.

      Previously spoke with Alexander Sergunin.  We are sending traffic through NGINX to mitigate another issue, which I will link on this ticket.

      Steps to reproduce:

      1. Configure Zabbix server to use Elasticsearch as a history backend
      2. Configure an NGINX proxy to sit between elasticsearch and the zabbix server
      3. Add some items and triggers to zabbix
      4. Watch the Zabbix logs and Nginx logs for 400

      Result:

      10.1.1.1 - - [21/Apr/2020:19:00:14 +0000] "DELETE /_search/scroll/DnF1ZXJ5VGhlbkZldGNoCgAAAAEbxSetFmtVM1Q3WGI2UXFLS3ZBUzZGRmdzeEEAAAABG8UntRZrVTNUN1hiNlFxS0t2QVM2RkZnc3hBAAAAARvFJ7IWa1UzVDdYYjZRcUtLdkFTNkZGZ3N4QQAAAAEbxSe2FmtVM1Q3WGI2UXFLS3ZBUzZGRmdzeEEAAAABG8UnrhZrVTNUN1hiNlFxS0t2QVM2RkZnc3hBAAAAARvFJ7QWa1UzVDdYYjZRcUtLdkFTNkZGZ3N4QQAAAAEbxSezFmtVM1Q3WGI2UXFLS3ZBUzZGRmdzeEEAAAABG8UnrxZrVTNUN1hiNlFxS0t2QVM2RkZnc3hBAAAAARvFJ7AWa1UzVDdYYjZRcUtLdkFTNkZGZ3N4QQAAAAEbxSexFmtVM1Q3WGI2UXFLS3ZBUzZGRmdzeEE= HTTP/1.1" 400 173 "" ""

      Expected:
      Omit the Content-Length: -1 header.

       

      I can be available via video conference to help demonstrate the issue if needed. 

       

            rvaliahmetovs Renats Valiahmetovs (Inactive)
            pgre Parker Green
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: