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: Deletion of collection and recreating it fails and gives a duplication error #22

Closed
Caryntjen opened this issue Jan 31, 2022 · 5 comments
Assignees

Comments

@Caryntjen
Copy link

Caryntjen commented Jan 31, 2022

👟 Reproduction steps
Collection TEST with same ID exists.
Deleting and creating collection gives error in the logs. The collection is succesfully deleted. But the creation fails.

    private var appwriteClient: Client = Client()
        .setEndpoint(APPWRITE_ENDPOINT)
        .setProject(APPWRITE_PROJECT)
        .setKey(APPWRITE_KEY)
        .setSelfSigned(false)
    val appwriteDatabase = Database(appwriteClient)
        
            appwriteDatabase.deleteCollection( "TEST")
            
        val collection: Collection = appwriteDatabase.createCollection(
            collectionId = "TEST",
            name =  "TEST",
            read = ["team:xxx"],
            write = ["team:xxx"],
            permission = "collection"

👍 Expected behavior
Deletion and creation should work. And once the deletion is executed, it should be possible to create a database with same name and id.

👎 Actual Behavior
Shows the following error in Appwrite where it complains about a dupliocate key.

[Error] Type: PDOException
[Error] Message: Duplicate key name '_index2'
[Error] File: @swoole-src/library/core/Database/PDOStatementProxy.php
[Error] Line: 64

🎲 Appwrite version
Version 0.12.1

💻 Operating system
Windows

🧱 Your Environment
Appwrite v0.12.1 - sdk-for-kotlin v0.2.5
Java v11
Kotlin v1.6.10

👀 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?
I have read the Code of Conduct

@lohanidamodar
Copy link
Member

@Caryntjen The collections when you call delete, there are still some background work going on to remove attributes, indexes and everything related to the collection. so trying to create another immediately might fail, can you wait few seconds before creating again and see if it works?

@Caryntjen
Copy link
Author

@lohanidamodar ok thank you for the explanation before v0.12.0 this was not an issue.

@lohanidamodar
Copy link
Member

@Caryntjen is it fixed in 0.13.0 or does it still persist?

@Caryntjen
Copy link
Author

it does still persist.

@abnegate
Copy link
Contributor

@Caryntjen This should be fixed in the latest version 1.0.3, please reopen if the issue persists 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants