[Bug]: Docker sometimes die while scanning #1111

Closed
opened 2026-04-24 23:33:06 +02:00 by adam · 4 comments
Owner

Originally created by @szemlicka on GitHub (Apr 28, 2023).

Describe the issue

Unraid Docker container
audiobooks at a remote share.
metadata.abs at remote share
Error log shows me:

`[2023-04-28 11:35:30] ERROR: [absMetaFileGenerator] Failed to save abs file [Error: EACCES: permission denied, open '/audiobooks/Brian Herbert;Kevin J. Anderson/Der Wüstenplanet/01 - Der Herzog von Caladan/metadata.abs'] {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/audiobooks/Brian Herbert;Kevin J. Anderson/Der Wüstenplanet/01 - Der Herzog von Caladan/metadata.abs'
} (abmetadataGenerator.js:170)
[2023-04-28 11:35:30] ERROR: [LibraryItem] Failed saving abmetadata to "/audiobooks/Brian Herbert;Kevin J. Anderson/Der Wüstenplanet/01 - Der Herzog von Caladan/metadata.abs" (LibraryItem.js:506)
/server/libs/njodb/index.js:103
throw error;
^

RangeError: Invalid string length
at JSON.stringify ()
at Encoder.encodeAsString (/node_modules/socket.io-parser/build/cjs/index.js:78:25)
at Encoder.encode (/node_modules/socket.io-parser/build/cjs/index.js:54:22)
at Client._packet (/node_modules/socket.io/dist/client.js:159:28)
at Socket.packet (/node_modules/socket.io/dist/socket.js:279:21)
at Socket.emit (/node_modules/socket.io/dist/socket.js:156:14)
at SocketAuthority.emitter (/server/SocketAuthority.js:41:39)
at Scanner.updateLibraryItemChunk (/server/scanner/Scanner.js:307:21)
at async Scanner.scanLibrary (/server/scanner/Scanner.js:290:7)
at async Scanner.scan (/server/scanner/Scanner.js:144:20)
Config /config /metadata`

The error happens sometimes. The file/folder have 777. I switch now to save metadata.abs at normal /metadata/items. That runs better.

Steps to reproduce the issue

  1. configure OPF file to save into audiobook folder
  2. scan library (huge one)

Audiobookshelf version

2.2.19

How are you running audiobookshelf?

Docker

Originally created by @szemlicka on GitHub (Apr 28, 2023). ### Describe the issue Unraid Docker container audiobooks at a remote share. metadata.abs at remote share Error log shows me: `[2023-04-28 11:35:30] ERROR: [absMetaFileGenerator] Failed to save abs file [Error: EACCES: permission denied, open '/audiobooks/Brian Herbert;Kevin J. Anderson/Der Wüstenplanet/01 - Der Herzog von Caladan/metadata.abs'] { errno: -13, code: 'EACCES', syscall: 'open', path: '/audiobooks/Brian Herbert;Kevin J. Anderson/Der Wüstenplanet/01 - Der Herzog von Caladan/metadata.abs' } (abmetadataGenerator.js:170) [2023-04-28 11:35:30] ERROR: [LibraryItem] Failed saving abmetadata to "/audiobooks/Brian Herbert;Kevin J. Anderson/Der Wüstenplanet/01 - Der Herzog von Caladan/metadata.abs" (LibraryItem.js:506) /server/libs/njodb/index.js:103 throw error; ^ RangeError: Invalid string length at JSON.stringify (<anonymous>) at Encoder.encodeAsString (/node_modules/socket.io-parser/build/cjs/index.js:78:25) at Encoder.encode (/node_modules/socket.io-parser/build/cjs/index.js:54:22) at Client._packet (/node_modules/socket.io/dist/client.js:159:28) at Socket.packet (/node_modules/socket.io/dist/socket.js:279:21) at Socket.emit (/node_modules/socket.io/dist/socket.js:156:14) at SocketAuthority.emitter (/server/SocketAuthority.js:41:39) at Scanner.updateLibraryItemChunk (/server/scanner/Scanner.js:307:21) at async Scanner.scanLibrary (/server/scanner/Scanner.js:290:7) at async Scanner.scan (/server/scanner/Scanner.js:144:20) Config /config /metadata` The error happens sometimes. The file/folder have 777. I switch now to save metadata.abs at normal /metadata/items. That runs better. ### Steps to reproduce the issue 1. configure OPF file to save into audiobook folder 2. scan library (huge one) ### Audiobookshelf version 2.2.19 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:33:06 +02:00
adam closed this issue 2026-04-24 23:33:08 +02:00
Author
Owner

@advplyr commented on GitHub (Apr 28, 2023):

This is a permissions issue on your end. Not much we can do about this.

Do not use the AUDIOBOOKSHELF_UID and AUDIOBOOKSHELF_GID anymore

@advplyr commented on GitHub (Apr 28, 2023): This is a permissions issue on your end. Not much we can do about this. Do not use the `AUDIOBOOKSHELF_UID` and `AUDIOBOOKSHELF_GID` anymore
Author
Owner

@szemlicka commented on GitHub (Apr 29, 2023):

I am sure that this is not an permission issue. I checked the complete path and its always 777. And the error is only sometimes. And when it happens, its never at the same directory.
I am not using AUDIOBOOKSHELF_UID and AUDIOBOOKSHELF_GID in my docker.

@szemlicka commented on GitHub (Apr 29, 2023): I am sure that this is not an permission issue. I checked the complete path and its always 777. And the error is only sometimes. And when it happens, its never at the same directory. I am not using AUDIOBOOKSHELF_UID and AUDIOBOOKSHELF_GID in my docker.
Author
Owner

@advplyr commented on GitHub (Apr 29, 2023):

When you start the server again will it save the metadata.abs file for that book? That book that crashed you can edit some data in Abs then press save. Check if the metadata.abs is updated

@advplyr commented on GitHub (Apr 29, 2023): When you start the server again will it save the metadata.abs file for that book? That book that crashed you can edit some data in Abs then press save. Check if the metadata.abs is updated
Author
Owner

@szemlicka commented on GitHub (Apr 29, 2023):

That was a good point. Thanks for the hint.
The share was mounted over NFS and linked to a docker container. The rights in docker are ok (shows 777). But the original rights at the source wasn't correct. Groups and other are different like the mp3 files and also read only. That was an artifact from a previous docker installation at a different host. After a
"find ./files -name metadata.abs -exec chgrp users {} ;" and "find ./files -name metadata.abs -exec chown unraid {} ;"
fixed my problem. You can close that ticket and sorry for that.

@szemlicka commented on GitHub (Apr 29, 2023): That was a good point. Thanks for the hint. The share was mounted over NFS and linked to a docker container. The rights in docker are ok (shows 777). But the original rights at the source wasn't correct. Groups and other are different like the mp3 files and also read only. That was an artifact from a previous docker installation at a different host. After a "find ./files -name metadata.abs -exec chgrp users {} \;" and "find ./files -name metadata.abs -exec chown unraid {} \;" fixed my problem. You can close that ticket and sorry for that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1111