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

Maximum call stack exceed with double $none operator #5368

Closed
5 tasks done
axotion opened this issue Mar 22, 2024 · 1 comment
Closed
5 tasks done

Maximum call stack exceed with double $none operator #5368

axotion opened this issue Mar 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@axotion
Copy link

axotion commented Mar 22, 2024

Describe the bug

When using two $none operators in one smart collection query,

 return this.ownerRepository.find({
      dogs: {
        $none: {},
      },
      cats: {
        $none: {},
      },
    });

we got following error

DriverException: Maximum call stack size exceeded
app-1       |     at MySqlExceptionConverter.convertException (/usr/src/app/node_modules/@mikro-orm/core/platforms/ExceptionConverter.js:8:16)
app-1       |     at MySqlExceptionConverter.convertException (/usr/src/app/node_modules/@mikro-orm/mysql/MySqlExceptionConverter.js:80:22)
app-1       |     at MySqlDriver.convertException (/usr/src/app/node_modules/@mikro-orm/core/drivers/DatabaseDriver.js:326:54)
app-1       |     at /usr/src/app/node_modules/@mikro-orm/core/drivers/DatabaseDriver.js:330:24
app-1       |     at processTicksAndRejections (node:internal/process/task_queues:95:5)
app-1       |     at MySqlDriver.find (/usr/src/app/node_modules/@mikro-orm/knex/AbstractSqlDriver.js:68:24)
app-1       |     at SqlEntityManager.find (/usr/src/app/node_modules/@mikro-orm/core/EntityManager.js:144:25)
app-1       |     at /usr/src/app/node_modules/@nestjs/core/router/router-execution-context.js:46:28
app-1       |     at /usr/src/app/node_modules/@nestjs/core/router/router-proxy.js:9:17
app-1       | 
app-1       | previous RangeError: Maximum call stack size exceeded
app-1       |     at Function.processParams (/usr/src/app/node_modules/@mikro-orm/core/utils/QueryHelper.js:11:25)
app-1       |     at /usr/src/app/node_modules/@mikro-orm/core/utils/QueryHelper.js:34:37
app-1       |     at Array.forEach (<anonymous>)
app-1       |     at Function.processObjectParams (/usr/src/app/node_modules/@mikro-orm/core/utils/QueryHelper.js:33:36)
app-1       |     at Function.processParams (/usr/src/app/node_modules/@mikro-orm/core/utils/QueryHelper.js:28:25)
app-1       |     at /usr/src/app/node_modules/@mikro-orm/core/utils/QueryHelper.js:34:37
app-1       |     at Array.forEach (<anonymous>)
app-1       |     at Function.processObjectParams (/usr/src/app/node_modules/@mikro-orm/core/utils/QueryHelper.js:33:36)
app-1       |     at Function.processParams (/usr/src/app/node_modules/@mikro-orm/core/utils/QueryHelper.js:28:25)
app-1       |     at /usr/src/app/node_modules/@mikro-orm/core/utils/QueryHelper.js:25:51

Reproduction

https://github.com/axotion/mikro-orm-repro-collection

In order to reproduce bug, you have to run docker-compose up on repository and call GET /, then error will appear

What driver are you using?

@mikro-orm/mysql

MikroORM version

6.1.11 core and mysql

Node.js version

21

Operating system

MacOS

Validations

@axotion axotion changed the title Maximum call stack exceed with double $none operators Maximum call stack exceed with double $none operator Mar 22, 2024
@B4nan B4nan added the bug Something isn't working label Mar 22, 2024
@B4nan
Copy link
Member

B4nan commented Mar 22, 2024

In order to reproduce bug, you have to run docker-compose up on repository and call GET /, then error will appear

Next time please don't use webservers for reproductions that has nothing to do with webservers.

Got this reproduced in isolation, so no need for another repro here.

@B4nan B4nan closed this as completed in 8ddb3e4 Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants