Upload Image getting Failed When testing #1025

Closed
opened 2026-02-21 17:29:33 -05:00 by yindo · 5 comments
Owner

Originally created by @ganeshbehera on GitHub (Feb 3, 2024).

Originally assigned to: @iamjoel, @zxhlyh on GitHub.

Self Checks

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 ()
05:12:02 0|dify-web | at o (/app/web/.next/server/chunks/4438.js:43:7624)
05:12:02 0|dify-web | at l (/app/web/.next/server/chunks/3983.js:92:138887)
05:12:02 0|dify-web | at k (/app/web/.next/server/chunks/3983.js:92:137599)
05:12:02 0|dify-web | at em (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:128334)
05:12:02 0|dify-web | at /app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:140034
05:12:02 0|dify-web | at Array.toJSON (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:143612)
05:12:02 0|dify-web | at stringify ()
05:12:02 0|dify-web | at eE (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:131997)
05:12:02 0|dify-web | at eR (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:132440)
05:12:02 0|dify-web | [Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.]

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
Screenshot 2024-02-03 at 2 45 45 PM

Originally created by @ganeshbehera on GitHub (Feb 3, 2024). Originally assigned to: @iamjoel, @zxhlyh on GitHub. ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to file this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). ### 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 (<anonymous>) 05:12:02 0|dify-web | at o (/app/web/.next/server/chunks/4438.js:43:7624) 05:12:02 0|dify-web | at l (/app/web/.next/server/chunks/3983.js:92:138887) 05:12:02 0|dify-web | at k (/app/web/.next/server/chunks/3983.js:92:137599) 05:12:02 0|dify-web | at em (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:128334) 05:12:02 0|dify-web | at /app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:140034 05:12:02 0|dify-web | at Array.toJSON (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:143612) 05:12:02 0|dify-web | at stringify (<anonymous>) 05:12:02 0|dify-web | at eE (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:131997) 05:12:02 0|dify-web | at eR (/app/web/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:132440) 05:12:02 0|dify-web | [Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] 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 ![Screenshot 2024-02-03 at 2 45 45 PM](https://github.com/langgenius/dify/assets/53637426/af3b6ebf-acf7-4cfc-9752-d2eddd593fb9)
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 17:29:33 -05:00
yindo closed this issue 2026-02-21 17:29:33 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 3, 2024):

🤖

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


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.

@dosubot[bot] commented on GitHub (Feb 3, 2024): _🤖_ <!-- Greeting --> Hey @ganeshbehera, long time no see! Hope you're doing awesome. 😎 <!-- Answer --> 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: - [web/types/app.ts](https://github.com/langgenius/dify/blob/main/web/types/app.ts) - [api/extensions/ext_storage.py](https://github.com/langgenius/dify/blob/main/api/extensions/ext_storage.py) 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](https://github.com/langgenius/dify/blob/main/web/types/app.ts) - [web/app/components/base/image-uploader/chat-image-uploader.tsx](https://github.com/langgenius/dify/blob/main/web/app/components/base/image-uploader/chat-image-uploader.tsx) - [api/extensions/ext_storage.py](https://github.com/langgenius/dify/blob/main/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.
Author
Owner

@iamjoel commented on GitHub (Feb 3, 2024):

@ganeshbehera Can you provide specific reproduction steps? I can't reproduce the problem.
image

@iamjoel commented on GitHub (Feb 3, 2024): @ganeshbehera Can you provide specific reproduction steps? I can't reproduce the problem. <img width="1227" alt="image" src="https://github.com/langgenius/dify/assets/2120155/7717fc2c-57d3-4117-bc9f-a11673abc7f2">
Author
Owner

@ganeshbehera commented on GitHub (Feb 5, 2024):

It doesn't expect Image more than 1mb, this is what i found!

@ganeshbehera commented on GitHub (Feb 5, 2024): It doesn't expect Image more than 1mb, this is what i found!
Author
Owner

@takatost commented on GitHub (Feb 7, 2024):

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.

@takatost commented on GitHub (Feb 7, 2024): > 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.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 22, 2024):

Close due to it's no longer active, if you have any questions, you can reopen it.

@github-actions[bot] commented on GitHub (Feb 22, 2024): Close due to it's no longer active, if you have any questions, you can reopen it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#1025