Patolord
Patolord7mo ago

Failed to load resource: the server responded with a status of 400 () - File Storage

My code works on development, but on production I get a 400 code. It must be something to do with the env variables or hostname but i cant figure it out... Is there any special config i need to do for my domain? app.mydomain.com BTW I'm using clerk, and the auth login sign and org permissions are working fine.
No description
2 Replies
kapa.ai
kapa.ai7mo ago
Hi @Patolord. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- It seems like you're having trouble with the file storage feature of Convex in a production environment. Here are a few things you might want to check: 1. Environment Variables: Ensure that you have correctly set up your environment variables. Convex allows up to 100 environment variables per deployment, with a maximum name length of 40 characters and a maximum value size of 8 KiB. If you're using environment variables in your file storage code, make sure they are within these limits. Source (https://docs.convex.dev/production/state/limits#environment-variables) 2. File Storage Limits: Check if you're within the file storage limits for your Convex plan. The Starter plan includes 1 GiB of storage and 1 GiB/month of bandwidth. The Professional plan includes 100 GiB of storage and 50 GiB/month of bandwidth, with additional costs for extra usage. Source (https://docs.convex.dev/production/state/limits#file-storage) 3. CORS Configuration: If you're uploading files via an HTTP action, make sure you've correctly handled the pre-flight OPTIONS request and set the Access-Control-Allow-Origin header to your domain (e.g., <https://app.mydomain.com>). Source (https://docs.convex.dev/file-storage/upload-files#defining-the-upload-http-action) 4. Authentication Provider: If you're using an authentication provider like Clerk or Auth0, make sure it's configured to accept your production URL. Source (https://docs.convex.dev/production/hosting/custom#authentication) If you're still having trouble, you might want to reach out to the Convex community on Discord for further assistance. Source (https://docs.convex.dev/file-storage) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai7mo ago
<@287459760855449601> kapa.ai is still learning and improving, please let us know how it did by reacting below