MinerU Plugin Bug: NameError: name 'File' is not defined #488

Closed
opened 2026-02-16 10:19:33 -05:00 by yindo · 5 comments
Owner

Originally created by @rigelfalcon on GitHub (Jul 26, 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 Dify issues & Dify Official Plugins, 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

Version 1.6.0

Plugin version

MinerU 0.3.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

MinerU-Check.yml.txt

✔️ Error log

Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"NameError","message":"name 'File' is not defined"}

seems lost "from dify_plugin.file.file import File"

Paste your full Python code here

import base64
import io
import json
import logging
import os
import time
import zipfile
from collections.abc import Generator
from dataclasses import dataclass
from typing import Any, Dict, List, Optional

import httpx
from dify_plugin.invocations.file import UploadFileResponse
from requests import post, get, put
from dify_plugin import Tool
from dify_plugin.entities.tool import ToolInvokeMessage
from dify_plugin.errors.tool import ToolProviderCredentialValidationError
from yarl import URL
from dify_plugin.file.file import File # <--- This is the working import

Originally created by @rigelfalcon on GitHub (Jul 26, 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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/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 Version 1.6.0 ### Plugin version MinerU 0.3.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce [MinerU-Check.yml.txt](https://github.com/user-attachments/files/21448611/MinerU-Check.yml.txt) ### ✔️ Error log Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"NameError","message":"name 'File' is not defined"} seems lost "from dify_plugin.file.file import File" # Paste your full Python code here import base64 import io import json import logging import os import time import zipfile from collections.abc import Generator from dataclasses import dataclass from typing import Any, Dict, List, Optional import httpx from dify_plugin.invocations.file import UploadFileResponse from requests import post, get, put from dify_plugin import Tool from dify_plugin.entities.tool import ToolInvokeMessage from dify_plugin.errors.tool import ToolProviderCredentialValidationError from yarl import URL from dify_plugin.file.file import File # <--- This is the working import
yindo added the bug label 2026-02-16 10:19:33 -05:00
yindo closed this issue 2026-02-16 10:19:33 -05:00
Author
Owner

@l241025097 commented on GitHub (Jul 27, 2025):

Image same problem
@l241025097 commented on GitHub (Jul 27, 2025): <img width="1292" height="735" alt="Image" src="https://github.com/user-attachments/assets/c37decda-1604-45ca-b863-1a7741b772c5" /> same problem
Author
Owner

@chihosin commented on GitHub (Jul 28, 2025):

How to fix it at local docker container?

@chihosin commented on GitHub (Jul 28, 2025): How to fix it at local docker container?
Author
Owner

@rigelfalcon commented on GitHub (Jul 28, 2025):

How to fix it at local docker container?
Add this import:
from dify_plugin.file.file import File
to
/you_path_to_dify/docker/volumes/plugin_daemon/cwd/langgenius/mineru-0.3.0@xxxx/tools/parse.py

@rigelfalcon commented on GitHub (Jul 28, 2025): > How to fix it at local docker container? Add this import: `from dify_plugin.file.file import File` to /you_path_to_dify/docker/volumes/plugin_daemon/cwd/langgenius/mineru-0.3.0@xxxx/tools/parse.py
Author
Owner

@rigelfalcon commented on GitHub (Jul 28, 2025):

https://github.com/langgenius/dify-official-plugins/pull/1365

@rigelfalcon commented on GitHub (Jul 28, 2025): https://github.com/langgenius/dify-official-plugins/pull/1365
Author
Owner

@l241025097 commented on GitHub (Jul 28, 2025):

mineru plugin update to 0.3.1, solved.

@l241025097 commented on GitHub (Jul 28, 2025): mineru plugin update to 0.3.1, solved.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#488