fix a medusa 2.0 store error to fetch the products
cn ot fetch products as the products catalogue above 100,000
[14:58:13.000] ERROR:
message: "Maximum call stack size exceeded"
stack: [
{
"columnNumber": 16,
"fileName": "/app/.medusa/server/node_modules/@mikro-orm/core/platforms/[login to view URL]",
"functionName": "[login to view URL]",
"lineNumber": 8,
"methodName": "convertException",
"native": false,
"typeName": "PostgreSqlExceptionConverter"
},
{
"columnNumber": 22,
"fileName": "/app/.medusa/server/node_modules/@mikro-orm/postgresql/[login to view URL]",
"functionName": "[login to view URL]",
"lineNumber": 42,
"methodName": "convertException",
"native": false,
"typeName": "PostgreSqlExceptionConverter"
},
{
"columnNumber": 54,
"fileName": "/app/.medusa/server/node_modules/@mikro-orm/core/drivers/[login to view URL]",
"functionName": "[login to view URL]",
"lineNumber": 201,
"methodName": "convertException",
"native": false,
"typeName": "PostgreSqlDriver"
},
{
"columnNumber": 24,
"fileName": "/app/.medusa/server/node_modules/@mikro-orm/core/drivers/[login to view URL]",
"functionName": null,
"lineNumber": 205,
"methodName": null,
"native": false,
"typeName": null
},
{
"columnNumber": 5,
"fileName": "node:internal/process/task_queues",
"functionName": "processTicksAndRejections",
"lineNumber": 95,
"methodName": null,
"native": false,
"typeName": null
},
{
"columnNumber": 31,
"fileName": "/app/.medusa/server/node_modules/knex/lib/formatter/[login to view URL]",
"functionName": "unwrapRaw",
"lineNumber": 104,
"methodName": null,
"native": false,
"typeName": null
},
{
"columnNumber": 15,
"fileName": "/app/.medusa/server/node_modules/knex/lib/formatter/[login to view URL]",
"functionName": "wrap",
"lineNumber": 80,
"methodName": null,
"native": false,
"typeName": null
},
{
"columnNumber": 11,
"fileName": "/app/.medusa/server/node_modules/knex/lib/query/[login to view URL]",
"functionName": "[login to view URL] tableName [as tableName]",
"lineNumber": 1472,
"methodName": "get tableName [as tableName]",
"native": false,
"typeName": "QueryCompiler_PG"
},
{
"columnNumber": 13,
"fileName": "/app/.medusa/server/node_modules/knex/lib/query/[login to view URL]",
"functionName": "[login to view URL]",
"lineNumber": 800,
"methodName": "onlyJson",
"native": false,
"typeName": "QueryCompiler_PG"
},
{
"columnNumber": 25,
"fileName": "/app/.medusa/server/node_modules/knex/lib/query/[login to view URL]",
"functionName": "[login to view URL]",
"lineNumber": 313,
"methodName": "columns",
"native": false,
"typeName": "QueryCompiler_PG"
},
{
"columnNumber": 40,
"fileName": "/app/.medusa/server/node_modules/knex/lib/query/[login to view URL]",
"functionName": null,
"lineNumber": 135,
"methodName": null,
"native": false,
"typeName": null
},
{
"columnNumber": null,
"fileName": null,
"functionName": "[login to view URL]",
"lineNumber": null,
"methodName": "forEach",
"native": false,
"typeName": "Array"
},
{
"columnNumber": 16,
"fileName": "/app/.medusa/server/node_modules/knex/lib/query/[login to view URL]",
"functionName": "[login to view URL]",
"lineNumber": 134,
"methodName": "select",
"native": false,
"typeName": "QueryCompiler_PG"
},
{
"columnNumber": 29,
"fileName": "/app/.medusa/server/node_modules/knex/lib/query/[login to view URL]",
"functionName": "[login to view URL]",
"lineNumber": 75,
"methodName": "toSQL",
"native": false,
"typeName": "QueryCompiler_PG"
},
{
"columnNumber": 41,
"fileName": "/app/.medusa/server/node_modules/knex/lib/formatter/[login to view URL]",
"functionName": "unwrapRaw",
"lineNumber": 102,
"methodName": null,
"native": false,
"typeName": null
}
]
[14:58:13.000] USERLVL:
message: "[login to view URL] - - [08/Dec/2024:14:58:13 +0000] "GET /store/products?limit=1&offset=10®ion_id=reg_01JEE2P8Z6ESDR4XZPEHWNTDEB HTTP/1.1" 500 86 "-" "undici""
Previous attempts at increasing server resources have been unsuccessful. The solution should involve optimizing the SQL query to handle large data sets efficiently. Refactor the SQL query to improve efficiency and reduce load times. The current database structure is a single instance. Please prioritize this project to be completed as soon as possible.