Upload Image getting Failed When testing
Self Checks
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to file this report (我已阅读并同意 Language Policy).
Dify version
0.5.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
05:12:02 0|dify-web | RangeError: Incorrect locale information provided
05:12:02 0|dify-web | at Intl.getCanonicalLocales (
THis is docker log of web
✔️ Expected Behavior
It should upload image while chating with Google Vision or GPT 4 vision
❌ Actual Behavior
Image Upload Faily
🤖
Hey @ganeshbehera, long time no see! Hope you're doing awesome. 😎
Based on the error log you've provided, it seems like the issue is related to locale information. The error RangeError: Incorrect locale information provided is thrown when the Intl.getCanonicalLocales() function receives an invalid locale. This function is used to normalize locale arguments and return them in a canonicalized form, and it's part of JavaScript's Internationalization API.
The error is being thrown in the o function at /app/web/.next/server/chunks/4438.js:43:7624. Without the actual source code, it's hard to say exactly what's going wrong, but it's likely that this function is receiving an invalid locale from somewhere.
As for the image upload failure, it's not clear from the provided information if this is directly related to the locale issue. The image upload process in dify is handled by the save method of the Storage class in the api/extensions/ext_storage.py file. This method checks the storage type and either uploads the file to an S3 bucket or saves it locally, depending on the configuration.
If the image upload is failing, it could be due to a number of reasons, such as the image file being too large or having an unsupported format. The allowed formats and maximum file size are defined in the VisionSettings type in the web/types/app.ts file. The allowed formats are 'png', 'jpg', 'jpeg', 'webp', and 'gif', and the maximum file size is defined by the image_file_size_limit field.
To help troubleshoot this issue, could you please provide more information about the image you're trying to upload, such as its format and size? Also, could you please check your application's locale settings and make sure they're valid? If you're using a custom locale, you might want to try switching to a standard one to see if that resolves the issue.
For more information, you can refer to the following sources:
Please note that I'm unable to view the screenshot you've attached as I can't process images. If there's any important information in the screenshot, could you please describe it in text form?
Sources
- web/types/app.ts
- web/app/components/base/image-uploader/chat-image-uploader.tsx
- api/extensions/ext_storage.py
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
@ganeshbehera Can you provide specific reproduction steps? I can't reproduce the problem.
It doesn't expect Image more than 1mb, this is what i found!
It doesn't expect Image more than 1mb, this is what i found!
Can you try https://cloud.dify.ai to see if the issue persists? I suspect it might be related to the upload limit of the external proxy during self-deployment.
Close due to it's no longer active, if you have any questions, you can reopen it.