-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file id is null #13159
Comments
Hello, @HuChundong! I'm here to help you with any bugs, questions, or contributions you have in mind. Let's tackle this issue together! A file ID being null after an upload attempt in the Dify platform can occur due to several reasons. Here are some potential causes and checks you can perform:
By addressing these areas, you should be able to identify the cause of the null file ID and resolve the issue. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
i have change my chatflow. but it not help. because the file id is still null. app:
description: ''
icon: 🤖
icon_background: '#FFEAD5'
mode: advanced-chat
name: test
use_icon_as_answer_icon: false
kind: app
version: 0.1.5
workflow:
conversation_variables: []
environment_variables: []
features:
file_upload:
allowed_file_extensions:
- .txt
allowed_file_types:
- video
- audio
- image
- document
allowed_file_upload_methods:
- remote_url
- local_file
enabled: true
fileUploadConfig:
audio_file_size_limit: 50
batch_count_limit: 5
file_size_limit: 15
image_file_size_limit: 10
video_file_size_limit: 100
workflow_file_upload_limit: 10
image:
enabled: false
number_limits: 3
transfer_methods:
- local_file
- remote_url
number_limits: 1
opening_statement: ''
retriever_resource:
enabled: true
sensitive_word_avoidance:
enabled: false
speech_to_text:
enabled: false
suggested_questions: []
suggested_questions_after_answer:
enabled: false
text_to_speech:
enabled: false
language: ''
voice: ''
graph:
edges:
- data:
isInIteration: false
sourceType: start
targetType: tool
id: 1738532363024-source-1738532389502-target
source: '1738532363024'
sourceHandle: source
target: '1738532389502'
targetHandle: target
type: custom
zIndex: 0
- data:
isInIteration: false
sourceType: tool
targetType: answer
id: 1738532389502-source-answer-target
source: '1738532389502'
sourceHandle: source
target: answer
targetHandle: target
type: custom
zIndex: 0
nodes:
- data:
desc: ''
selected: true
title: 开始
type: start
variables:
- allowed_file_extensions: []
allowed_file_types:
- image
- document
- audio
- video
allowed_file_upload_methods:
- local_file
- remote_url
label: user_file
max_length: 48
options: []
required: false
type: file
variable: user_file
height: 89
id: '1738532363024'
position:
x: 80
y: 280.6804920892271
positionAbsolute:
x: 80
y: 280.6804920892271
selected: true
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
answer: '{{#1738532389502.text#}}'
desc: ''
selected: false
title: 直接回复
type: answer
variables: []
height: 102
id: answer
position:
x: 763.1289983786921
y: 272.76344462458974
positionAbsolute:
x: 763.1289983786921
y: 272.76344462458974
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
- data:
desc: ''
provider_id: 6192c406-fe54-40ce-973a-50b568301c2c
provider_name: 封装返回结构
provider_type: workflow
selected: false
title: 封装返回结构
tool_configurations: {}
tool_label: 封装返回结构
tool_name: pack_response
tool_parameters:
files:
type: variable
value:
- '1738532363024'
- user_file
response:
type: mixed
value: test
status:
type: constant
value: 0
type: tool
height: 53
id: '1738532389502'
position:
x: 422.99307122794414
y: 296.1918580055515
positionAbsolute:
x: 422.99307122794414
y: 296.1918580055515
selected: false
sourcePosition: right
targetPosition: left
type: custom
width: 243
viewport:
x: 191.99125013167668
y: 186.08042124219423
zoom: 0.870550563296124
` |
If you want to to get dify/api/core/tools/tool/workflow_tool.py Lines 170 to 175 in b66c03d
|
The issue is not the absence of a file id, but rather the missing file id, which will cause errors in next nodes that use the file. You can use the DSL above for testing. |
NEED REOPEN ISSUE |
…ublished as a tool Fixes langgenius#13159
…ublished as a tool Fixes langgenius#13159
Self Checks
Dify version
0.15.2
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
a min dsl to show this issue:
✔️ Expected Behavior
when i upload file, the id is null, but when i use this file as param, error report: Run failed: Failed to invoke tool: Invalid upload file id
web and api both report this issue.
{
"user_file": {
"dify_model_identity": "dify__file",
"id": null,
"tenant_id": "c6165e3a-fb17-48cb-aa03-fc0db568fd71",
"type": "document",
"transfer_method": "local_file",
"remote_url": "",
"related_id": "f03a14aa-0986-424a-8112-c12ec162872f",
"filename": "api-doc.txt",
"extension": ".txt",
"mime_type": "text/plain",
"size": 18081,
"url": "/files/f03a14aa-0986-424a-8112-c12ec162872f/file-preview?timestamp=1738532135&nonce=464b7957014d5649ee113ed8bdd61c1a&sign=Y2rUMWbi9AYIHw1rKw8zT_Fv0FY9A7RmlUHRMTOhh3s="
},
"sys.query": "dd",
"sys.files": [],
"sys.conversation_id": "e0258f20-7541-4fea-9526-48f72c2b548e",
"sys.user_id": "7743e2d7-cf48-426e-9a4a-05c58b289e03",
"sys.dialogue_count": 0,
"sys.app_id": "88910469-0772-4ec6-b742-93de4e0196b7",
"sys.workflow_id": "4aba5c71-4706-42de-81a8-902cb84ccccc",
"sys.workflow_run_id": "b25ca1a2-144c-4def-a04c-cf8f1e2ddc02"
}
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered: