Skip to content
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

Uploaded file shows: File not found #4531

Closed
4 tasks done
kokojacket opened this issue May 20, 2024 · 3 comments
Closed
4 tasks done

Uploaded file shows: File not found #4531

kokojacket opened this issue May 20, 2024 · 3 comments
Assignees
Labels
🐞 bug Something isn't working

Comments

@kokojacket
Copy link

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).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.8

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I am preparing to build a knowledge base and uploaded a txt file, about 2KB. In the last step, File not found__ was displayed.
image
日志:
[2024-05-20 09:27:34,271: ERROR/MainProcess] consume document failed 2024-05-20 17:27:34 Traceback (most recent call last): 2024-05-20 17:27:34 File "/app/api/core/indexing_runner.py", line 64, in run 2024-05-20 17:27:34 text_docs = self._extract(index_processor, dataset_document, processing_rule.to_dict()) 2024-05-20 17:27:34 File "/app/api/core/indexing_runner.py", line 362, in _extract 2024-05-20 17:27:34 text_docs = index_processor.extract(extract_setting, process_rule_mode=process_rule['mode']) 2024-05-20 17:27:34 File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 21, in extract 2024-05-20 17:27:34 text_docs = ExtractProcessor.extract(extract_setting=extract_setting, 2024-05-20 17:27:34 File "/app/api/core/rag/extractor/extract_processor.py", line 81, in extract 2024-05-20 17:27:34 storage.download(upload_file.key, file_path) 2024-05-20 17:27:34 File "/app/api/extensions/ext_storage.py", line 54, in download 2024-05-20 17:27:34 self.storage_runner.download(filename, target_filepath) 2024-05-20 17:27:34 File "/app/api/extensions/storage/local_storage.py", line 70, in download 2024-05-20 17:27:34 raise FileNotFoundError("File not found") 2024-05-20 17:27:34 FileNotFoundError: File not found

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

Copy link

dosubot bot commented May 20, 2024

The FileNotFoundError you're encountering during the file upload process in your self-hosted Dify setup is due to the application's inability to locate the uploaded file for extraction. This issue typically arises from a problem with the storage configuration or file access permissions. Here are the steps to troubleshoot and potentially resolve the issue:

  1. Check Host Directory and Permissions: Ensure the host directory (./volumes/app/storage) exists and that the Docker container has the correct permissions to access this directory. This is crucial for the application to read from and write to the storage.

  2. Review Docker Compose Configuration: Verify that your Docker Compose file correctly configures the volume mount. Any misconfiguration or typo could lead to the application not being able to access the intended storage directory.

  3. Reset Encryption Keys: If there's a possibility that the api/storage/privkeys file is missing or corrupted (which might happen if deployment methods were switched or the file was deleted), you can reset the encryption keys using the command: docker exec -it docker-api-1 flask reset-encrypt-key-pair. This step is relevant for Docker Compose deployments and is necessary for the encryption of large model keys.

By following these steps, you should be able to identify and correct the issue causing the FileNotFoundError. If the problem persists, providing additional details about your configuration and any changes made prior to encountering this error could help in further diagnosing the issue.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@dosubot dosubot bot added the 🐞 bug Something isn't working label May 20, 2024
@JohnJyong
Copy link
Contributor

seems your api service and worker service have different storage setting , pls check the variable STORAGE_TYPE @kokojacket

@kokojacket
Copy link
Author

Thank you very much, it is indeed my deployment that has a problem. __

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants