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

🐛 Bug Report: Recreate Same Name Relationship Attribute Only Self-Hosted #8116

Closed
2 tasks done
SafakB opened this issue May 13, 2024 · 5 comments
Closed
2 tasks done
Assignees
Labels
bug Something isn't working feature / relationships Fixes and upgrades for database relationships product / databases Fixes and upgrades for the Appwrite Database.

Comments

@SafakB
Copy link

SafakB commented May 13, 2024

👟 Reproduction steps

The error occurs after deleting the existing relationship attribute and adding it again with the same name.

Relationship Settings

  • One-way Relationshop
  • Many to one
  • Set NULL

Steps

1 - Create Relationship
2 - Data entry with relationship
3 - Delete Relationship attribute
4 - Re-add Relationship
5 - Added to the list but “Failed”
6 - When I check the data I see that the old attributes are still selected :)

I found this
After step 3, in the background the attribute is deleted from the list, but the attribute values remain in the rows

👍 Expected behavior

Deleted relationship should be able to be added again with the same name

👎 Actual Behavior

After adding a relationship, it gives a “Failed” warning. The process is not completed.
Error only occurs in Self-Hosted

Our Live Server 1.5.5 [ ❌ Not working]
Our Test Server 1.5.5 [ ❌ Not working]
Zero installation 1.5.5 [ ❌ Not working]
Cloud [ ✅ Working]

image

🎲 Appwrite version

Version 1.5.x

💻 Operating system

Linux
Windows 10 (Edited)

🧱 Your Environment

Used Appwite 1.5.5
The bug is not dependent on any SDK

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@SafakB SafakB added the bug Something isn't working label May 13, 2024
@SafakB
Copy link
Author

SafakB commented May 13, 2024

Also tested on Windows 10. Bug causes problems here too

@Tanu1201
Copy link

Hey, I am Tanu Sharma having 2 number of exp in backend development, can I take this issue up.

@stnguyen90 stnguyen90 added product / databases Fixes and upgrades for the Appwrite Database. feature / relationships Fixes and upgrades for database relationships labels May 15, 2024
@stnguyen90 stnguyen90 self-assigned this May 15, 2024
@stnguyen90
Copy link
Contributor

stnguyen90 commented May 15, 2024

@SafakB, thanks for creating this issue! 🙏

Let's continue troubleshooting in https://discord.com/channels/564160730845151244/1239545933839073301

@SafakB
Copy link
Author

SafakB commented May 17, 2024

I'll be sharing a status update

When I check via MariaDB, I see that the column has not really been deleted

image

Database worker logs after relationship rebuilding

SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'blogCategory'

There are also remnants in the _1__metadata table

|  31 | database_1_collection_3 | 2024-05-17 20:36:26.080 | 2024-05-17 20:36:26.080 | ["create(\"any\")","read(\"any\")","update(\"any\")","delete(\"any\")"] | database_1_collection_3 | [{"$id":"title","key":"title","type":"string","size":36,"required":false,"default":null,"signed":true,"array":false,"format":"","formatOptions":[],"filters":[]},{"$id":"content","key":"content","type":"string","size":100,"required":false,"default":null,"signed":true,"array":false,"format":"","formatOptions":[],"filters":[]}] | [{"$id":"_index_blogCategory","key":"_index_blogCategory","type":"key","attributes":["blogCategory"],"lengths":[],"orders":[]}]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                0 |

@stnguyen90
Copy link
Contributor

The fix for this should be released in 1.5.6 which has #8080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature / relationships Fixes and upgrades for database relationships product / databases Fixes and upgrades for the Appwrite Database.
Projects
Status: Done
Development

No branches or pull requests

3 participants