Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query_shard_exception & number_format_exception #1034

Closed
lingwooc opened this issue Aug 13, 2018 · 2 comments
Closed

query_shard_exception & number_format_exception #1034

lingwooc opened this issue Aug 13, 2018 · 2 comments

Comments

@lingwooc
Copy link

lingwooc commented Aug 13, 2018

Error appears in system.log occasionally.

Preconditions

Magento Version : 2.2.5

ElasticSuite Version : 2.5.14

Environment : production

Steps to reproduce

  1. Genuinely not sure!

Actual result

  1. This appears in the system log (not sure if this even related to a page load).
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query: {
  \"constant_score\" : {
    \"filter\" : {
      \"bool\" : {
        \"must\" : [
          {
            \"nested\" : {
              \"query\" : {
                \"bool\" : {
                  \"must\" : [
                    {
                      \"bool\" : {
                        \"must_not\" : [
                          {
                            \"term\" : {
                              \"category.is_virtual\" : {
                                \"value\" : true,
                                \"boost\" : 1.0
                              }
                            }
                          }
                        ],
                        \"disable_coord\" : false,
                        \"adjust_pure_negative\" : true,
                        \"boost\" : 1.0
                      }
                    },
                    {
                      \"terms\" : {
                        \"category.category_id\" : [
                          \"147\"
                        ],
                        \"boost\" : 1.0
                      }
                    }
                  ],
                  \"disable_coord\" : false,
                  \"adjust_pure_negative\" : true,
                  \"boost\" : 1.0
                }
              },
              \"path\" : \"category\",
              \"ignore_unmapped\" : false,
              \"score_mode\" : \"none\",
              \"boost\" : 1.0
            }
          },
          {
            \"terms\" : {
              \"stock.is_in_stock\" : [
                true
              ],
              \"boost\" : 1.0
            }
          },
          {
            \"terms\" : {
              \"visibility\" : [
                2,
                4
              ],
              \"boost\" : 1.0
            }
          },
          {
            \"nested\" : {
              \"query\" : {
                \"range\" : {
                  \"price.price\" : {
                    \"from\" : \"130\",
                    \"to\" : \"\",
                    \"include_lower\" : true,
                    \"include_upper\" : false,
                    \"boost\" : 1.0
                  }
                }
              },
              \"path\" : \"price\",
              \"ignore_unmapped\" : false,
              \"score_mode\" : \"none\",
              \"boost\" : 1.0
            }
          }
        ],
        \"disable_coord\" : false,
        \"adjust_pure_negative\" : true,
        \"boost\" : 1.0
      }
    },
    \"boost\" : 1.0
  }
}","index_uuid":"SWytnfp_T4y0k9-gnuC9tw","index":"magento2_default_catalog_product_20180813_190339"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_default_catalog_product_20180813_190339","node":"nUwsewxzTaq3tOIm4KsQfA","reason":{"type":"query_shard_exception","reason":"failed to create query: {
  \"constant_score\" : {
    \"filter\" : {
      \"bool\" : {
        \"must\" : [
          {
            \"nested\" : {
              \"query\" : {
                \"bool\" : {
                  \"must\" : [
                    {
                      \"bool\" : {
                        \"must_not\" : [
                          {
                            \"term\" : {
                              \"category.is_virtual\" : {
                                \"value\" : true,
                                \"boost\" : 1.0
                              }
                            }
                          }
                        ],
                        \"disable_coord\" : false,
                        \"adjust_pure_negative\" : true,
                        \"boost\" : 1.0
                      }
                    },
                    {
                      \"terms\" : {
                        \"category.category_id\" : [
                          \"147\"
                        ],
                        \"boost\" : 1.0
                      }
                    }
                  ],
                  \"disable_coord\" : false,
                  \"adjust_pure_negative\" : true,
                  \"boost\" : 1.0
                }
              },
              \"path\" : \"category\",
              \"ignore_unmapped\" : false,
              \"score_mode\" : \"none\",
              \"boost\" : 1.0
            }
          },
          {
            \"terms\" : {
              \"stock.is_in_stock\" : [
                true
              ],
              \"boost\" : 1.0
            }
          },
          {
            \"terms\" : {
              \"visibility\" : [
                2,
                4
              ],
              \"boost\" : 1.0
            }
          },
          {
            \"nested\" : {
              \"query\" : {
                \"range\" : {
                  \"price.price\" : {
                    \"from\" : \"130\",
                    \"to\" : \"\",
                    \"include_lower\" : true,
                    \"include_upper\" : false,
                    \"boost\" : 1.0
                  }
                }
              },
              \"path\" : \"price\",
              \"ignore_unmapped\" : false,
              \"score_mode\" : \"none\",
              \"boost\" : 1.0
            }
          }
        ],
        \"disable_coord\" : false,
        \"adjust_pure_negative\" : true,
        \"boost\" : 1.0
      }
    },
    \"boost\" : 1.0
  }
}","index_uuid":"SWytnfp_T4y0k9-gnuC9tw","index":"magento2_default_catalog_product_20180813_190339","caused_by":{"type":"number_format_exception","reason":"empty String"}}}]},"status":400} [] []
[2018-08-13 19:45:00] main.ERROR: {"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query: {
  \"constant_score\" : {
    \"filter\" : {
      \"bool\" : {
        \"must\" : [
          {
            \"nested\" : {
              \"query\" : {
                \"bool\" : {
                  \"must\" : [
                    {
                      \"bool\" : {
                        \"must_not\" : [
                          {
                            \"term\" : {
                              \"category.is_virtual\" : {
                                \"value\" : true,
                                \"boost\" : 1.0
                              }
                            }
                          }
                        ],
                        \"disable_coord\" : false,
                        \"adjust_pure_negative\" : true,
                        \"boost\" : 1.0
                      }
                    },
                    {
                      \"terms\" : {
                        \"category.category_id\" : [
                          \"147\"
                        ],
                        \"boost\" : 1.0
                      }
                    }
                  ],
                  \"disable_coord\" : false,
                  \"adjust_pure_negative\" : true,
                  \"boost\" : 1.0
                }
              },
              \"path\" : \"category\",
              \"ignore_unmapped\" : false,
              \"score_mode\" : \"none\",
              \"boost\" : 1.0
            }
          },
          {
            \"terms\" : {
              \"stock.is_in_stock\" : [
                true
              ],
              \"boost\" : 1.0
            }
          },
          {
            \"terms\" : {
              \"visibility\" : [
                2,
                4
              ],
              \"boost\" : 1.0
            }
          },
          {
            \"nested\" : {
              \"query\" : {
                \"range\" : {
                  \"price.price\" : {
                    \"from\" : \"130\",
                    \"to\" : \"\",
                    \"include_lower\" : true,
                    \"include_upper\" : false,
                    \"boost\" : 1.0
                  }
                }
              },
              \"path\" : \"price\",
              \"ignore_unmapped\" : false,
              \"score_mode\" : \"none\",
              \"boost\" : 1.0
            }
          }
        ],
        \"disable_coord\" : false,
        \"adjust_pure_negative\" : true,
        \"boost\" : 1.0
      }
    },
    \"boost\" : 1.0
  }
}","index_uuid":"SWytnfp_T4y0k9-gnuC9tw","index":"magento2_default_catalog_product_20180813_190339"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_default_catalog_product_20180813_190339","node":"nUwsewxzTaq3tOIm4KsQfA","reason":{"type":"query_shard_exception","reason":"failed to create query: {
  \"constant_score\" : {
    \"filter\" : {
      \"bool\" : {
        \"must\" : [
          {
            \"nested\" : {
              \"query\" : {
                \"bool\" : {
                  \"must\" : [
                    {
                      \"bool\" : {
                        \"must_not\" : [
                          {
                            \"term\" : {
                              \"category.is_virtual\" : {
                                \"value\" : true,
                                \"boost\" : 1.0
                              }
                            }
                          }
                        ],
                        \"disable_coord\" : false,
                        \"adjust_pure_negative\" : true,
                        \"boost\" : 1.0
                      }
                    },
                    {
                      \"terms\" : {
                        \"category.category_id\" : [
                          \"147\"
                        ],
                        \"boost\" : 1.0
                      }
                    }
                  ],
                  \"disable_coord\" : false,
                  \"adjust_pure_negative\" : true,
                  \"boost\" : 1.0
                }
              },
              \"path\" : \"category\",
              \"ignore_unmapped\" : false,
              \"score_mode\" : \"none\",
              \"boost\" : 1.0
            }
          },
          {
            \"terms\" : {
              \"stock.is_in_stock\" : [
                true
              ],
              \"boost\" : 1.0
            }
          },
          {
            \"terms\" : {
              \"visibility\" : [
                2,
                4
              ],
              \"boost\" : 1.0
            }
          },
          {
            \"nested\" : {
              \"query\" : {
                \"range\" : {
                  \"price.price\" : {
                    \"from\" : \"130\",
                    \"to\" : \"\",
                    \"include_lower\" : true,
                    \"include_upper\" : false,
                    \"boost\" : 1.0
                  }
                }
              },
              \"path\" : \"price\",
              \"ignore_unmapped\" : false,
              \"score_mode\" : \"none\",
              \"boost\" : 1.0
            }
          }
        ],
        \"disable_coord\" : false,
        \"adjust_pure_negative\" : true,
        \"boost\" : 1.0
      }
    },
    \"boost\" : 1.0
  }
}","index_uuid":"SWytnfp_T4y0k9-gnuC9tw","index":"magento2_default_catalog_product_20180813_190339","caused_by":{"type":"number_format_exception","reason":"empty String"}}}]},"status":400} [] []
@romainruaud
Copy link
Collaborator

romainruaud commented Aug 20, 2018

Hmmm,

from what I can see here, this part may be problematic :

{
            \"nested\" : {
              \"query\" : {
                \"range\" : {
                  \"price.price\" : {
                    \"from\" : \"130\",
                    \"to\" : \"\",
                    \"include_lower\" : true,
                    \"include_upper\" : false,
                    \"boost\" : 1.0
                  }
                }
              },
              \"path\" : \"price\",
              \"ignore_unmapped\" : false,
              \"score_mode\" : \"none\",
              \"boost\" : 1.0
            }
          }

From 130 is ok , but To '' may fail. Do you have something on your code which is alway applying this filtering ? Or are you able to reproduce it when filtering on price on frontend ? How is your category 147 configured ?

@afoucret
Copy link
Contributor

PR #1050 should fix this one.
It will be part of our next bugfix release (2.5.15).

Do not hesitate to send us your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants