coralproject / talk

A better commenting experience from Vox Media
https://coralproject.net
Other
1.89k stars 354 forks source link

Error when searching in site moderator field #4311

Closed rmens closed 1 year ago

rmens commented 1 year ago

Expected behavior: The search box to return a list of sites

Actual behavior: An error

Schermafbeelding 2023-08-07 om 12 17 07

In the error logs:

coral-talk-1  | 2023-08-02T12:03:59.849741585Z {"name":"coral","hostname":"5009d930444b","pid":1,"context":"graph","contextID":"aa2caa40-312c-11ee-89d3-150c6ecf36ce","tenantID":"89ee24b5-e921-4789-bb4a-1d487d22a320","level":30,"responseTime":1,"authenticated":true,"userID":"87943ada-c509-437e-b5e0-8b2382695789","persistedQueryID":"71842ef80cabc50c7fee3bd0c4353283","persistedQueryBundle":"admin","persistedQueryVersion":"8.4.2","operation":"query","operationName":"SiteSearchListQuery","msg":"graphql query","time":"2023-08-02T12:03:59.849Z","src":{"file":"/usr/src/app/src/core/server/graph/plugins/logger.ts","line":95,"func":"logQuery"},"v":0}
coral-talk-1  | 2023-08-02T12:03:59.851187346Z {"name":"coral","hostname":"5009d930444b","pid":1,"level":50,"err":{"message":"INTERNAL_ERROR: text index required for $text query","name":"WrappedInternalError","stack":"Object.getWrappedOriginalError (src/core/server/graph/plugins/helpers.ts:155:10)\nlogAndReportError (src/core/server/graph/plugins/logger.ts:21:15)\nforEach (src/core/server/graph/plugins/logger.ts:118:44)\nArray.forEach (<anonymous>)\nObject.willSendResponse (src/core/server/graph/plugins/logger.ts:118:27)\nnode_modules/apollo-server-core/src/utils/dispatcher.ts:20:23\nArray.map (<anonymous>)\nDispatcher.callTargets (node_modules/apollo-server-core/src/utils/dispatcher.ts:17:20)\nDispatcher.<anonymous> (node_modules/apollo-server-core/src/utils/dispatcher.ts:30:12)\nGenerator.next (<anonymous>)\nnode_modules/apollo-server-core/dist/utils/dispatcher.js:8:71\nnew Promise (<anonymous>)\n__awaiter (node_modules/apollo-server-core/dist/utils/dispatcher.js:4:12)\nDispatcher.invokeHookAsync (node_modules/apollo-server-core/dist/utils/dispatcher.js:26:16)\nnode_modules/apollo-server-core/src/requestPipeline.ts:566:22\nGenerator.next (<anonymous>)\n","id":"aa2d6d91-312c-11ee-89d3-150c6ecf36ce","context":{"pub":{},"pvt":{"reason":"wrapped internal error"}},"originalError":{"message":"text index required for $text query","name":"MongoError","stack":"Connection.<anonymous> (node_modules/mongodb/lib/core/connection/pool.js:451:61)\nprocessMessage (node_modules/mongodb/lib/core/connection/connection.js:384:10)\nSocket.<anonymous> (node_modules/mongodb/lib/core/connection/connection.js:553:15)\n"}},"report":null,"msg":"graphql query error","time":"2023-08-02T12:03:59.851Z","src":{"file":"/usr/src/app/src/core/server/graph/plugins/logger.ts","line":25,"func":"logAndReportError"},"v":0}

Related Issues: Couldn't find one

Versions: This is running the default Docker image, so:

kabeaty commented 1 year ago

Hello, you likely need to create the index for the text search. See https://github.com/coralproject/talk/blob/develop/INDEXES.md#2021-12-17

losowsky commented 1 year ago

I'm going to close this issue as the solution has been described above.