MycroftAI / mimic3

A fast local neural text to speech engine for Mycroft
GNU Affero General Public License v3.0
1.08k stars 103 forks source link

The docker image doesn't work #32

Closed jtabet closed 1 year ago

jtabet commented 1 year ago

Describe the bug The docker image doesn't work

To Reproduce

Result:

PermissionError: [Errno 13] Permission denied: '/home/mimic3/.local'

Expected behavior Not an error.

Log files

INFO:__main__:Starting web server
[2023-02-06 17:27:27 +0000] [1] [INFO] Running on http://0.0.0.0:59125 (CTRL + C to quit)
INFO:hypercorn.error:Running on http://0.0.0.0:59125 (CTRL + C to quit)
ERROR:mimic3_http.synthesis:Error during inference
Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share/mycroft/mimic3/voices/af_ZA/google-nwu_low'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share/mycroft/mimic3/voices/af_ZA'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share/mycroft/mimic3/voices'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share/mycroft/mimic3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share/mycroft'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mimic3/app/mimic3_http/synthesis.py", line 125, in do_synthesis_proc
    result = do_synthesis(item, mimic3)
  File "/home/mimic3/app/mimic3_http/synthesis.py", line 81, in do_synthesis
    raise e
  File "/home/mimic3/app/mimic3_http/synthesis.py", line 61, in do_synthesis
    mimic3.speak_text(params.text, text_language=params.text_language)
  File "/home/mimic3/app/mimic3_tts/tts.py", line 368, in speak_text
    voice = self._get_or_load_voice(self.voice)
  File "/home/mimic3/app/mimic3_tts/tts.py", line 569, in _get_or_load_voice
    maybe_model_dir = self._download_voice(voice_key)
  File "/home/mimic3/app/mimic3_tts/tts.py", line 621, in _download_voice
    download_voice(
  File "/home/mimic3/app/mimic3_tts/download.py", line 87, in download_voice
    voice_dir.mkdir(parents=True, exist_ok=True)
  File "/usr/lib/python3.9/pathlib.py", line 1316, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/lib/python3.9/pathlib.py", line 1316, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/lib/python3.9/pathlib.py", line 1316, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  [Previous line repeated 3 more times]
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/home/mimic3/.local'
ERROR:mimic3_http.app:[Errno 13] Permission denied: '/home/mimic3/.local'
Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share/mycroft/mimic3/voices/af_ZA/google-nwu_low'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share/mycroft/mimic3/voices/af_ZA'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share/mycroft/mimic3/voices'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share/mycroft/mimic3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share/mycroft'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mimic3/.local/share'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mimic3/app/.venv/lib/python3.9/site-packages/quart/app.py", line 1673, in full_dispatch_request
    result = await self.dispatch_request(request_context)
  File "/home/mimic3/app/.venv/lib/python3.9/site-packages/quart/app.py", line 1718, in dispatch_request
    return await self.ensure_async(handler)(**request_.view_args)
  File "/home/mimic3/app/mimic3_http/app.py", line 215, in app_tts
    wav_bytes = await text_to_wav(
  File "/home/mimic3/app/mimic3_http/app.py", line 103, in text_to_wav
    wav_bytes = await future
  File "/home/mimic3/app/mimic3_http/synthesis.py", line 125, in do_synthesis_proc
    result = do_synthesis(item, mimic3)
  File "/home/mimic3/app/mimic3_http/synthesis.py", line 81, in do_synthesis
    raise e
  File "/home/mimic3/app/mimic3_http/synthesis.py", line 61, in do_synthesis
    mimic3.speak_text(params.text, text_language=params.text_language)
  File "/home/mimic3/app/mimic3_tts/tts.py", line 368, in speak_text
    voice = self._get_or_load_voice(self.voice)
  File "/home/mimic3/app/mimic3_tts/tts.py", line 569, in _get_or_load_voice
    maybe_model_dir = self._download_voice(voice_key)
  File "/home/mimic3/app/mimic3_tts/tts.py", line 621, in _download_voice
    download_voice(
  File "/home/mimic3/app/mimic3_tts/download.py", line 87, in download_voice
    voice_dir.mkdir(parents=True, exist_ok=True)
  File "/usr/lib/python3.9/pathlib.py", line 1316, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/lib/python3.9/pathlib.py", line 1316, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/lib/python3.9/pathlib.py", line 1316, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  [Previous line repeated 3 more times]
  File "/usr/lib/python3.9/pathlib.py", line 1312, in mkdir
    self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/home/mimic3/.local'

Environment (please complete the following information):

Additional context Since the image doesn't work I tried to build my own and tweaking the Dockerfile, without success for the moment, I always end up with a missing libespeak-ng.so.1.

synesthesiam commented 1 year ago

Before running the Docker image, try mkdir -p $HOME/.local/share/mycroft/mimic3

jtabet commented 1 year ago

Thanks @synesthesiam my bad I forgot to mount the volume. It seems weird to me that it blocks execution though, I'll check if I can do something with the dockerfile to be able to run it without the volume. Would you be interested in a merge request?

synesthesiam commented 1 year ago

Sure, but I no longer work for Mycroft so they would have the final say on any merge requests.