Unexpected end-of-input: expected close marker for Array

Hi I am getting following error

Unexpected end-of-input: expected close marker for Array (start marker at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@21e2dfc9; line: 19, column: 27])\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@21e2dfc9; line: 21, column: 6257]

I am using following query

    GET products/_search
{
  "size": 0, 
  "aggs": {
    "product": {
      "terms": {
        "field": "product_id",
        "size": 50000,
        "order": {
          "_term": "desc"
        }
      }
    }
  }, 
  "query": {
    "bool": {
      "must_not": [
        {
          "terms": {
            "product_id": [
              39039,32392,31100,49525,24980,38076,31129,37200,48332,38099,49584,46399,32384,32451,7859,32356,32413,45258,50833,38108,26165,32391,37373,49579,18651,31148,32153,32367,38123,38148,41440,45445,47504,50816,12105,37327,38122,46354,13153,14315,29119,32347,32415,38039,38040,46422,48099,51422,32335,37400,38095,43900,49045,12329,13167,13174,32355,12348,13272,13534,37325,38078,37167,37398,37807,38114,38144,38181,38796,39886,47657,18464,32393,38082,39660,47117,48350,49745,12862,13115,13154,13156,13239,13608,14318,15355,15888,18652,32407,37320,37418,38103,41520,46167,47090,48949,49492,50077,14314,15616,18650,28990,33130,38037,38127,38137,41420,50065,29114,32400,37403,38204,38212,46193,7850,12856,13260,29375,29417,32339,32368,34305,37345,37419,38120,38209,43780,46213,46400,47218,49571,7857,13197,13509,14048,32401,38109,38202,38215,45404,49581,49721,13117,13603,14039,16523,16525,16529,16562,25507,37175,37365,38066,38073,38091,38107,39101,44054,44061,44064,44096,49534,49575,50060,50832,50998,5324,5325,5350,5351,5352,12352,12858,13198,13246,13257,13270,13375,13599,14332,18299,19402,25273,29089,32342,32390,37399,37404,37432,37462,38079,38089,41387,43791,44783,45319,45339,46485,47245,48101,48139,49570,50640,50809,13166,13244,13597,18306,18315,23543,24048,32332,32772,34808,36814,37181,37201,37207,37357,37430,38065,38126,38160,38210,38219,41443,45345,46413,47173,47268,48434,49548,49922,50632,12314,12851,20964,28574,31213,32751,37179,37384,37405,37460,38070,38141,38155,38196,38220,41419,45455,46145,46273,50016,3403,13158,13168,13220,13230,13231,13245,13247,13267,13269,13361,13363,13366,13374,13384,15354,18301,24316,32776,33791,36812,37169,37356,37397,37402,37431,38038,38093,38096,38105,38157,43921,44219,44501,45474,47765,48514,48786,50718,6314,6321,12774,13218,13379,13598,13929,15759,15901,16524,17448,18125,18305,19401,19849,24304,27083,31156,31209,32125,32954,37165,37317,38036,38092,38101,38102,38121,38152,38185,38198,38205,38217,38361,43672,43687,45401,45410,45452,45725,45727,46130,46429,47010,47016,47028,47391,47412,48367,48387,48389,48396,48417,49173,49294,49308,49543,49572,49653,50028,50071,50147,50283,12238,12350,13241,13373,13543,13595,13601,14054,15655,18474,24165,26127,28476,28508,29177,31821,31857,32444,35181,36793,37202,37367,37371,38050,38064,38077,38094,38156,38208,38793,39906,43698,45502,45540,45626,46293,46470,48341,48344,48416,49374,49573,49604,51083,4307,4884,11552,11614,12334,12347,12855,13215,13240,13252,13371,13377,13545,13604,14049,14401,14495,23653,24035,24160,29198,29713,31170,32290,32338,32373,33758,33824,35622,36935,37192,37341,37415,37417,37505,38053,38104,38112,38138,38151,38161,38175,38186,38203,38489,38787,41442,41444,41514,41519,43424,43426,43481,44074,44468,44608,45318,45467,45568,45939,46150,46170,48136,48312,48340,49580,50654,50668,50693,50811,50815,11838,14024,17132,18314,18414,21869,24137,24350,27828,28997,32133,32364,34740,34796,37173,37198,38098,38111,38113,38125,38187,38189,38195,39006,41392,42753,43461,45440,45561,46118,46148,46265,46402,46455,46936,47058,48384,48391,48456,49499,49589,49727,51302,5347,5348,6323,9801,11462,13364,13593,14023,18407,19910,24358,25696,26009,28259,28545,31866,32164,32343,32405,33698,34223,34814,35034,35035,37122,37172,37203,38045,38090,38136,38190,38342,38795,39658,39835,41947,41957,42411,42465,43463,43675,43683,43808,45446,45486,45526,45560,46128,46144,46255,46404,46688,47305,47652,48249,48278,48544,48586,49063,49356,49685,49879,50956,51145,51357,6077,6085,6088,6316,11840,12772,12773,13128,13152,13243,13255,13258,13259,13266,13274,13612,14493,14496,15629,15904,16522,17467,18124,19846,21876,23491,23901,23909,24217,24382,24436,25963,26008,29113,29276,31097,31122,31125,31134,31164,31826,32124,32358,32404,32674,32760,33699,33805,33925,35482,35486,35550,36399,37164,37420,37440,37458,37497,37879,37915,38067,38080,38106,38116,38124,38131,38132,38168,38213,38341,38345,38742,38759,39020,39049,39053,41683,42095,42301,43438,43451,43454,43558,43852,43950,44121,44208,44231,44241,44735,44744,44985,45044,45340,45483,45577,45708,46174,46301,46315,46324,46466,46911,47044,47148,47225,47242,47529,47795,47801,47802,47923,47967,48011,48020,48084,48133,48179,48224,48454,48582,49309,49735,50030,50188,50189,50204,50205,50244,50470,50812,50825,51028,51141,51169,51241,51330,12102,12108,12841,12846,13594,13616,14319,14402,14500,15947,18300,18404,18408,21233,24149,24855,24912,25109,25502,27761,29042,29061,29077,29293,29323,31094,31103,32008,32140,32438,33446,33793,33794,33811,34278,35183,35661,35770,37180,37343,37392,37412,38084,38158,38159,41639,41678,42173,42400,42401,42402,42405,42786,43149,43370,43749,44039,44101,44106,44129,44334,44506,44527,45114,45148,45168,45199,45211,45251,45465,45507,45527,45839,46122,46125,46275,46726,47142,47594,47654,47902,47997,48027,48055,49375,49609,49614,49683,49749,49906,50328,50357,50683,50778,50914,50952,50973,51235,51318,51372,51400,11597,12237,12859,13114,14168,14403,16738,19850,23412,24250,26148,27298,29025,29045,29168,29262,29269,31093,31159,31779,31832,32412,32988,34506,35478,35728,36243,37171,37189,37205,37314,37428,37436,38134,38135,38140,38165,38179,38188,38211,38214,38774,38972,39140,39661,41940,42297,42329,42404,42710,42732,44071,44200,44328,44502,44512,44611,44741,45126,45133,45167,45242,45260,45325,45491,45521,45719,46136,46146,46261,46357,46442,46692,47250,47468,47627,47979,48114,48375,48539,49615,49616,49641,49660,49701,49753,49767,50242,50719,50795,50913,50996,51156,51177,1139,4586,4617,5223,5240,5253,5263,5327,5330,5354,5400,5596,5601,5619,5623,5626,5636,6063,6189,6324,6765,6769,6771,6774,6775,6779,7858,8084,8085,8086,8087,8088,8404,8409,8410,8412,8413,8414,9739,9862,10396,10556,11612,11640,11836,11837,12330,12331,12332,13219,13249,13507,13610,13638,14834,14835,15356,15357,15379,15380,17483,18204,18206,18218,18219,18228,18230,18233,18303,18419,18585,21121,21135,21191,21192,21196,21204,21210,21211,21219,21255,21354,21363,21399,21419,21459,21464,21479,21485,50650
            ]
          }
        }
      ]
    }
  }
}

If i remove one Id from a product_id array it give me a result.
I also set

"index.max_terms_count": "50000"

no luck.

Thanks
in Advance