[Bug]: "Socket disconnected" when trying to add podcasts #1517

Closed
opened 2026-04-24 23:48:29 +02:00 by adam · 7 comments
Owner

Originally created by @n00b12345 on GitHub (Nov 8, 2023).

Describe the issue

When trying to add a new podcast, very often I get a "Socket disconnected" message (screenshot attached). This does not happen always or for any specific podcast, however. It happens randomly. Permissions are all fine since I am able to download other podcasts which have been added without errors.

Screenshot 2023-11-08 221954

Logs:

ERROR - [Utils] Failed to get ino for path /podcasts/XNC - Xbox News Cast Podcast Error: ENOENT: no such file or directory, stat '/podcasts/XNC - Xbox News Cast Podcast'

ERROR - [fileUtils] Recurse files error Error: ENOENT: no such file or directory, scandir '/podcasts/XNC - Xbox News Cast Podcast/'

ERROR - [fileUtils] Failed to getFileTimestampsWithIno Error: ENOENT: no such file or directory, stat '/podcasts/XNC - Xbox News Cast Podcast'

Steps to reproduce the issue

  1. Search for podcasts from the "Search tab"
  2. Choose the podcast and click on Submit
  3. Error is shown once the podcast is added

Audiobookshelf version

v2.5.0

How are you running audiobookshelf?

Docker

Originally created by @n00b12345 on GitHub (Nov 8, 2023). ### Describe the issue When trying to add a new podcast, very often I get a "Socket disconnected" message (screenshot attached). This does not happen always or for any specific podcast, however. It happens randomly. Permissions are all fine since I am able to download other podcasts which have been added without errors. ![Screenshot 2023-11-08 221954](https://github.com/advplyr/audiobookshelf/assets/17707852/c048d00e-01c5-45c6-91fd-a241018c1b4b) **Logs:** > ERROR - [Utils] Failed to get ino for path /podcasts/XNC - Xbox News Cast Podcast Error: ENOENT: no such file or directory, stat '/podcasts/XNC - Xbox News Cast Podcast' > ERROR - [fileUtils] Recurse files error Error: ENOENT: no such file or directory, scandir '/podcasts/XNC - Xbox News Cast Podcast/' > ERROR - [fileUtils] Failed to getFileTimestampsWithIno Error: ENOENT: no such file or directory, stat '/podcasts/XNC - Xbox News Cast Podcast' ### Steps to reproduce the issue 1. Search for podcasts from the "Search tab" 2. Choose the podcast and click on Submit 3. Error is shown once the podcast is added ### Audiobookshelf version v2.5.0 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:48:29 +02:00
adam closed this issue 2026-04-24 23:48:30 +02:00
Author
Owner

@advplyr commented on GitHub (Nov 8, 2023):

Are you sure the server isn't crashing and restarting? If it is crashing you would have to get the logs from the container when it happens

@advplyr commented on GitHub (Nov 8, 2023): Are you sure the server isn't crashing and restarting? If it is crashing you would have to get the logs from the container when it happens
Author
Owner

@n00b12345 commented on GitHub (Nov 8, 2023):

Are you sure the server isn't crashing and restarting? If it is crashing you would have to get the logs from the container when it happens

You are right. I just checked the logs and the server is crashing and restarting. Here are the logs:

[2023-11-08 16:26:59] INFO: [SocketAuthority] Socket disconnected from client "admin" after 8528ms (Reason: transport close)
[2023-11-08 16:27:04] ERROR: [Utils] Failed to get ino for path /podcasts/Kinda Funny Xcast - Xbox Podcast [Error: ENOENT: no such file or directory, stat '/podcasts/Kinda Funny Xcast - Xbox Podcast'] {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/podcasts/Kinda Funny Xcast - Xbox Podcast'
} (fileUtils.js:104)
[2023-11-08 16:27:04] ERROR: [fileUtils] Recurse files error [Error: ENOENT: no such file or directory, scandir '/podcasts/Kinda Funny Xcast - Xbox Podcast/'] {
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: '/podcasts/Kinda Funny Xcast - Xbox Podcast/'
} (fileUtils.js:168)
[2023-11-08 16:27:04] ERROR: [fileUtils] Failed to getFileTimestampsWithIno [Error: ENOENT: no such file or directory, stat '/podcasts/Kinda Funny Xcast - Xbox Podcast'] {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/podcasts/Kinda Funny Xcast - Xbox Podcast'
} (fileUtils.js:61)
Config /config /metadata
[2023-11-08 16:28:09] INFO: === Starting Server ===

@n00b12345 commented on GitHub (Nov 8, 2023): > Are you sure the server isn't crashing and restarting? If it is crashing you would have to get the logs from the container when it happens You are right. I just checked the logs and the server *is* crashing and restarting. Here are the logs: > [2023-11-08 16:26:59] INFO: [SocketAuthority] Socket <socket number> disconnected from client "admin" after 8528ms (Reason: transport close) > [2023-11-08 16:27:04] ERROR: [Utils] Failed to get ino for path /podcasts/Kinda Funny Xcast - Xbox Podcast [Error: ENOENT: no such file or directory, stat '/podcasts/Kinda Funny Xcast - Xbox Podcast'] { > errno: -2, > code: 'ENOENT', > syscall: 'stat', > path: '/podcasts/Kinda Funny Xcast - Xbox Podcast' > } (fileUtils.js:104) > [2023-11-08 16:27:04] ERROR: [fileUtils] Recurse files error [Error: ENOENT: no such file or directory, scandir '/podcasts/Kinda Funny Xcast - Xbox Podcast/'] { > errno: -2, > code: 'ENOENT', > syscall: 'scandir', > path: '/podcasts/Kinda Funny Xcast - Xbox Podcast/' > } (fileUtils.js:168) > [2023-11-08 16:27:04] ERROR: [fileUtils] Failed to getFileTimestampsWithIno [Error: ENOENT: no such file or directory, stat '/podcasts/Kinda Funny Xcast - Xbox Podcast'] { > errno: -2, > code: 'ENOENT', > syscall: 'stat', > path: '/podcasts/Kinda Funny Xcast - Xbox Podcast' > } (fileUtils.js:61) > Config /config /metadata > [2023-11-08 16:28:09] INFO: === Starting Server ===
Author
Owner

@advplyr commented on GitHub (Nov 8, 2023):

Can you share some more of the logs above that? It seems like the watcher is picking up files before the podcast has been added to the database or something like that, but I would need more of the logs to get an idea.

@advplyr commented on GitHub (Nov 8, 2023): Can you share some more of the logs above that? It seems like the watcher is picking up files before the podcast has been added to the database or something like that, but I would need more of the logs to get an idea.
Author
Owner

@n00b12345 commented on GitHub (Nov 8, 2023):

Can you share some more of the logs above that? It seems like the watcher is picking up files before the podcast has been added to the database or something like that, but I would need more of the logs to get an idea.

This is directly above the previous logs (As you can tell, I have been repeatedly trying to add and delete podcasts to find out about the issue):

[2023-11-08 16:26:50] INFO: === Starting Server ===
[2023-11-08 16:26:50] INFO: [Server] Init v2.5.0
[2023-11-08 16:26:50] INFO: [Database] Initializing db at "/config/absdatabase.sqlite"
[2023-11-08 16:26:50] INFO: [Database] Db connection was successful
[2023-11-08 16:26:50] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting
[2023-11-08 16:26:50] INFO: [BackupManager] 0 Backups Found
[2023-11-08 16:26:50] INFO: [BackupManager] Auto Backups are disabled
[2023-11-08 16:26:50] INFO: [LogManager] Init current daily log filename: 2023-11-08.txt
[2023-11-08 16:26:50] INFO: [Watcher] Initializing watcher for "Audiobooks".
[2023-11-08 16:26:50] INFO: [Watcher] Initializing watcher for "Podcasts".
[2023-11-08 16:26:50] INFO: Listening on port :80
[2023-11-08 16:26:51] INFO: [SocketAuthority] Socket Connected
[2023-11-08 16:26:51] INFO: [Watcher] "Podcasts" Ready
[2023-11-08 16:26:53] INFO: [Watcher] "Audiobooks" Ready
[2023-11-08 16:26:57] INFO: [LibraryItemController] Deleting library item from file system at "/podcasts/Kinda Funny Xcast - Xbox Podcast"
[2023-11-08 16:26:59] INFO: [SocketAuthority] Socket disconnected from client "admin" after 8528ms (Reason: transport close)

