Please, can someone help me, I got this erro r BadRequestError","statusCode":400

Hey everyone,
Please can someone help explain that this error is all about?

{"name":"Log","hostname":"merklepal","pid":11370,"level":50,"version":"5.76.2","err":{"id":"f5118c30-c397-11ee-accc-2f62f1f65f64","domain":"https://merklepal.com","code":null,"name":"BadRequestError","statusCode":400,"level":"normal","message":"Error parsing filter","stack":"Error: Query Error: unexpected character in filter at char 7\n    at Child.applyDefaultAndCustomFilters (/var/www/ghost/versions/5.76.2/node_modules/@tryghost/bookshelf-filter/lib/bookshelf-filter.js:66:23)\n(tags:[]+id:-65b245b28a7161\n-------^\nExpecting 'NULL', 'TRUE', 'FALSE', 'NUMBER', 'NOW', 'LITERAL', 'STRING', got 'RBRACKET'\n    at parser.parseError (/var/www/ghost/versions/5.76.2/node_modules/@tryghost/nql-lang/dist/parser.js:359:12)\n    at Parser.parse (/var/www/ghost/versions/5.76.2/node_modules/@tryghost/nql-lang/dist/parser.js:276:22)\n    at exports.parse (/var/www/ghost/versions/5.76.2/node_modules/@tryghost/nql-lang/lib/nql.js:18:44)\n    at api.parse (/var/www/ghost/versions/5.76.2/node_modules/@tryghost/nql/lib/nql.js:15:31)\n    at api.querySQL (/var/www/ghost/versions/5.76.2/node_modules/@tryghost/nql/lib/nql.js:49:44)\n    at Builder.<anonymous> (/var/www/ghost/versions/5.76.2/node_modules/@tryghost/bookshelf-filter/lib/bookshelf-filter.js:63:24)\n    at Object.query (/var/www/ghost/versions/5.76.2/node_modules/bookshelf/lib/helpers.js:164:14)\n    at Child.query (/var/www/ghost/versions/5.76.2/node_modules/bookshelf/lib/model.js:1387:22)\n    at Child.applyDefaultAndCustomFilters (/var/www/ghost/versions/5.76.2/node_modules/@tryghost/bookshelf-filter/lib/bookshelf-filter.js:56:22)\n    at Function.getFilteredCollection (/var/www/ghost/versions/5.76.2/core/server/models/base/plugins/filtered-collection.js:13:32)\n    at Function.findPage (/var/www/ghost/versions/5.76.2/core/server/models/base/plugins/crud.js:83:41)\n    at PostsService.browsePosts (/var/www/ghost/versions/5.76.2/node_modules/@tryghost/posts-service/lib/PostsService.js:81:44)\n    at Object.query (/var/www/ghost/versions/5.76.2/core/server/api/endpoints/posts-public.js:108:33)\n    at Object.query (/var/www/ghost/versions/5.76.2/node_modules/@tryghost/api-framework/lib/pipeline.js:159:24)\n    at /var/www/ghost/versions/5.76.2/node_modules/@tryghost/api-framework/lib/pipeline.js:259:35\n    at async makeAPICall (/var/www/ghost/versions/5.76.2/core/frontend/helpers/get.js:160:24)","hideStack":false},"msg":"Error parsing filter","time":"2024-02-04T19:59:51.416Z","v":0}

You’ve got an invalid filter parameter somewhere (probably whatever file you’ve recently editied) - tags cannot be empty. Before you call this code, check that tags exist first.

1 Like

Thanks for helping out