Vendure: Error while fetching products after deploying

Created on 5 May 2020  路  2Comments  路  Source: vendure-ecommerce/vendure

I am getting below error while trying to run the application in server.

Request url http://server-name3000/admin-api
Request object:

{
  "operationName": "SearchProducts",
  "variables": {
    "input": {
      "skip": 0,
      "take": 10,
      "term": "",
      "facetValueIds": [

      ],
      "groupByProduct": true
    }
  },
  "query": "query SearchProducts($input: SearchInput!) {\n  search(input: $input) {\n    totalItems\n    items {\n      enabled\n      productId\n      productName\n      productAsset {\n        id\n        preview\n        focalPoint {\n          x\n          y\n          __typename\n        }\n        __typename\n      }\n      productVariantId\n      productVariantName\n      productVariantAsset {\n        id\n        preview\n        focalPoint {\n          x\n          y\n          __typename\n        }\n        __typename\n      }\n      sku\n      channelIds\n      __typename\n    }\n    facetValues {\n      count\n      facetValue {\n        id\n        createdAt\n        updatedAt\n        name\n        facet {\n          id\n          createdAt\n          updatedAt\n          name\n          __typename\n        }\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n"
}

Response message:

ER_WRONG_FIELD_WITH_GROUP: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'vendure.si.enabled' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Can you please suggest how to solve this.

bug 馃悰

Most helpful comment

Hi, this sounds like something another user ran into when using MySQL. Their solution was to run:

SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))

See https://stackoverflow.com/a/41887627/772859

TODO: Set up e2e tests against MySQL (not just MariaDB as is currently the case) and resolve this issue without the need for a work-around.

All 2 comments

Hi, this sounds like something another user ran into when using MySQL. Their solution was to run:

SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))

See https://stackoverflow.com/a/41887627/772859

TODO: Set up e2e tests against MySQL (not just MariaDB as is currently the case) and resolve this issue without the need for a work-around.

@michaelbromley It worked! Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonyw4 picture jonyw4  路  6Comments

michaelbromley picture michaelbromley  路  6Comments

chladog picture chladog  路  4Comments

megataps picture megataps  路  4Comments

fmq picture fmq  路  7Comments