@n00b12345 commented on GitHub (Nov 8, 2023): > Can you share some more of the logs above that? It seems like the watcher is picking up files before the podcast has been added to the database or something like that, but I would need more of the logs to get an idea. This is directly above the previous logs (As you can tell, I have been repeatedly trying to add and delete podcasts to find out about the issue): > [2023-11-08 16:26:50] INFO: === Starting Server === > [2023-11-08 16:26:50] INFO: [Server] Init v2.5.0 > [2023-11-08 16:26:50] INFO: [Database] Initializing db at "/config/absdatabase.sqlite" > [2023-11-08 16:26:50] INFO: [Database] Db connection was successful > [2023-11-08 16:26:50] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting > [2023-11-08 16:26:50] INFO: [BackupManager] 0 Backups Found > [2023-11-08 16:26:50] INFO: [BackupManager] Auto Backups are disabled > [2023-11-08 16:26:50] INFO: [LogManager] Init current daily log filename: 2023-11-08.txt > [2023-11-08 16:26:50] INFO: [Watcher] Initializing watcher for "Audiobooks". > [2023-11-08 16:26:50] INFO: [Watcher] Initializing watcher for "Podcasts". > [2023-11-08 16:26:50] INFO: Listening on port :80 > [2023-11-08 16:26:51] INFO: [SocketAuthority] Socket Connected <socket number> > [2023-11-08 16:26:51] INFO: [Watcher] "Podcasts" Ready > [2023-11-08 16:26:53] INFO: [Watcher] "Audiobooks" Ready > [2023-11-08 16:26:57] INFO: [LibraryItemController] Deleting library item from file system at "/podcasts/Kinda Funny Xcast - Xbox Podcast" > [2023-11-08 16:26:59] INFO: [SocketAuthority] Socket <socket number> disconnected from client "admin" after 8528ms (Reason: transport close)
Author
Owner

@advplyr commented on GitHub (Nov 9, 2023):

Hmm this isn't giving any context to the ERROR: [Utils] Failed to get ino for path error message. Can you enable Debug logs by going to the log page in config and selecting it in the dropdown? That will help if you are able to get this to happen again.

@advplyr commented on GitHub (Nov 9, 2023): Hmm this isn't giving any context to the `ERROR: [Utils] Failed to get ino for path` error message. Can you enable Debug logs by going to the log page in config and selecting it in the dropdown? That will help if you are able to get this to happen again.
Author
Owner

@n00b12345 commented on GitHub (Nov 10, 2023):

Hmm this isn't giving any context to the ERROR: [Utils] Failed to get ino for path error message. Can you enable Debug logs by going to the log page in config and selecting it in the dropdown? That will help if you are able to get this to happen again.

I added another podcast and yes, it happened again. This is from the Debug logs (sorry about the formatting, I copy and pasted it):


023-11-10 08:38:33

DEBUG

[iTunes] Podcast search for "xbox" returned 50 results

2023-11-10 08:38:35

DEBUG

[podcastUtils] getPodcastFeed for "https://feeds.megaphone.fm/definingduke"

2023-11-10 08:38:38

DEBUG

[podcastUtils] getPodcastFeed for "https://feeds.megaphone.fm/definingduke" success - parsing xml

2023-11-10 08:38:42

DEBUG

