[Bug] Unable to Upload PDF in Chat Using "Upload File" Feature #4355
-
📦 EnvironmentVercel 📌 Versionv1.16.11 💻 Operating SystemWindows 🌐 BrowserEdge 🐛 Bug DescriptionWhen attempting to use the "Upload File" feature to upload a PDF file in the chat with assistants, an error occurs consistently. This issue is specific to the chat interface, as uploading PDFs in the "Files" section works normally and can be accessed in the "Knowledge Base" feature within the chat. Screenshot of the error:
Below is what I see in the console log:
📷 Recurrence Steps
🚦 Expected BehaviorThe PDF file should upload normally and be available for use in the chat. 📝 Additional Information |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
👀 @samkurd Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. |
Beta Was this translation helpful? Give feedback.
-
Hey there, @samkurd! I'm here to assist you with any bugs, questions, or contributions. Let's work together to solve this issue. I found a similar closed issue: [Request] cannot upload files, except images, which was resolved by a pull request: ✨ feat: files and knowledge base on August 21, 2024 [1]. The issue you're experiencing with uploading a PDF in the chat using the "Upload File" feature in version v1.16.11 on Windows with Edge could be related to the The "Invalid key length" error might be due to an issue during the file upload process. The try {
fileResult = await get().uploadWithProgress({
file,
onStatusUpdate: dispatchChatUploadFileList,
});
} catch (error) {
// skip `UNAUTHORIZED` error
if ((error as any)?.message !== 'UNAUTHORIZED')
notification.error({
description:
// it may be a network error or the cors error
error === UPLOAD_NETWORK_ERROR
? t('upload.networkError', { ns: 'error' })
: // or the error from the server
typeof error === 'string'
? error
: t('upload.unknownError', { ns: 'error', reason: (error as Error).message }),
message: t('upload.uploadFailed', { ns: 'error' }),
});
dispatchChatUploadFileList({ id: file.name, type: 'removeFile' });
} This mechanism can help provide more insight into the "Invalid key length" error by displaying the error message in the notification [3]. To further investigate, you might want to check the server logs for more details on the "Invalid key length" error and ensure that the server configuration is correct for handling PDF uploads. |
Beta Was this translation helpful? Give feedback.
-
check your server log please. |
Beta Was this translation helpful? Give feedback.
-
this is the server log for the error, please let me know if this is enough.
fetch @ 97013-02472d5cb275a608.js:1 |
Beta Was this translation helpful? Give feedback.
-
It seems your issue is the file can be fetched. Check your s3 config |
Beta Was this translation helpful? Give feedback.
-
Thanks @arvinxx , what do you think has been misconfigured? I'm using Cloudflare. |
Beta Was this translation helpful? Give feedback.
-
Hi @samkurd Have you solved this issue? If you have solved it, could you tell me how to solve it? Thanks |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
if the error is |
Beta Was this translation helpful? Give feedback.
-
✅ @samkurd This issue is closed, If you have any questions, you can comment and reply. |
Beta Was this translation helpful? Give feedback.
if the error is
Invalid key length
, you must set a wrongKEY_VAULTS_SECRET
, please check the document: https://lobehub.com/docs/self-hosting/server-database#key-vaults-secret