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

[Bug]: M4B Failed! Target directory is not writable #3685

Closed
shumancw opened this issue Dec 6, 2024 · 2 comments
Closed

[Bug]: M4B Failed! Target directory is not writable #3685

shumancw opened this issue Dec 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@shumancw
Copy link

shumancw commented Dec 6, 2024

What happened?

When I try to upload an image I get a permissions error and when I try to convert I get:
Error Message: M4B Failed! Target directory is not writable

Image upload, under these circumstances, crashes the container.

I saw a previous bug that was closed indicating that user/group audiobookshelf is used, but could not find this user inside or outside of the container.

[Unit]
Description=Self-hosted audiobook server for managing and playing audiobooks
Requires=network.target

[Service]
Type=simple
EnvironmentFile=/etc/default/audiobookshelf
WorkingDirectory=/usr/share/audiobookshelf
ExecStart=/usr/share/audiobookshelf/audiobookshelf
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
User=audiobookshelf
Group=audiobookshelf

[Install]
WantedBy=multi-user.target

What did you expect to happen?

Audiobook cover to be updated and/or files to be converted to M4B

Steps to reproduce the issue

  1. Enter edit mode in a book
  2. Select a new image as cover
  3. Select upload
  4. Save

Audiobookshelf version

v2.17.3/4

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Other (list in "Additional Notes" box)

Logs

Cover Upload:
[2024-12-05 22:16:41.926] FATAL: [Server] Unhandled rejection: ReferenceError: path is not defined
    at /server/managers/CoverManager.js:97:64
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async CoverManager.uploadCover (/server/managers/CoverManager.js:96:21)
    at async ApiRouter.uploadCover (/server/controllers/LibraryItemController.js:285:16) 
promise: Promise {
  <rejected> ReferenceError: path is not defined



Convert Book to M4B:
[2024-12-05 22:18:41.302] INFO: [SocketAuthority] Socket ySqtKP1VgK0OBKs1AAAB disconnected from client "chris" after 115006ms (Reason: transport close)

[2024-12-05 22:18:42.386] INFO: [SocketAuthority] Socket Connected to /socket.io aeDlwTJcJ6KpVCWcAAAD

[2024-12-05 22:18:44.263] INFO: Start m4b encode for 98e7a4ca-2dae-42b3-8078-7870ed7e8ac8 - TaskId: 38663bf1-b37d-4611-aa5b-fd1475f6ab67

[2024-12-05 22:18:44.265] INFO: [fileUtils] Directory is not writable "/audiobooks/Jonathan Swift  - 2010 - Gulliver's Travels (Classics)" [Error: EACCES: permission denied, open '/audiobooks/Jonathan Swift  - 2010 - Gulliver's Travels (Classics)/accessTest'] {

  errno: -13,

  code: 'EACCES',

  syscall: 'open',

  path: "/audiobooks/Jonathan Swift  - 2010 - Gulliver's Travels (Classics)/accessTest"

}

[2024-12-05 22:18:44.268] ERROR: [AbMergeManager] Target directory is not writable: /audiobooks/Jonathan Swift  - 2010 - Gulliver's Travels (Classics)

[2024-12-05 22:18:44.268] INFO: [AbMergeManager] Removing task 38663bf1-b37d-4611-aa5b-fd1475f6ab67
      at /server/managers/CoverManager.js:97:64
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async CoverManager.uploadCover (/server/managers/CoverManager.js:96:21)
      at async ApiRouter.uploadCover (/server/controllers/LibraryItemController.js:285:16)

Additional Notes

Browser: Brave

Compose File:

services:
  audiobookshelf:
    image: ghcr.io/advplyr/audiobookshelf:latest
    restart: always
    ports:
      - 13378:80
    volumes:
      - /zoom/audio/Audiobooks:/audiobooks:rw
      - /zoom/audio/Podcasts:/podcasts:rw
      - /zoom/containers/audiobookshelf/config:/config:rw
      - /zoom/containers/audiobookshelf/metadata:/metadata:rw
    environment:
      - TZ=America/New_York

I run docker as user 1000:1000 and all mounts have 1000:1000 permissions.

@shumancw shumancw added the bug Something isn't working label Dec 6, 2024
@advplyr
Copy link
Owner

advplyr commented Dec 6, 2024

I fixed that server crash on upload cover. That won't fix your permission issue though which doesn't look like a bug with Abs, it looks like incorrect permissions.

If the service is running as audiobookshelf:audiobookshelf then that user:group needs to have permission

@advplyr advplyr added the awaiting release Issue is resolved and will be in the next release label Dec 6, 2024
Copy link

github-actions bot commented Dec 8, 2024

Fixed in v2.17.5.

@github-actions github-actions bot closed this as completed Dec 8, 2024
@github-actions github-actions bot removed the awaiting release Issue is resolved and will be in the next release label Dec 8, 2024
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