nexent icon indicating copy to clipboard operation
nexent copied to clipboard

[Bug] 文件上传data-process没有读权限

Open Iris517 opened this issue 1 year ago • 1 comments

Nexent Version

No response

Problem Description

[00:13:17 WARNING] Task 1c49e3c4-9e13-405b-a157-5812afdb4945 has legacy bad exception format, marking as FAILURE for forced update. [00:13:17 WARNING] Task fda95174-1fd2-41b0-acc8-7c053c9f54ea has legacy bad exception format, marking as FAILURE for forced update. [00:13:17 INFO] Retrieved 0 tasks. INFO: 172.18.0.7:42854 - "GET /api/tasks/indices/%E6%96%B0%E7%9F%A5%E8%AF%86%E5%BA%93 HTTP/1.1" 200 OK [00:14:32 INFO] [process-worker] Task data_process.tasks.process[fda95174-1fd2-41b0-acc8-7c053c9f54ea] received [00:14:32 INFO] [process-worker] Task data_process.tasks.process[85bcb5ae-29f5-4db1-87b0-029ee9a9fe8b] received [00:15:50 INFO] [process-worker] Task data_process.tasks.process_and_forward[eb7e252e-452c-4bdc-bd17-586f2cefb8ef] received INFO: 172.18.0.7:60962 - "POST /api/tasks HTTP/1.1" 201 Created [00:15:50 INFO] [process-worker] Starting processing chain for /opt/backend/uploads/FusionCube A3000 单节点本地盘部署指导-v1.0.docx, strategy=None, index=新知识库 [00:15:50 INFO] [process-worker] Created task chain ID: 5d64ea8b-1c03-4d17-9391-885291e05343 [00:15:50 INFO] [process-worker] Task data_process.tasks.process_and_forward[eb7e252e-452c-4bdc-bd17-586f2cefb8ef] succeeded in 0.002278737010783516s: '5d64ea8b-1c03-4d17-9391-885291e05343' [00:15:50 INFO] [process-worker] Task data_process.tasks.process[39e52941-9124-45c6-9218-0fd29648222d] received [00:15:50 INFO] [process-worker] PROCESS TASK: File size: 3.03MB [00:15:50 INFO] [process-worker] Error processing file /opt/backend/uploads/FusionCube A3000 单节点本地盘部署指导-v1.0.docx: ray::DataProcessorRayActor.process_file() (pid=876, ip=172.18.0.8, actor_id=76faada0eacc768f8b9ca6b602000000, repr=<data_process.ray_actors.DataProcessorRayActor object at 0x7f0940c2f740>) [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/opt/backend/data_process/ray_actors.py", line 25, in process_file [00:15:50 INFO] [process-worker] raw_chunks = self._processor._process_file( [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/home/notebook-user/.local/lib/python3.12/site-packages/nexent/data_process/core.py", line 146, in _process_file [00:15:50 INFO] [process-worker] elements = partition( [00:15:50 INFO] [process-worker] ^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/home/notebook-user/.local/lib/python3.12/site-packages/unstructured/partition/auto.py", line 166, in partition [00:15:50 INFO] [process-worker] file_type = detect_filetype( [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/home/notebook-user/.local/lib/python3.12/site-packages/unstructured/file_utils/filetype.py", line 109, in detect_filetype [00:15:50 INFO] [process-worker] return _FileTypeDetector.file_type(ctx) [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/home/notebook-user/.local/lib/python3.12/site-packages/unstructured/file_utils/filetype.py", line 162, in file_type [00:15:50 INFO] [process-worker] return cls(ctx)._file_type [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/home/notebook-user/.local/lib/python3.12/site-packages/unstructured/file_utils/filetype.py", line 174, in _file_type [00:15:50 INFO] [process-worker] predicted_file_type := self._known_binary_file_type [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/home/notebook-user/.local/lib/python3.12/site-packages/unstructured/file_utils/filetype.py", line 201, in _known_binary_file_type [00:15:50 INFO] [process-worker] if file_type := _OleFileDetector.file_type(self._ctx): [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/home/notebook-user/.local/lib/python3.12/site-packages/unstructured/file_utils/filetype.py", line 549, in file_type [00:15:50 INFO] [process-worker] return cls(ctx)._file_type [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/home/notebook-user/.local/lib/python3.12/site-packages/unstructured/file_utils/filetype.py", line 563, in _file_type [00:15:50 INFO] [process-worker] if not self._is_ole_file: [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/home/notebook-user/.local/lib/python3.12/site-packages/unstructured/utils.py", line 154, in get [00:15:50 INFO] [process-worker] value = self._fget(obj) [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/home/notebook-user/.local/lib/python3.12/site-packages/unstructured/file_utils/filetype.py", line 575, in _is_ole_file [00:15:50 INFO] [process-worker] with self._ctx.open() as file: [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/usr/lib/python3.12/contextlib.py", line 137, in enter [00:15:50 INFO] [process-worker] return next(self.gen) [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] File "/home/notebook-user/.local/lib/python3.12/site-packages/unstructured/file_utils/filetype.py", line 457, in open [00:15:50 INFO] [process-worker] with open(self.file_path, "rb") as f: [00:15:50 INFO] [process-worker] ^^^^^^^^^^^^^^^^^^^^^^^^^^ [00:15:50 INFO] [process-worker] PermissionError: [Errno 13] Permission denied: '/opt/backend/uploads/FusionCube A3000 单节点本地盘部署指导-v1.0.docx' [00:15:50 INFO] [process-worker] (DataProcessorRayActor pid=876) Could not detect file type: [Errno 13] Permission denied: '/opt/backend/uploads/FusionCube A3000 单节点本地盘部署指导-v1.0.docx' [00:15:50 INFO] [process-worker] (DataProcessorRayActor pid=876) Error processing file /opt/backend/uploads/FusionCube A3000 单节点本地盘部署指导-v1.0.docx: [Errno 13] Permission denied: '/opt/backend/uploads/FusionCube A3000 单节点本地盘部署指导-v1.0.docx'

Reproduction Steps

No response

Additional Information

No response

Iris517 avatar Jul 01 '25 12:07 Iris517

This issue is most likely caused by an incorrect UMASK set-up during the deploy procedure. Can be solved to manually set UMASK=0022 on your server. But a more elegant deployment approach should be used to completely eliminate this problem.

Jasonxia007 avatar Jul 02 '25 18:07 Jasonxia007