Back

Create Function: Error 409 Type `document_already_exists`

  • 0
  • Functions
  • Cloud
cetfor
21 Jul, 2024, 16:04

I'm at a complete loss here just trying to create a Function on AppWrite Cloud. No matter what I try, I'm getting this error:

TypeScript
# Error 409

Document with the requested ID already exists. Try again with a different ID or use ID.unique() to generate a unique ID.

Type
`document_already_exists`

Here are the steps I'm doing:

  1. Login to AppWrite Cloud using my GitHub account
  2. Click on my Organization's Project/App
  3. Click "Functions"
  4. Click "Create Function"
  5. Under Quick start, click Python
  6. Leave Name/Runtime default (Starter Function / Python - 3.9), click Next
  7. Supply no optional variables, click Next
  8. At this point it doesn't matter which option I select, either create a new repo, or add to an existing. I've tried both.
  9. Click GitHub
  10. Select the correct Organization when asked where I want to install AppWrite
  11. Install & Authorize, it doesn't matter if I select All repos, or Only select repos, it results in the same issue.
  12. Click Install & Authorize

At this point I'm redirected back to cloud.appwrite.io with the above error. I've uninstalled AppWrite through GitHub and tried multiple times. I'm at a complete loss, what am I doing wrong here?

This is the function I'm trying to get setup: https://github.com/appwrite/templates/tree/main/python/starter

I'm just trying to get the Starter Function running. Any ideas what's wrong? Thanks.

TL;DR
Developers solved the 'document_already_exists' error by: 1. Logging into GitHub and uninstalling AppWrite from their Organization. 2. Logging into AppWrite using GitHub, setting up an email/password, removing GitHub Identity, and logging out and back in. 3. Following the steps to create a Function on AppWrite Cloud, ensuring all fields were correctly set. The error was fixed by establishing a unique ID for the document.
cetfor
21 Jul, 2024, 16:29

Oh wow! I was able to get it working. I remember seeing support posts about people changing their GitHub email address after signing up with AppWrite using their account, which is something I recently did.

So to make sure this wasn't some how related, I did these steps:

  1. Logged into GitHub and uninstalled AppWrite from my Organization
  2. Login to AppWrite using my GitHub account
  3. Under "Your Account" I set up an email/password
  4. I removed my GitHub Identity
  5. Logged out
  6. Logged back in with my new email/password
  7. Tried the steps again from my original post, and it all worked.

I'm not sure what happened, or why document_already_exists is the error I was getting, but oh well. I'm pretty sure I could switch back to using GitHub to login now that my GitHub Organization and repo are connected to AppWrite cloud, but I'm just going to stick with my mail/password login.

Phew, I hope this helps someone else in the future.

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