Back

Team already exists but cannot be deleted or found

  • 0
  • Teams
  • Cloud
whataboutno13
30 Oct, 2023, 13:37

Hi there, while tesing I am creating a team and assign a user as owner. I set up the team in the beginning and delete it after the test is finished. After running the test once I cannot create a team with the same id as before nor can I delete or find the team.

The following code creates this output:

TypeScript
total teams: 0
AppwriteException: team_already_exists, Team with requested ID already exists. Please choose a different ID and try again. (409)
Team id: eventId
AppwriteException: team_not_found, Team with the requested ID could not be found. (404)

The code creating the above output:

TypeScript
TeamList teamsList = await teams.list();
print('total teams: ${teamsList.total}');

// Create the team of the event
try {
  await teams.create(teamId: eventId, name: eventId);
} catch (e) {
  print(e.toString());
  print("Team id: $eventId");
}

// Add the owner to the team as owner
await teams.createMembership(
  teamId: eventId,
  userId: ownerId,
  roles: ['owner', 'guest'],
  url: 'https://cloud.appwrite.io',
);

Has anyone an idea why this is happening?

TL;DR
Title: Cannot delete or find existing team in coding test Messages: - User is experiencing issues with creating, deleting, and finding teams in their coding test - They provide code and error messages as examples - Other users suggest checking for delays in deleting memberships and creating a separate issue for the duplication problem - User confirms there should be no teams in the project Solution: - One user suggests recreating the issue, but it works fine for them - No official solution provided, but the user will discuss the issue with their team and get back to the requester.
whataboutno13
30 Oct, 2023, 16:07

Team already exists but cannot be deleted or found

Haimantika
30 Oct, 2023, 17:21

Hi, I just tried reproducing the error. It works fine for me πŸ€”

whataboutno13
31 Oct, 2023, 08:47

Well all I am doing is creating a team with a fixed id and then deleting it at the end of the test. Then when I am running the test again, I get this output. When I then change the fixed id to something new, it works for some time until it fails again. Cannot realy tell you more πŸ˜…

Haimantika
31 Oct, 2023, 09:00

I did the same thing, and it worked for me. Will discuss with the team and get back to you

whataboutno13
31 Oct, 2023, 09:30

Would be great, because it is really annoying...

Drake
1 Nov, 2023, 23:26

Do you see the team in the Appwrite console?

whataboutno13
2 Nov, 2023, 08:13

No the team does not appear in the console

Drake
2 Nov, 2023, 16:37

weeeeiiirrddd.....what's your project id and the team id?

whataboutno13
2 Nov, 2023, 16:45

Project id: 6539157bd8232bf0b5c0 and the team id i was testing with was simply eventId or testEventId

Drake
2 Nov, 2023, 17:22

oye...can you please delete that team you created?

Drake
2 Nov, 2023, 17:22

ok...you have 0 teams now right?

whataboutno13
3 Nov, 2023, 10:32

Yes there should be 0 teams right now

whataboutno13
3 Nov, 2023, 10:53

The project itself should be very empty to be honest πŸ˜„

whataboutno13
3 Nov, 2023, 12:24

Another thing I am experiencing right now: When I delete a team with some members and recreate a team with the same team id the members are not deleted but do still exist. Additionally when I add the same user to the team again with the same roles as before he gets added and is now twice a member. I would have expected two things, firstly when I delete a team all memberships should be deleted as well and secondly I expect to add a user only once to a team and throw an exception otherwise

Drake
3 Nov, 2023, 15:32

so does creating the team work now?

Drake
3 Nov, 2023, 15:36

Additionally when I add the same user to the team again with the same roles as before he gets added and is now twice a member

It would be good to create 1 issue for this

Drake
3 Nov, 2023, 15:37

when I delete a team all memberships should be deleted as well

They should...but this happens as a background job. maybe there was just a delay in deleting all the memberships?

whataboutno13
6 Nov, 2023, 10:16

Well every now and then, it does not feel like anything changed

whataboutno13
6 Nov, 2023, 10:17

Could be, I'll check this later

whataboutno13
6 Nov, 2023, 10:18

Will do that πŸ‘

Drake
13 Nov, 2023, 17:40

how are things now?

Drake
13 Nov, 2023, 17:40

have you had a chance to create the issue?

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