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

Error while fetching products after deploying #331

Closed
jklinson opened this issue May 5, 2020 · 2 comments
Closed

Error while fetching products after deploying #331

jklinson opened this issue May 5, 2020 · 2 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@jklinson
Copy link

jklinson commented May 5, 2020

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.

@jklinson jklinson added the type: bug 🐛 Something isn't working label May 5, 2020
@michaelbromley
Copy link
Member

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.

@jklinson
Copy link
Author

jklinson commented May 6, 2020

@michaelbromley It worked! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants