Back

[SOLVED] appwriteException: Invalid document structure: Unknown attribute: "Images"

  • 0
  • Databases
  • Web
Ayush_Parui
27 Oct, 2023, 06:14

While I try to add something in the Database I'm getting this error even though the Images attribute doesn't even exist in the Database. How do I fix this issue ?

TL;DR
Issue: User is getting an error message "appwriteException: Invalid document structure: Unknown attribute: "Images"" when trying to add something to the database, even though the "Images" attribute does not exist in the database. Solution: The error is caused by trying to create a document with the "Images" attribute still present somewhere in the code. The user needs to ensure that the code does not reference or try to create the "Images" attribute. Additionally, for image uploads, it is recommended to use Appwrite's storage feature. More information about image uploads can be found in the provided link: https://appwrite.io/docs
Ayush_Parui
27 Oct, 2023, 06:17

Please help I need to fix this asap

Haimantika
27 Oct, 2023, 08:14

For image upload you should be using Storage. You can read more here - https://appwrite.io/docs/products/storage/upload-download

elnur
27 Oct, 2023, 08:17

I upload my images to storage, if you try and upload a Blob you need to convert it into a file. If you for some reason do want to store it in DB you can just use JSON.stringify(obj) to store it as a string. You would then need to use JSON.parse() on client side to get the actual object.

Ayush_Parui
27 Oct, 2023, 14:21

Well I'm storing my images in the storage and storing the image id in the db. I'm still figuring out how my code worked even after not tinkering with the code. Maybe cause I deleted the Image attribute from the db, still don't know how it worked.

Ayush_Parui
27 Oct, 2023, 14:22

I dont mind as long as the code is working <:appwritepeepo:1156975874852270110> .

ZachHandley
27 Oct, 2023, 15:04

If you deleted the image attribute fro the database, that’s what’s causing this error, you’re trying to create a document somewhere that still has the image attribute in it

Haimantika
30 Oct, 2023, 07:52

Guess we are good then? 👀 And can consider this issue solved?

Ayush_Parui
30 Oct, 2023, 12:27

yup <:appwritepeepo:1156975874852270110>

Guille
30 Oct, 2023, 13:12

[SOLVED] appwriteException: Invalid document structure: Unknown attribute: "Images"

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