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: Error 'Document with the requested ID already exists' when tries to upload video #5686

Closed
2 tasks done
joec05 opened this issue Jun 11, 2023 · 9 comments
Closed
2 tasks done
Labels
bug Something isn't working product / storage Fixes and upgrades for the Appwrite Storage.

Comments

@joec05
Copy link

joec05 commented Jun 11, 2023

👟 Reproduction steps

InputFile fileToInputFile(String uri, String path) {
    final inputFile = InputFile.fromPath(path: uri, filename: path);
    return inputFile;
  }

  Future<String> uploadMediaToAppWrite(String bucketID, String uri, String path) async{
    String loadedUri = '';
    final appWriteStorage = Storage(updateAppWriteClient());
    String uniqueID = Uuid().v4();
    print('$uniqueID is uniqueid');
    await appWriteStorage.createFile(
      bucketId: bucketID,
      fileId: uniqueID,
      file: fileToInputFile(uri, path)
    ).then((response) async{
      loadedUri = 'https://cloud.appwrite.io/v1/storage/buckets/$bucketID/files/$uniqueID/view?project=$appWriteUserID&mode=admin';
    })
    .catchError((error) {
      print('error');
        print(error.response);
    });
    return loadedUri;
  }

i used this function for uploading both images and videos. with images it succeeded but not with videos.

👍 Expected behavior

I believe just like when uploading image, uploading videos should have been successful because in the client i'm using the same function as the one i used to upload images.

👎 Actual Behavior

but it didnt. it returned an error with the message: '{message: Document with the requested ID already exists., code: 409, type: document_already_exists, version: 0.10.30}'. the only difference between the images and videos in the storage was that i used a separate bucket, and i had double checked the bucket ids. even i tried uploading the video to the image's bucket, but still to no avail.

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Windows

🧱 Your Environment

i am using the 9.0.0. i tried downgrading to 8.1.0 but still everything doesnt change.

👀 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?

@joec05 joec05 added the bug Something isn't working label Jun 11, 2023
@joec05 joec05 changed the title 🐛 Bug Report: 🐛 Bug Report: Error Document with the requested ID already exists when tries to upload video Jun 11, 2023
@joec05 joec05 changed the title 🐛 Bug Report: Error Document with the requested ID already exists when tries to upload video 🐛 Bug Report: Error 'Document with the requested ID already exists' when tries to upload video Jun 11, 2023
@professorabhay
Copy link

Hey @joec05, Have you make sure that the bucket ID and file ID you are using for the video are correct. Double-check that they match the actual IDs of the bucket and file you want to upload the video to.

@joec05
Copy link
Author

joec05 commented Jun 20, 2023

well, yes. i even used tried changing the bucket id to the bucket id of the image bucket's. it still returned the same error.

@fvdf
Copy link

fvdf commented Jul 18, 2023

Hi, what is the size of the video? I ask you this because I have already encountered this problem with large files (greater than 5MB). I had the same error message... I use the appwrite sdk flutter and you? Have you solved your problem?

@Batoe
Copy link

Batoe commented Jul 27, 2023

Hi, I have the same problem. When I uploaded a video larger than 30MB, the same error was returned. It should be larger than 5M and this problem arises.

@joec05
Copy link
Author

joec05 commented Jul 27, 2023

Hi, what is the size of the video? I ask you this because I have already encountered this problem with large files (greater than 5MB). I had the same error message... I use the appwrite sdk flutter and you? Have you solved your problem?

well to be honest i didn't really pay attention to that, but maybe i'll actually try with a smaller sized video.

@marvinIsSacul
Copy link

Hi,

It appears as thought files larger than 5MB really do cause this issue.

Any fixes yet?

@orelvis15
Copy link

Hello, Same problem here with the Kotlin/Android SDK

Code: 409 type: null response: {"message":"A storage file with the requested ID already exists.","code":409,"type":"storage_file_already_exists","version":"0.11.12"}

@fvdf
Copy link

fvdf commented Oct 19, 2023

Hello, 👋

if the problem is solved with a file of less than 5 MB, the problem comes from cutting and receiving the file. I think that the server after receiving the first party blocks the rest of the file for no real reason.

In my case I started by testing with the appwrite cloud server and the most no problem, so I understood that it came from my server. I reinstalled my server and no more problems.

If you have a self-host server you should try this solution.😉

Have good day !

@stnguyen90 stnguyen90 added the product / storage Fixes and upgrades for the Appwrite Storage. label May 21, 2024
@stnguyen90
Copy link
Contributor

Closing as a duplicate of #5563

@stnguyen90 stnguyen90 closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / storage Fixes and upgrades for the Appwrite Storage.
Projects
None yet
Development

No branches or pull requests

7 participants