# Mediaserver gets stuck during mediascan

**URL:** <https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [February 2, 2022, 4:52pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302 "2022-02-02T16:52:16Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![HolliPlex](https://avatars.discourse-cdn.com/v4/letter/h/76d3ee/32.png) [@HolliPlex](https://forums.plex.tv/u/HolliPlex)\
**Post date:** [February 2, 2022, 4:52pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302/1 "2022-02-02T16:52:17Z")

</div>

Server Version#: Version 1.25.4.5487 on Debian 10  
Player Version#: PlexApp for Windows Version 1.40.1.2823-6f60f3a7

The server is configured to automatically start scanning when files are added to the music-/audiobook-share.

The medialibrary is configured as follows:

```auto
Scanner 
Plex Music Scanner
Agent 
Personal Media Artists
Sichtbarkeit 
In der Startseite und Globaler Suche
Schränke ein, wo Inhalte dieser Mediathek erscheinen sollen.

Albumreihenfolge 
Nach Name
Reihenfolge der Alben eines Interpreten

 Sonic Analysis
Analyze tracks for sonic features.

 Bevorzuge lokale Metadaten
Beim Durchsuchen dieser Mediathek eingebettete Metatags und lokale Dateien bevorzugen (wenn vorhanden).

 Abspielposition speichern
Remember and resume from your previous listening position. Useful for libraries with long-form audio content.

 Inhalte aus geteilten Mediatheken einschließen
Zeige passende Empfehlungen und zusätzliche Alben aus fremden, mit dir geteilten Mediatheken. Ergänze „Artist-Radio“ mit geteilten Titeln.

 Künstlerbiographien
Lade Künstler-Biographien aus der Cloud.

 Albumsrezensionen und Kritikerbewertungen
Lade Albumsrezensionen und Bewertungen durch Kritiker aus der Cloud.

 Populäre Titel
Lade Daten zu allgemein populären Titel, die in „Radios“ und auf den Künstler-Seiten benutzt werden.

 Konzerte
Lade Konzerttermine von Künstlern.

Genres 
Eingebettete Metatags
Quelle für die Genre-Tags von Künstlern und Alben

Albumcover 
Nur lokale Dateien
Quelle für automatische Albumcover

```

When files are added, the server starts scanning and the spinner on the upper right of the PlayerApp doesn’t stop. When I click on it, it says “Scanning Hörbücher” and it does this for hours. Restarting the PlayerApp doesn’t fix it.

This issue arose since the last two server-updates.

[Plex Media Server Logs\_2022-02-02\_16-48-48.zip](https://forums.plex.tv/uploads/short-url/sR9oKTLwXeEGFHjVJepHubJbmyk.zip) (6.7 MB)

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [February 2, 2022, 9:31pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302/2 "2022-02-02T21:31:52Z")

</div>

According to your log, it did finish?

```auto
Feb 02, 2022 00:28:27.386 [0x7f81de33eb38] DEBUG - Activity: updated activity 08918e13-73e3-46d5-ac6f-e9ff07bb583e - completed 100.0% - Scanning Hörbücher
Feb 02, 2022 00:28:27.386 [0x7f81de33eb38] DEBUG - Activity: Ended activity 08918e13-73e3-46d5-ac6f-e9ff07bb583e.
Feb 02, 2022 00:28:27.387 [0x7f81e08c7b38] DEBUG - Completed: [127.0.0.1:46404] 200 PUT /activities/08918e13-73e3-46d5-ac6f-e9ff07bb583e?percentComplete=100 (10 live) GZIP 1ms 195 bytes (pipelined: 2883)
Feb 02, 2022 00:28:27.466 [0x7f81e23e4b38] DEBUG - Jobs: '/usr/lib/plexmediaserver/Plex Media Scanner' exit code for process 28573 is 0 (success)

```

So are you using the bundled WebClient, or [https://app.plex.tv/desktop/#!/](https://app.plex.tv/desktop/#!/)

---

<div class="post-metadata">

**Author:** ![HolliPlex](https://avatars.discourse-cdn.com/v4/letter/h/76d3ee/32.png) [@HolliPlex](https://forums.plex.tv/u/HolliPlex)\
**Post date:** [February 2, 2022, 10:00pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302/3 "2022-02-02T22:00:51Z")

</div>

No. It didn’t. I cancelled the library-scan, then the albums i added in the meantime appeared in the “Recently Added” list. After one or two albums, it got stuck again. So I cancelled the scan and the next albums appeard.

Meanwhile I found out, that this issue doesn’t occur when adding TV-Shows or Movies.

I also have another server running in an LXC-container based on ArchLinux. It has Version 1.25.5.5492. Surprisingly this is running without issues so far.

For testing I removed a set of audiobooks from the media directory. I’ll let the server run over night and if there’s no change, I’ll gather another set of logs and upload them for you.

BTW I’m running the “Plex for Windows”-App Version 1.40.1.2823-6f60f3a7. It updated itself yesterday to this version. The OS is Windows 11.

I just tried opening the internal webserver with [https://192.168.188.26:32400/web/index.html#!/](https://192.168.188.26:32400/web/index.html#!/) while the scanning process is running. The local server “Plexhome” (which has the issues) didn’t respond and I was transferred to the one in the LXC-container. The local one doesn’t show up in the server list. I can’t reach the local server from the outside because of a double-NAT on the LTE-Network I have to use. The LXC is running on a rootserver in a datacenter.

---

<div class="post-metadata">

**Author:** ![HolliPlex](https://avatars.discourse-cdn.com/v4/letter/h/76d3ee/32.png) [@HolliPlex](https://forums.plex.tv/u/HolliPlex)\
**Post date:** [February 2, 2022, 10:13pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302/4 "2022-02-02T22:13:39Z")

</div>

I logged into the Debian 10 host where “Plexhome” is running on, to check there:

```auto
root@debnas.fritz.box:/usr/lib/plexmediaserver# systemctl status plexmediaserver.service
● plexmediaserver.service - Plex Media Server
   Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2022-02-01 11:19:28 CET; 1 day 11h ago
  Process: 28986 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" (code=exited, status=0/SUCCESS)
 Main PID: 28988 (PMS RunServer)
    Tasks: 117 (limit: 4915)
   Memory: 2.7G
   CGroup: /system.slice/plexmediaserver.service
           ├─ 363 /usr/lib/plexmediaserver/Plex Media Scanner --analyze-loudness --section 13 --log-file-suffix Deep Analysis
           ├─ 7354 /usr/lib/plexmediaserver/Plex Media Scanner --scan --refresh --section 13 --activity 8a07921a-3086-4f53-a779-fe178a539afb --directory /zfstoshiba/audiobook/Dorian Hunter/Folge 04- Das Wachsf
           ├─28988 /usr/lib/plexmediaserver/Plex Media Server
           ├─29072 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-648a8f9f9/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.4.5487-648a8f
           ├─29129 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.25.4.5487-648a8f9f9 32600
           ├─29239 Plex Plug-in [tv.plex.agents.movie] /usr/lib/plexmediaserver/Resources/Plug-ins-648a8f9f9/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.4.5487-648a
           ├─29386 Plex Plug-in [tv.plex.agents.music] /usr/lib/plexmediaserver/Resources/Plug-ins-648a8f9f9/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.4.5487-648a
           ├─29388 Plex Plug-in [tv.plex.agents.series] /usr/lib/plexmediaserver/Resources/Plug-ins-648a8f9f9/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.4.5487-648
           ├─30411 Plex Plug-in [com.plexapp.agents.none] /usr/lib/plexmediaserver/Resources/Plug-ins-648a8f9f9/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.4.5487-6
           └─30786 Plex Plug-in [com.plexapp.agents.localmedia] /usr/lib/plexmediaserver/Resources/Plug-ins-648a8f9f9/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.4.

Feb 02 20:50:51 debnas Plex Media Server[28988]: Unable to open: No such file or directory (2)
Feb 02 20:52:21 debnas Plex Media Server[28988]: Unable to open: No such file or directory (2)
Feb 02 20:53:52 debnas Plex Media Server[28988]: Unable to open: No such file or directory (2)
Feb 02 20:55:51 debnas Plex Media Server[28988]: Unable to open: No such file or directory (2)
Feb 02 20:55:51 debnas Plex Media Server[28988]: Unable to open: No such file or directory (2)
Feb 02 20:55:54 debnas Plex Media Server[28988]: Unable to open: No such file or directory (2)
Feb 02 20:55:54 debnas Plex Media Server[28988]: Unable to open: No such file or directory (2)
Feb 02 20:56:32 debnas Plex Media Server[28988]: Unable to open: No such file or directory (2)
Feb 02 20:56:32 debnas Plex Media Server[28988]: Unable to open: No such file or directory (2)
Feb 02 20:56:37 debnas Plex Media Server[28988]: Unable to open: No such file or directory (2)

```

```auto
root@debnas.fritz.box:/usr/lib/plexmediaserver# ls -aliF
insgesamt 33928
5250534 drwxr-xr-x 5 root root 4096 Feb 1 11:19 ./
4718596 drwxr-xr-x 79 root root 4096 Nov 10 15:07 ../
5244013 -rwxr-xr-x 1 root root 1185848 Jan 31 21:29 CrashUploader*
5639209 drwxr-xr-x 2 root root 4096 Feb 1 11:19 etc/
5505588 drwxr-xr-x 3 root root 12288 Feb 1 11:19 lib/
5251992 -rwxr-xr-x 1 root root 270928 Jan 31 20:59 'Plex Commercial Skipper'*
5251990 -rwxr-xr-x 1 root root 3103104 Jan 31 21:26 'Plex DLNA Server'*
5244012 -rwxr-xr-x 1 root root 114000 Jan 31 20:59 'Plex Media Fingerprinter'*
5251993 -rwxr-xr-x 1 root root 4411912 Jan 31 21:30 'Plex Media Scanner'*
5251991 -rwxr-xr-x 1 root root 18774392 Jan 31 21:35 'Plex Media Server'*
5251994 -rwxr-xr-x 1 root root 3408864 Jan 31 20:59 'Plex Relay'*
5251995 -rwxr-xr-x 1 root root 10704 Jan 31 20:59 'Plex Script Host'*
5251989 -rwxr-xr-x 1 root root 10696 Jan 31 20:59 'Plex SQLite'*
5249093 -rwxr-xr-x 1 root root 320704 Jan 31 20:59 'Plex Transcoder'*
5249092 -rwxr-xr-x 1 root root 3071768 Jan 31 20:59 'Plex Tuner Service'*
5250541 drwxr-xr-x 10 root root 12288 Feb 1 11:19 Resources/

```

I gathered the logs while it’s stuck in the scanning-procedure. 5 audiobooks were added. Meanwhile about 10 or 15 were uploaded into the mediadirectory.  
[Plex Media Server Logs\_2022-02-02\_16-48-48.zip](https://forums.plex.tv/uploads/short-url/sR9oKTLwXeEGFHjVJepHubJbmyk.zip) (6.7 MB)

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [February 2, 2022, 10:36pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302/5 "2022-02-02T22:36:15Z")

</div>

> [@HolliPlex](#):
>
> 5 audiobooks were added. Meanwhile about 10 or 15 were uploaded into the mediadirectory.

Could you try and keep that as a minimum (Like only one), as well as provide some names here so we know what to search for?

Please reproduce with above recommendation, and upload a new set of logs

---

<div class="post-metadata">

**Author:** ![HolliPlex](https://avatars.discourse-cdn.com/v4/letter/h/76d3ee/32.png) [@HolliPlex](https://forums.plex.tv/u/HolliPlex)\
**Post date:** [February 3, 2022, 1:30pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302/6 "2022-02-03T13:30:43Z")

</div>

First I restarted the hostmachine. Then I prepared some testsets named Test1 to 5 and copied them separately. All went fine. Then I removed them, cleaned the packages, optimized the database and emptied the recycle bin.

So I created another testset named Test10 to Test 20. I prepared the folders on the local hdd containing 59 files each. all mp3-tag adjusted to the foldername, i.e. Test10-Audiobook, Test10-Artist, Test10-Track .

I copied Test10 and Test 11 separately, after each scanning-job had finished → no issues  
Test12 and Test 13 I copied in one go → no issues  
Test 14, 15 and 16 also in one go → no issues  
Then 17 to 20 in one go → 17 and 18 appeared in the recently added list, then the server got stuck. 19 and 20 didn’t appear. Windows copied the directories in ascending order.

I’ll include the logfiles collected a few minutes later.

[Plex Media Server Logs\_2022-02-03\_13-13-34.zip](https://forums.plex.tv/uploads/short-url/3yu8YxyM38HitvTgUujZiUdA2xN.zip) (7.1 MB)

Then I cancelled the libraryscan. 19 and 20 appeared on the list. The spinner didn’t stop, still showing scanning in progress. Collected another set of logfiles.

[Plex Media Server Logs\_2022-02-03\_14-25-11.zip](https://forums.plex.tv/uploads/short-url/6LWKVmUyWSJJMxFendIT0nTpzKi.zip) (7.4 MB)

Cancelled again. Now spinner stopped. Gathered a new set of logfiles.  
[Plex Media Server Logs\_2022-02-03\_14-28-25.zip](https://forums.plex.tv/uploads/short-url/6Pp1vhODq6cG7Ul1GhPcKVXPsL9.zip) (7.4 MB)

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [February 3, 2022, 1:49pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302/7 "2022-02-03T13:49:14Z")

</div>

Thanks for the logs and the very detailed explanation

Sadly, I suspect a `space for improvement` in the code, and looks like it’s siml. to this:

> [@Library updater does not manually update library media](https://forums.plex.tv/t/library-updater-does-not-manually-update-library-media/772681):
>
> Server Version#: 1.25.4.5426 Player Version#: n/a Since a couple of days, I have problems wth updating libraries. After a fresh server restart, automatic library updating (scanning for new or deleted media in my libraries) works. But rather sooner than later, that behaviour stops and it seems that the library scan HANGS… I cannot scan for new media any longer. The console output when trying to manually scan the same library is: Jan 24, 2022 18:15:06.309 [0x7fcd95c2ab38] Fehlersuche — Library…

An internal issue has been raised

---

<div class="post-metadata">

**Author:** ![HolliPlex](https://avatars.discourse-cdn.com/v4/letter/h/76d3ee/32.png) [@HolliPlex](https://forums.plex.tv/u/HolliPlex)\
**Post date:** [February 3, 2022, 2:45pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302/10 "2022-02-03T14:45:34Z")

</div>

Thanks dane22 for helping.

If it might be of interest, since the plex-server-version on the ArchLinux AUR-Package is newer than the one for Debian.

On the latter I use the following repository:

```auto
root@debnas.fritz.box:/etc/apt/sources.list.d# cat plexmediaserver.list
# When enabling this repo please remember to add the PlexPublic.Key into the apt setup.
# wget -q https://downloads.plex.tv/plex-keys/PlexSign.key -O - | sudo apt-key add -
deb https://downloads.plex.tv/repo/deb/ public main

```

Debian 10: Version 1.25.4.5487  
Arch-AUR: Version 1.25.5.5492

On Debian I just did an “apt update”, but no newer version was shown.  
The AUR-repository also is up-to-date.

---

<div class="post-metadata">

**Author:** ![stewanstar](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@stewanstar](https://forums.plex.tv/u/stewanstar)\
**Post date:** [February 3, 2022, 3:25pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302/11 "2022-02-03T15:25:46Z")

</div>

Hi,

I’ve seen the same (or very similar) issue since 1-2 weeks.

Scanner gets stuck on some seemingly random file. At least the Activity spinner says “Scanning : Filename” Settings\>Libraries also shows a spinner. However, i’ll tailed all the log files and there is 0 scanning activities are happening. The problem is this blocks all new scans (manually starting one, or triggered other software), so all new files wont show up till i restart plex and start a library scan. A few hours later , the scaner is stuck again.

Plex Media Server v1.25.5.5492-12f6b8c83  
Linux version: 5.12.8-051208-generic

I’m using the docker plexinc/pms-docker:plexpass (tried beta and public). :latest from 2 weeks ago seemed to not have the issue.

---

<div class="post-metadata">

**Author:** ![vinezerjav](https://avatars.discourse-cdn.com/v4/letter/v/f08c70/32.png) [@vinezerjav](https://forums.plex.tv/u/vinezerjav)\
**Post date:** [February 15, 2022, 1:15pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302/12 "2022-02-15T13:15:23Z")

</div>

Hi,  
same problem here since last two updates. On my synology server scanning always freeze at Music\_videos folder and than does not scan movies or tv shows.  
Is there a way to disable specific root folder scanning (ie. my Music\_videos) ?

installed version: 1.25.5.5492-6000  
DS920+  
DSM 6.2.3-25426 Update 2

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [May 16, 2022, 1:15pm UTC](https://forums.plex.tv/t/mediaserver-gets-stuck-during-mediascan/774302/13 "2022-05-16T13:15:36Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
