dify icon indicating copy to clipboard operation
dify copied to clipboard

Upload Image getting Failed When testing

Open ganeshbehera opened this issue 2 years ago • 3 comments

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

ganeshbehera avatar Feb 03 '24 09:02 ganeshbehera

🤖

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] avatar Feb 03 '24 09:02 dosubot[bot]

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

iamjoel avatar Feb 04 '24 02:02 iamjoel

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

ganeshbehera avatar Feb 05 '24 08:02 ganeshbehera

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 avatar Feb 07 '24 08:02 takatost

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

github-actions[bot] avatar Feb 23 '24 03:02 github-actions[bot]