Back

2-way relationship attribute stuck in processing for over a day

  • 1
  • Self Hosted
  • Databases
Naos
23 Apr, 2024, 18:46

This has been like this for over 24h now; Have tried restarting the instance, via docker-compose down, etc; Nothing seems to work; Any idea on where to look? There is maybe 50 documents or so, so its not taking this time to process those

I now get the below error when trying to insert a document into the skuids table [that does not seem to have the product attribute visible at all yet]

appwrite | [Error] Timestamp: 2024-04-23T18:41:17+00:00 appwrite | [Error] Method: PATCH appwrite | [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId appwrite | [Error] Type: Appwrite\Extend\Exception appwrite | [Error] Message: Invalid document structure: Unknown attribute: "products" appwrite | [Error] File: /usr/src/code/app/controllers/api/databases.php appwrite | [Error] Line: 3501 appwrite | [Error] Timestamp: 2024-04-23T18:42:51+00:00 appwrite | [Error] Method: PATCH appwrite | [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId appwrite | [Error] Type: Appwrite\Extend\Exception appwrite | [Error] Message: The document data and permissions are missing. You must provide either document data or permissions to be updated. appwrite | [Error] File: /usr/src/code/app/controllers/api/databases.php appwrite | [Error] Line: 3357 appwrite | [Error] Timestamp: 2024-04-23T18:42:53+00:00 appwrite | [Error] Method: PATCH appwrite | [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId appwrite | [Error] Type: Appwrite\Extend\Exception appwrite | [Error] Message: Document with the requested ID could not be found. appwrite | [Error] File: /usr/src/code/app/controllers/api/databases.php

TL;DR
Developers are experiencing a 2-way relationship attribute stuck in processing for over a day. They have tried restarting the instance with no luck. A suggestion is to delete the attribute and create it again, as it may be completely stuck. There is an error message when trying to insert a document into the table, indicating an issue with the attribute 'products'.
Naos
23 Apr, 2024, 18:47

2-way relationship attribute stuck in processing for over a day

D5
23 Apr, 2024, 18:51

Probably it's completely stuck, mainly if you restarted the instance

D5
23 Apr, 2024, 18:51

You will need to delete it and create it again

Naos
23 Apr, 2024, 18:52

Delete what exactly? There is no option to delete the attribute anymore I only restarted the instance after a few hours

Naos
23 Apr, 2024, 18:53

The relationship is between skuids and products it is now only still visible on the products collection there is no option to delete the attribute ther the attribute is not visible in skuids

D5
23 Apr, 2024, 18:53

You mean you can't delete the relationship in any of the parts?

D5
23 Apr, 2024, 18:54

You get an error or what?

Naos
23 Apr, 2024, 18:55

There is no button ... or I am going blind I have I believe deleted "part" of it, if I remember correclty I did delete it on the other collection yesterday, where it is indeed no longer visible anymore But as you can see from the error of the first post is seems to still exist even though its not visible in the UI

Naos
23 Apr, 2024, 18:57

happy to do anything except delete the full collection if at all possible ...

Naos
23 Apr, 2024, 18:58

Yep from the activity logs on the skuid table I did delete it there

Steven
23 Apr, 2024, 19:00

what's your concern about deleting the collection? The data?

Steven
23 Apr, 2024, 19:00

you might need to make an api call directly. You could try using the CLI

Naos
23 Apr, 2024, 19:10

ah good one

Naos
23 Apr, 2024, 19:10

the data, setting up again, etc;

Naos
23 Apr, 2024, 19:16

Both return an "attribute with the requested ID could not be found" appwrite databases deleteAttribute --databaseId XXX --collectionId products --key skuIds appwrite databases deleteAttribute --databaseId XXX --collectionId skuids --key products

Naos
23 Apr, 2024, 19:18

But then when i try to create the relationship a second time via the UI "Attribute with the requested key already exists. Attribute keys must be unique, try again with a different key."

Naos
23 Apr, 2024, 19:19

Anyway ive recreated the relationship with other key names so im not blocked, just feels like something is sitting wrong

Naos
23 Apr, 2024, 19:42

Ah wait no I am blocked cause I can no create any skuids ..

Steven
23 Apr, 2024, 19:45

Oh wait...there's a bug with deleting some relationships

Steven
23 Apr, 2024, 19:48

You'll probably need to manually go into the database to clean things up

Naos
23 Apr, 2024, 19:59

any other ticket / doc I can look at to do so? Or connecting to the db directly and poke around?

Steven
23 Apr, 2024, 20:34

There's a related PR, but i don't think it's the same issue: https://github.com/appwrite/appwrite/pull/7985/files

As for finding the data in the database, first look at the _console_projects table and go from there. We use the internal id (_id) as a prefix in several places in the database

Steven
23 Apr, 2024, 20:34

knowing the internal id should help you find where to look next

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