Back

500 error on Cloud Storage upload

  • 0
  • Web
  • Storage
  • Cloud
peiche
13 Oct, 2023, 17:40

I have an application set up with Appwrite Cloud, and the same database and storage structure set up on Gitpod. I am seeing a 500 error when I upload a file to storage on Cloud, but the Gitpod instance uploads just fine. (I can also manually upload the file to Cloud in the Console, with no problems.) I haven't had any issues with other file uploads on Cloud. The error response on Cloud is very generic:

TypeScript
{
    "message": "Server Error",
    "code": 500,
    "type": "general_unknown",
    "version": "0.11.12"
}

Is there any way to see a more detailed error message? My project ID is 6423a55a17c8acba9dd6.

TL;DR
User is experiencing a 500 error when uploading a file to Cloud Storage on Appwrite Cloud, but the same file uploads fine on their Gitpod instance. They have checked the file size (65,237 bytes) and it is well below the file size limit. They suspect it may be a cache or permissions issue. They are asking if there is a way to see a more detailed error message. Solution: The user can try clearing their browser cache to see if that resolves the issue. They can also check the permissions settings for the Cloud Storage on their Appwrite Cloud project. If the issue persists, they may need to contact Appwrite
D5
13 Oct, 2023, 20:04

Does this issue still persists?

peiche
13 Oct, 2023, 20:07

Yes

D5
13 Oct, 2023, 20:08

Where are you getting the error message?

Drake
13 Oct, 2023, 20:48

are you sure this is your project id on cloud?

peiche
13 Oct, 2023, 20:51

6423a55a17c8acba9dd6, I just double checked that I was in Appwrite Cloud and not Gitpod

Drake
13 Oct, 2023, 20:53

weird...i don't see any errors related to this project

D5
13 Oct, 2023, 22:30

Maybe it's a cache/permissions issue 🤔

peiche
14 Oct, 2023, 16:35

I'm pretty sure it's not a permissions issue, as I'm able to upload other files. How would I diagnose a cache issue?

D5
14 Oct, 2023, 16:39

By deleting browser cache

peiche
14 Oct, 2023, 22:08

My file upload isn't directly from a file input. I'm creating a js File object using a JSON object and passing that to the createFile() function. Could that have anything to do with it? It's still only 65K, well under the file size limit of my bucket.

D5
14 Oct, 2023, 22:13

65 kB?

peiche
14 Oct, 2023, 22:36

Yes, thereabouts. 65,237 bytes

Drake
14 Oct, 2023, 22:51

What's the code?

peiche
14 Oct, 2023, 22:57
TypeScript
storage.createFile(reportStorageId, ID.unique(), new File([JSON.stringify(days)], 'upload.json', { type: 'application/json',  }))

days is an array of objects

Drake
15 Oct, 2023, 19:20

Hmm this is the web sdk?

peiche
15 Oct, 2023, 19:54

Yes, it's a React project

Drake
15 Oct, 2023, 20:10

I'm not so sure this will work...it's supposed to be a selected file from the filesystem.

How big is the JSON?

peiche
16 Oct, 2023, 14:09

This file is 65,237 bytes. Most of the files are between 30 and 60 KB. This is particularly strange, because there are larger files (one is 69 KB) that have uploaded successfully in the past. And as I mentioned, this same file -- which is resulting in a 500 error -- uploads fine in my Gitpod instance.

peiche
16 Oct, 2023, 14:46

For the sake of clarity, my use-case is: the user uploads a .csv file. My app parses that file and generates a JSON object from its data. That JSON is uploaded to Appwrite Storage.

Drake
16 Oct, 2023, 17:08

Ummm so is this upload happening server side?

peiche
16 Oct, 2023, 17:21

No, the js is run on the client. Appwrite Cloud is the only server. Edit: okay, the React code is on Netlify. But there's no server processing there.

peiche
18 Oct, 2023, 13:59

Since I'm uploading files in a manner not officially supported (or expected), I have switched to storing the JSON in my database table directly. Through trial and error, I found that the max size of a string field is 1,073,741,824. Therefore, I am checking the length of the JSON string before attempting the write. I don't expect any JSON string to exceed that limit, however.

Drake
18 Oct, 2023, 16:06

if you want to debug further...it would help if you shared the HTTP request (from the network logs of the browser dev tools) for both cloud and gitpod

Drake
18 Oct, 2023, 16:07

apologies for the delay in getting back to you 🙈

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