api upload files but encounter "The server encountered an internal error and was unable to complete your request" #9944

Closed
opened 2026-02-21 18:40:52 -05:00 by yindo · 0 comments
Owner

Originally created by @awei139 on GitHub (Mar 8, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.0

Cloud or Self Hosted

Cloud

Steps to reproduce

I have published my workflow on the Dify website, and I want to use the API to call my workflow. Therefore, I carefully read the API documentation and wrote the following code.

Image

`import requests
import json

url = 'https://api.dify.ai/v1/chat-messages'
headers = {
'Authorization': 'Bearer app-cvAWPSTZCupZNuJre2seXKFs',
'Content-Type': 'application/json',
}

proxies = {
'http': 'socks5://127.0.0.1:7890',
'https': 'socks5://127.0.0.1:7890'
}

data = {
"inputs": {
"selection": "Fraud detection",
"input": [
{
"type": "pdf",
"transfer_method": "local_file",
"url": './test.pdf',
'upload_file_id':2
}
]
},
"query": "start",
"response_mode": "streaming",
"conversation_id": "",
"user": "abc-123",
}

response = requests.post(url, headers=headers, data=json.dumps(data),proxies=proxies)`

However, after running it, I was unable to get the desired result, and encountered the following error.

{"code": "internal_server_error", "message": "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.", "status": 500}

I would like to know where the issue lies—whether it's a problem with the code or the website.

Similarly, I have looked through many issues with the same error message, but they are either too old or not related to my specific problem. My error remains unresolved.

Since I am using the website's service, it should not be an issue related to version differences (I assume). This is because I encountered the same error after deploying it locally as well...

✔️ Expected Behavior

response 200

Actual Behavior

{"code": "internal_server_error", "message": "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.", "status": 500}

Originally created by @awei139 on GitHub (Mar 8, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [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 submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.0.0 ### Cloud or Self Hosted Cloud ### Steps to reproduce I have published my workflow on the Dify website, and I want to use the API to call my workflow. Therefore, I carefully read the API documentation and wrote the following code. ![Image](https://github.com/user-attachments/assets/77a14688-5a94-4585-80ab-1666cf164a35) `import requests import json url = 'https://api.dify.ai/v1/chat-messages' headers = { 'Authorization': 'Bearer app-cvAWPSTZCupZNuJre2seXKFs', 'Content-Type': 'application/json', } proxies = { 'http': 'socks5://127.0.0.1:7890', 'https': 'socks5://127.0.0.1:7890' } data = { "inputs": { "selection": "Fraud detection", "input": [ { "type": "pdf", "transfer_method": "local_file", "url": './test.pdf', 'upload_file_id':2 } ] }, "query": "start", "response_mode": "streaming", "conversation_id": "", "user": "abc-123", } response = requests.post(url, headers=headers, data=json.dumps(data),proxies=proxies)` However, after running it, I was unable to get the desired result, and encountered the following error. {"code": "internal_server_error", "message": "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.", "status": 500} I would like to know where the issue lies—whether it's a problem with the code or the website. Similarly, I have looked through many issues with the same error message, but they are either too old or not related to my specific problem. My error remains unresolved. Since I am using the website's service, it should not be an issue related to version differences (I assume). This is because I encountered the same error after deploying it locally as well... ### ✔️ Expected Behavior response 200 ### ❌ Actual Behavior {"code": "internal_server_error", "message": "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.", "status": 500}
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 18:40:52 -05:00
yindo closed this issue 2026-02-21 18:40:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#9944