appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.21k stars 3.7k forks source link

IncorrectResultSizeDataAccessException: Query { "$java" : Query: { "unpublishedAction.name" : "Query1", "unpublishedAction.pageId" : "600... #2684

Closed sentry-io[bot] closed 3 years ago

sentry-io[bot] commented 3 years ago

Sentry Issue: APPSMITH-DE

IncorrectResultSizeDataAccessException: Query { "$java" : Query: { "unpublishedAction.name" : "Query1", "unpublishedAction.pageId" : "6004a8da5b452f525458d9cc", "$and" : [{ "$or" : [{ "deleted" : { "$exists" : false}}, { "deleted" : false}]}, { "$or" : [{ "policies" : { "$elemMatch" : { "users" : { "$all" : ["jonas.bark@ffuf.de"]}, "permission" : "manage:actions"}}}, { "policies" : { "$elemMatch" : { "groups" : { "$all" : []}, "permission" : "manage:actions"}}}, { "policies" : { "$elemMatch" : { "users" : { "$all" : ["anonymousUser"]}, "permission" : "manage:actions"}}}]}]}, Fields: {}, Sort: {} } returned non unique result.
    at org.springframework.data.mongodb.core.ReactiveFindOperationSupport$ReactiveFindSupport.lambda$one$2(ReactiveFindOperationSupport.java:145)
nidhi-nair commented 3 years ago
Screenshot 2021-04-15 at 1 44 07 PM

I got to this state without triggering a Sentry issue, I'm not sure which one's the bigger problem :D

trishaanand commented 3 years ago

Opened issue #4013 for the underlying cause which lets actions with same name to be created in the page without server throwing an error. If there are no duplicate action names in the page, then the IncorrectResultSizeDataAccessException would not be thrown. That is a valid exception because somehow duplicate action names exist in the page.

nidhi-nair commented 3 years ago

@trishaanand I did this by opening the app in two pages and creating an API in each at the same time. This is a consistency issue. Also I wasn't able to get to the exception itself with this.

trishaanand commented 3 years ago

@nidhi-nair : This is because client was the only party enforcing unique names and the server wasn't. To reproduce this particular exception, you should try changing the name of any of these duplicate names Api's.