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

Permission issue with Docker #167

Closed
zycker opened this issue Dec 30, 2024 · 13 comments
Closed

Permission issue with Docker #167

zycker opened this issue Dec 30, 2024 · 13 comments
Labels
docker Related to docker

Comments

@zycker
Copy link

zycker commented Dec 30, 2024

Hi,
I followed your instructions for Docker compose, I can access the GUI but when trying to convert an epub, it just show "Conversion cancelled."
No modification have been made to the docker-compose file.

Here are the log with the permission error :
`m4b-util is missing.

Installing missing packages...

WARNING: The directory '/home/user/app/models/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.

Requirement already satisfied: pip in /usr/local/lib/python3.10/site-packages (22.3.1)

Collecting pip

Downloading pip-24.3.1-py3-none-any.whl (1.8 MB)

 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/1.8 MB ? eta -:--:--
 ━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.2/1.8 MB 7.8 MB/s eta 0:00:01
 ━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━━━━━━ 0.8/1.8 MB 11.6 MB/s eta 0:00:01
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━ 1.4/1.8 MB 13.0 MB/s eta 0:00:01
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 13.9 MB/s eta 0:00:00

Collecting m4b-util

Downloading m4b_util-0.4.1-py3-none-any.whl (24 kB)

Collecting natsort~=8.2.0

Downloading natsort-8.2.0-py3-none-any.whl (37 kB)

Collecting rich~=12.6.0

Downloading rich-12.6.0-py3-none-any.whl (237 kB)

 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/237.5 kB ? eta -:--:--
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 237.5/237.5 kB 21.6 MB/s eta 0:00:00

Collecting commonmark<0.10.0,>=0.9.0

Downloading commonmark-0.9.1-py2.py3-none-any.whl (51 kB)

 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/51.1 kB ? eta -:--:--
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.1/51.1 kB 69.8 MB/s eta 0:00:00

Requirement already satisfied: pygments<3.0.0,>=2.6.0 in /usr/local/lib/python3.10/site-packages (from rich~=12.6.0->m4b-util) (2.18.0)

Installing collected packages: commonmark, rich, pip, natsort, m4b-util

Attempting uninstall: rich

Found existing installation: rich 13.9.4

Uninstalling rich-13.9.4:

  Successfully uninstalled rich-13.9.4

Attempting uninstall: pip

Found existing installation: pip 22.3.1

Uninstalling pip-22.3.1:

  Successfully uninstalled pip-22.3.1

Successfully installed commonmark-0.9.1 m4b-util-0.4.1 natsort-8.2.0 pip-24.3.1 rich-12.6.0

mkdir -p failed for path /home/user/app/models/matplotlib: [Errno 13] Permission denied: '/home/user/app/models/matplotlib'

Matplotlib created a temporary cache directory at /tmp/matplotlib-op67dq8m because there was an issue with the default path (/home/user/app/models/matplotlib); it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.

  • Running on local URL: http://0.0.0.0:7860, with SSR ⚡ (experimental, to disable set ssr=False in launch())

To create a public link, set share=True in launch().

Traceback (most recent call last):

File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 625, in process_events

response = await route_utils.call_process_api(

File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 322, in call_process_api

output = await app.get_blocks().process_api(

File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 2047, in process_api

result = await self.call_function(

File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1606, in call_function

prediction = await utils.async_iteration(iterator)

File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 714, in async_iteration

return await anext(iterator)

File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 819, in asyncgen_wrapper

response = await iterator.__anext__()

File "/home/user/app/lib/functions.py", line 1369, in change_gr_ebook_file

session['cancellation_requested'] = False

UnboundLocalError: local variable 'session' referenced before assignment

Traceback (most recent call last):

File "/home/user/app/lib/functions.py", line 149, in prepare_dirs

os.makedirs(os.path.join(models_dir,'tts'), exist_ok=True)

File "/usr/local/lib/python3.10/os.py", line 225, in makedirs

mkdir(name, mode)

PermissionError: [Errno 13] Permission denied: '/home/user/app/models/tts'

Caught DependencyError: [Errno 13] Permission denied: '/home/user/app/models/tts'

convert_ebook() Exception: [Errno 13] Permission denied: '/home/user/app/models/tts'

Traceback (most recent call last):

File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 625, in process_events

response = await route_utils.call_process_api(

File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 322, in call_process_api

output = await app.get_blocks().process_api(

File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 2047, in process_api

result = await self.call_function(

File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1606, in call_function

prediction = await utils.async_iteration(iterator)

File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 714, in async_iteration

return await anext(iterator)

File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 819, in asyncgen_wrapper

response = await iterator.__anext__()

File "/home/user/app/lib/functions.py", line 1369, in change_gr_ebook_file

session['cancellation_requested'] = False

UnboundLocalError: local variable 'session' referenced before assignment

Traceback (most recent call last):

File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 625, in process_events

response = await route_utils.call_process_api(

File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 322, in call_process_api

output = await app.get_blocks().process_api(

File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 2047, in process_api

result = await self.call_function(

File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1606, in call_function

prediction = await utils.async_iteration(iterator)

File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 714, in async_iteration

return await anext(iterator)

File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 819, in asyncgen_wrapper

response = await iterator.__anext__()

File "/home/user/app/lib/functions.py", line 1369, in change_gr_ebook_file

session['cancellation_requested'] = False

UnboundLocalError: local variable 'session' referenced before assignment`

