Back

Cannot create any index

  • 0
  • Databases
  • General
Binyamin
1 May, 2023, 16:45

And, also, Is the error still the same?

TL;DR
Issue: User is unable to create any indexes, and wants to know why. They also want to know how to delete indexes and if there is still an error. Solution: - It is suggested to try creating indexes using a direct connection to the database. - The user may not be allowed to create an index with the same name as an attribute. - Depending on the version, the user can use the database API. - The user can check the database connection to see if any old collection indexes exist. - The user can try accessing the database directly to delete indexes. - It is recommended to check if the error still persists.
Brave
1 May, 2023, 16:45

Yes

Brave
1 May, 2023, 16:46

It seems like I cant use indexes with names that I used before the update and that across collections.

Brave
1 May, 2023, 16:46

But I dont really know 😄

Binyamin
1 May, 2023, 16:47

Sometimes that indexes wasn't deleted

Brave
1 May, 2023, 16:47

Cool and now? 😂

Brave
1 May, 2023, 16:47

How can I delete them?

Binyamin
1 May, 2023, 16:47

For that you'll need to access your database directly

Brave
1 May, 2023, 16:48

And why cant I create an index with the same name in a new collection?

Brave
1 May, 2023, 16:48

Ok nvm

Brave
1 May, 2023, 16:48

That works

Brave
1 May, 2023, 16:48

But only in a completely new collection created after the update

Binyamin
1 May, 2023, 16:49

Mmm, maybe something got mix over there

Binyamin
1 May, 2023, 16:50

If you'll connect to your database you can see all the indexes each collection has, check if you see some old collection index

Brave
1 May, 2023, 16:51

How can I access this database?

Brave
1 May, 2023, 16:51

I mean its closed from public access

Brave
1 May, 2023, 16:51

Or not?

Binyamin
1 May, 2023, 16:51

I've created a gist that explains the process https://gist.github.com/byawitz/885510a4d9789e97424337e9472276d7

Brave
1 May, 2023, 16:52

Hmmm

Bouahaza
1 May, 2023, 16:52

Depends of your version, you can also use database api : https://appwrite.io/docs/server/databases?sdk=nodejs-default#databasesDeleteIndex with rest or graphql

Brave
1 May, 2023, 16:52

It may be that you are not allowed to create an index that has the same name as an attribute

Brave
1 May, 2023, 16:53

But if appwrite knew that the index exists it would display it in the console or am I wrong?

Binyamin
1 May, 2023, 16:54

Yes, make sense, That why it's better to try with direct connection.

Bouahaza
1 May, 2023, 16:54

Don't know, you need to try that

Brave
1 May, 2023, 16:54

Ok no that also not the case

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