Back

Document update fails due to stale relation attribute

  • 0
  • Databases
  • Cloud
anmot.
2 May, 2024, 16:36
  • I had a two way relation attribute.
  • Deleted the two way relation attribute.
  • Document Update fails as the relation key was still not deleted from one of the collection. Console doesn't show the deleted attribute but the underlying document still has reference to this attribute and fails withInvalid document structure: Unknown attribute
  • As the console doesn't show the attribute, I went ahead and created a new non relation attribute with the same key and it is now stuck in processing.
  • Tried deleting the stuck attribute key using cli, although it says success the key is still not deleted.

I've ran out of options. How can we permanently delete a attribute so that document update succeeds without recreating the collection?

TL;DR
Developer had a two way relation attribute, then deleted it. Document update is failing because even though the console doesn't show the deleted attribute, the underlying document still references it. Trying to create a new non-relation attribute with the same key got stuck in processing. Deleting the stuck attribute key using CLI shows success but the key remains undeleted. How can the attribute be permanently deleted without recreating the collection to ensure document update success? Solution: Instead of creating a new attribute with the same key, try updating the existing document to remove the stale attribute reference. If the CLI deletion is not working, reach out to the platform's support for
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more