LibreTranslate icon indicating copy to clipboard operation
LibreTranslate copied to clipboard

Error when translating docx-document

Open thomas-mc-work opened this issue 2 years ago • 1 comments

I'm trying to translate a docx-file. The service is starting properly and taking quite some time. After it has finished, it's not possible to download the resulting file. This is the error message from the log file:

ERROR:app.app:Exception on /download_file/11853969-3609-4f13-882f-2f3d91fff760.IKI_Project_proposal_2018-2024_en.docx [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/app/app.py", line 693, in download_file
    with open(filepath, 'rb') as fo:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/libretranslate-files-translate/11853969-3609-4f13-882f-2f3d91fff760.IKI_Project_proposal_2018-2024_en.docx'

I'm using the latest dockerized version, hosted on an up-to-date Debian 11:

https://hub.docker.com/layers/libretranslate/libretranslate/libretranslate/v1.2.9/images/sha256-caa89b2b29d09747a43bd7eb309282a1605970fd91cbda4d509c247c177d5016?context=explore

Here is the regarding file:

IKI_Project_proposal_2018-2024.docx

thomas-mc-work avatar Jun 14 '22 11:06 thomas-mc-work

Has the file been translated correctly? could you look in /tmp? I think the translation crashed because the file contains a lot of text.

dingedi avatar Jul 31 '22 19:07 dingedi

The size of the docx file is 80 KB, and it consists of 29 pages. All text blocks are within a huge table.

I just retried the process three times, and now it's working as expected. Thus I'll close this issue until I encounter it again.

thomas-mc-work avatar Aug 29 '22 12:08 thomas-mc-work