appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]: JSObject.name already exists

Open subrata71 opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

Slack Thread

Intro

After solving the JSObject.name already exists issue we’ve found another reason which causes this issue.

Description

The JS collection (actionCollection in MongoDB) keeps all the references to the actions inside it in unpublishedCollection.defaultToBranchedActionIdsMap. Findings I have found a few documents where the unpublishedCollection.defaultToBranchedActionIdsMap is empty although there are valid actions in the newAction collection with the corresponding collectionId.

For this kind of documents a few users experience JSObject.name already exists issue. Because GET /api/v1/collections/actions returns all the JS collections and associated actions in response. For the above case, the JS collection is returned but the actions array is not having any actions. So, the front end tries to create those actions through a PUT request (/api/v1/collections/actions/{collectionId}) and the server identifies these actions as already created and hence returns JSObject.name already exists message in response. It seems like a data inconsistency.

As multiple updates or inserts take place without sharing a common transaction this might happen.

Steps To Reproduce

It's not reproducible easily as we don't have control over the server code execution flow.

Public Sample App

No response

Issue video log

No response

Version

Cloud / Self Hosted

subrata71 avatar Dec 23 '22 05:12 subrata71

This issue also causes the object to not appear on selection dropdown Sample object TC4 is the object that does not show up on action selector dropdown image

ramsaptami avatar Jan 04 '23 14:01 ramsaptami

Chiming in on this issue since I just encountered it at version 1.9.61.

image

• Current version is at v1.9.61 • This instance of Appsmith Business Edition is deployed on an AWS EC2 virtual machine. This VM is running docker off of Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-1044-aws x86_64). • This instance has access to the internet, and it can access http://cs.appsmith.com/ and http://api64.ipify.org/ . • There is a reverse proxy, and a firewall in use via cloudflare and aws respectively. • Our Mongo/Redis is internal as far as I can tell.

Function:

image

Query:

image

This dropdown calls it:

image

taylorbrosnan avatar Feb 15 '24 20:02 taylorbrosnan

@subrata71 - Wondering if is there any update on this issue? I am seeing this on some apps even now. Here is a recording. Can this be prioritised?

https://github.com/appsmithorg/appsmith/assets/101863839/1636785a-e873-4a5b-840a-04814e1ac2ec

btsgh avatar Apr 15 '24 10:04 btsgh