And here are the permissions inside the folder created :
image

@DrewThomasson
Copy link
Owner

Hm I did just change the docker-compose

ima revert it and see if thats whats causing your issue

@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Dec 30, 2024

chmod 777 models, tmp, voices and audiobooks, to be sure it's accessible. If possible switch to python 3.12

@DrewThomasson
Copy link
Owner

hm

Also just updated the docker compose to comment out the newly added linked Volume

try doing a git pull and trying the docker-compose again
🤔

@janstadt
Copy link

janstadt commented Dec 30, 2024

I'd take a look at the USER instruction in the docker docs: https://www.docker.com/blog/understanding-the-docker-user-instruction/ this'll tell the container which user to run as (currently its executing as root) and combine that with an env var or a defined user in the docker-compose file.
Edit: btw, my bad for the volume mapping suggestion that borked everything up.

@DrewThomasson
Copy link
Owner

I'd take a look at the USER instruction in the docker docs: https://www.docker.com/blog/understanding-the-docker-user-instruction/ this'll tell the container which user to run as (currently its executing as root) and combine that with an env var or a defined user in the docker-compose file.

Edit: btw, my bad for the volume mapping suggestion that borked everything up.

Ur good the volume line is commented out in the compose rn anyway

@janstadt
Copy link

janstadt commented Dec 30, 2024

I think i see whats going on. It looks like you're building the image with the sh/bat file. Could you look at building the entire thing in the Dockerfile instead? Basically convert all the steps in your scripts to RUN commands in your Dockerfile, once its all built, copy the artifact to an app directory or somewhere known, delete all the other stuff, then exit with a cmd to run the app and set up a volume that you use to push all the models and file outputs? I'd take a look at this dockerfile and see if you can mimic the build portion inside the dockerfile: https://github.com/linuxserver/docker-swag/blob/master/Dockerfile

Edit: Cripes now i see you have an additional dockerfile for utils that sets the working directory to /app. Lemme look here again. Might be worthwhile to move this to a discussion.

@DrewThomasson
Copy link
Owner

DrewThomasson commented Dec 30, 2024

@janstadt

Hit me up on discord so we don't clog the issues up with our conversation lol

Or as a discussion in the GitHub and @ me

Discord

@zycker
Copy link
Author

zycker commented Dec 31, 2024

hm

Also just updated the docker compose to comment out the newly added linked Volume

try doing a git pull and trying the docker-compose again 🤔

Thank you, I did that after and got no error in the log. I'm trying a conversion right now.

@DrewThomasson
Copy link
Owner

hm

Also just updated the docker compose to comment out the newly added linked Volume

try doing a git pull and trying the docker-compose again 🤔

Thank you, I did that after and got no error in the log. I'm trying a conversion right now.

Good to know that fixed it on u 😅

@tvd1981
Copy link

tvd1981 commented Dec 31, 2024

I just cloned the repository and ran docker compose up -d. I tried converting a 50KB EPUB file, but I still encountered the issue "Conversion cancelled."

Exception:  ❗ Language vi is not supported. Supported languages are ['en', 'es', 'fr', 'de', 'it', 'pt', 'pl', 'tr', 'ru', 'nl', 'cs', 'ar', 'zh-cn', 'hu', 'ko', 'ja', 'hi']

@DrewThomasson
Copy link
Owner

DrewThomasson commented Dec 31, 2024

I just cloned the repository and ran docker compose up -d. I tried converting a 50KB EPUB file, but I still encountered the issue "Conversion cancelled."

Exception:  ❗ Language vi is not supported. Supported languages are ['en', 'es', 'fr', 'de', 'it', 'pt', 'pl', 'tr', 'ru', 'nl', 'cs', 'ar', 'zh-cn', 'hu', 'ko', 'ja', 'hi']

oh shoot i forgot to embedd the vietxtts model into it

So right now vietnamese is going to be broken for xtts

you can force it to use fairseq in the meantime by going into the
lib/lang.py

and swapping this line

language_xtts = {"eng": "en", "spa": "es", "fra": "fr", "deu": "de", "ita": "it", "por": "pt", "pol": "pl", "tur": "tr", "rus": "ru", "nld": "nl", "ces": "cs", "ara": "ar", "zho": "zh-cn", "jpn": "ja", "hun": "hu", "kor": "ko", "hin": "hi", "vie": "vi"}

for this

language_xtts = {"eng": "en", "spa": "es", "fra": "fr", "deu": "de", "ita": "it", "por": "pt", "pol": "pl", "tur": "tr", "rus": "ru", "nld": "nl", "ces": "cs", "ara": "ar", "zho": "zh-cn", "jpn": "ja", "hun": "hu", "kor": "ko", "hin": "hi"}

@DrewThomasson
Copy link
Owner

DrewThomasson commented Jan 1, 2025

@tvd1981
Here while we get an official PR in you can use this temp docker image for Vietnamese
It will make it use the fairseq model instead

For Vietnamese run this for the temp solution

docker run -it -p 7860:7860 --platform=linux/amd64 athomasson2/ebook2audiobook:viet_fairseq 

@DrewThomasson
Copy link
Owner

kk guess I'll close this...

@DrewThomasson DrewThomasson added the docker Related to docker label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Related to docker
Projects
None yet
Development

No branches or pull requests

5 participants