[fileUtils] Downloading file to /podcasts/Defining Duke - An Xbox Podcast/cover

2023-11-10 08:38:43

INFO

[CoverManager] Downloaded libraryItem cover "/podcasts/Defining Duke - An Xbox Podcast/cover.jpg" from url "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/f6/6f/1a/f66f1a65-7580-f337-33ba-b2b2ba2edb29/mza_6607840617277299195.png/600x600bb.jpg" for "Defining Duke: An Xbox Podcast"

2023-11-10 08:38:43

DEBUG

[LibraryItem] Success saving abmetadata to "/metadata/items/d854caf5-1017-4bce-8d5f-99a25bba970f/metadata.json"

2023-11-10 08:38:43

INFO

[CronManager] Added podcast "Defining Duke: An Xbox Podcast" to auto dl episode cron "0 * * * *"

2023-11-10 08:38:43

DEBUG

[FfmpegHelpers] Resize Image Cmd: ffmpeg -i /podcasts/Defining Duke - An Xbox Podcast/cover.jpg -y -vf scale=400:-1 /metadata/cache/covers/d854caf5-1017-4bce-8d5f-99a25bba970f_400.webp

2023-11-10 08:38:43

DEBUG

[Watcher] Rename /podcasts/Defining Duke - An Xbox Podcast/cover => /podcasts/Defining Duke - An Xbox Podcast/cover.jpg

2023-11-10 08:38:43

DEBUG

[Watcher] Modified file in library "Podcasts" and folder "df8ccc70-45e8-46b5-86c8-8bfb143ba6d4" with relPath "/Defining Duke - An Xbox Podcast/cover.jpg"

2023-11-10 08:38:43

DEBUG

[FfmpegHelpers] Image resized Successfully

2023-11-10 08:38:45

DEBUG

[Watcher] File Added /podcasts/Defining Duke - An Xbox Podcast/cover

2023-11-10 08:38:45

DEBUG

[Watcher] Modified file in library "Podcasts" and folder "df8ccc70-45e8-46b5-86c8-8bfb143ba6d4" with relPath "/Defining Duke - An Xbox Podcast/cover"

2023-11-10 08:38:47

DEBUG

[LogManager] Daily log file already exists - set in Logger

2023-11-10 08:38:47

DEBUG

[DailyLog] 2023-11-10: Loaded 87 Logs

2023-11-10 08:38:46

INFO

=== Starting Server ===

2023-11-10 08:38:46

INFO

[Server] Init v2.5.0

2023-11-10 08:38:46

INFO

[Database] Initializing db at "/config/absdatabase.sqlite"

2023-11-10 08:38:46

INFO

[Database] Db connection was successful

2023-11-10 08:38:47

INFO

[Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting

2023-11-10 08:38:47

DEBUG

Set Log Level to DEBUG

2023-11-10 08:38:47

INFO

[BackupManager] 0 Backups Found

2023-11-10 08:38:47

INFO

[BackupManager] Auto Backups are disabled

2023-11-10 08:38:47

DEBUG

Daily Log file found 2023-11-08.txt

2023-11-10 08:38:47

DEBUG

Daily Log file found 2023-11-09.txt

2023-11-10 08:38:47

DEBUG

Daily Log file found 2023-11-10.txt

2023-11-10 08:38:47

INFO

[LogManager] Init current daily log filename: 2023-11-10.txt

2023-11-10 08:38:47

DEBUG

[CronManager] Found 1 podcast episode schedules to start
@n00b12345 commented on GitHub (Nov 10, 2023): > Hmm this isn't giving any context to the `ERROR: [Utils] Failed to get ino for path` error message. Can you enable Debug logs by going to the log page in config and selecting it in the dropdown? That will help if you are able to get this to happen again. I added another podcast and yes, it happened again. This is from the Debug logs (sorry about the formatting, I copy and pasted it): ``` 023-11-10 08:38:33 DEBUG [iTunes] Podcast search for "xbox" returned 50 results 2023-11-10 08:38:35 DEBUG [podcastUtils] getPodcastFeed for "https://feeds.megaphone.fm/definingduke" 2023-11-10 08:38:38 DEBUG [podcastUtils] getPodcastFeed for "https://feeds.megaphone.fm/definingduke" success - parsing xml 2023-11-10 08:38:42 DEBUG [fileUtils] Downloading file to /podcasts/Defining Duke - An Xbox Podcast/cover 2023-11-10 08:38:43 INFO [CoverManager] Downloaded libraryItem cover "/podcasts/Defining Duke - An Xbox Podcast/cover.jpg" from url "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/f6/6f/1a/f66f1a65-7580-f337-33ba-b2b2ba2edb29/mza_6607840617277299195.png/600x600bb.jpg" for "Defining Duke: An Xbox Podcast" 2023-11-10 08:38:43 DEBUG [LibraryItem] Success saving abmetadata to "/metadata/items/d854caf5-1017-4bce-8d5f-99a25bba970f/metadata.json" 2023-11-10 08:38:43 INFO [CronManager] Added podcast "Defining Duke: An Xbox Podcast" to auto dl episode cron "0 * * * *" 2023-11-10 08:38:43 DEBUG [FfmpegHelpers] Resize Image Cmd: ffmpeg -i /podcasts/Defining Duke - An Xbox Podcast/cover.jpg -y -vf scale=400:-1 /metadata/cache/covers/d854caf5-1017-4bce-8d5f-99a25bba970f_400.webp 2023-11-10 08:38:43 DEBUG [Watcher] Rename /podcasts/Defining Duke - An Xbox Podcast/cover => /podcasts/Defining Duke - An Xbox Podcast/cover.jpg 2023-11-10 08:38:43 DEBUG [Watcher] Modified file in library "Podcasts" and folder "df8ccc70-45e8-46b5-86c8-8bfb143ba6d4" with relPath "/Defining Duke - An Xbox Podcast/cover.jpg" 2023-11-10 08:38:43 DEBUG [FfmpegHelpers] Image resized Successfully 2023-11-10 08:38:45 DEBUG [Watcher] File Added /podcasts/Defining Duke - An Xbox Podcast/cover 2023-11-10 08:38:45 DEBUG [Watcher] Modified file in library "Podcasts" and folder "df8ccc70-45e8-46b5-86c8-8bfb143ba6d4" with relPath "/Defining Duke - An Xbox Podcast/cover" 2023-11-10 08:38:47 DEBUG [LogManager] Daily log file already exists - set in Logger 2023-11-10 08:38:47 DEBUG [DailyLog] 2023-11-10: Loaded 87 Logs 2023-11-10 08:38:46 INFO === Starting Server === 2023-11-10 08:38:46 INFO [Server] Init v2.5.0 2023-11-10 08:38:46 INFO [Database] Initializing db at "/config/absdatabase.sqlite" 2023-11-10 08:38:46 INFO [Database] Db connection was successful 2023-11-10 08:38:47 INFO [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting 2023-11-10 08:38:47 DEBUG Set Log Level to DEBUG 2023-11-10 08:38:47 INFO [BackupManager] 0 Backups Found 2023-11-10 08:38:47 INFO [BackupManager] Auto Backups are disabled 2023-11-10 08:38:47 DEBUG Daily Log file found 2023-11-08.txt 2023-11-10 08:38:47 DEBUG Daily Log file found 2023-11-09.txt 2023-11-10 08:38:47 DEBUG Daily Log file found 2023-11-10.txt 2023-11-10 08:38:47 INFO [LogManager] Init current daily log filename: 2023-11-10.txt 2023-11-10 08:38:47 DEBUG [CronManager] Found 1 podcast episode schedules to start ```
Author
Owner

@advplyr commented on GitHub (Nov 14, 2023):

Duplicate of #2303

@advplyr commented on GitHub (Nov 14, 2023): Duplicate of #2303
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1517