# Deep Analysis not being done

**URL:** <https://forums.plex.tv/t/deep-analysis-not-being-done/719479>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [May 31, 2021, 6:24am UTC](https://forums.plex.tv/t/deep-analysis-not-being-done/719479 "2021-05-31T06:24:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [May 31, 2021, 6:24am UTC](https://forums.plex.tv/t/deep-analysis-not-being-done/719479/1 "2021-05-31T06:24:11Z")

</div>

Server Version#: 1.23.2.4584

Hi all,

On my Linux Server many files have not had a Deep Analysis performed on them and I’m wondering why this is the case. I’ve used the following SQL to count the items missing a Deep Analysis

```auto
select count(*) from metadata_items meta 
                        join media_items media on media.metadata_item_id = meta.id 
                        join media_parts part on part.media_item_id = media.id 
                        where part.extra_data not like '%deepAnalysisVersion=2%' 
                        and meta.metadata_type in (1, 4, 12) and part.file != ''

```

It found 988 items that did not have a Deep Analysis.

If I add a new Movie or TV Show and check the XML data a couple of days later no Deep Analysis information is found.

Scheduled Tasks is setup as follows:

![](https://i.imgur.com/6oAe1Nb.jpg)

Two questions:

1. Any suggestions why Deep Analysis is not running?
2. Is there a way to force a Deep Analysis on a file?

TIA

Greg

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [May 31, 2021, 7:56am UTC](https://forums.plex.tv/t/deep-analysis-not-being-done/719479/2 "2021-05-31T07:56:55Z")

</div>

> [@gregeeh](#):
>
> It found 988 items that did not have a Deep Analysis.

Have you verified what media type these items have? Deep analysis might be not sensible with e.g. photos or audio tracks.

> [@gregeeh](#):
>
> Is there a way to force a Deep Analysis on a file?

I know a way using the command line:  
`"Plex Media Scanner" --analyze-deeply --item metadataItemIdHere`  
where `metadataItemIdHere` must be replaced by the number which appears as `ratingKey="..."` in the item’s [Plex XML info](https://support.plex.tv/hc/en-us/articles/201998867-Investigate-Media-Information-and-Formats "Plex XML info").  
However, this must be done as the user account, under which your plex server is running.

There might be other prerequisites which must be set, like environment variables. Unfortunately I don’t know which ones, since I am no Linux expert.  
Maybe @ChuckPa can shed a light on that?

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [May 31, 2021, 8:33am UTC](https://forums.plex.tv/t/deep-analysis-not-being-done/719479/3 "2021-05-31T08:33:00Z")

</div>

> [@OttoKerner](#):
>
> Have you verified what media type these items have?

Yes, Photos, Music, TV shows & Movies. I’m really only concerned as to why the TV Shows and Movies are not receiving a Deep Analysis.

---

<div class="post-metadata">

**Author:** ![anon5074910](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@anon5074910](https://forums.plex.tv/u/anon5074910)\
**Post date:** [May 31, 2021, 9:11am UTC](https://forums.plex.tv/t/deep-analysis-not-being-done/719479/5 "2021-05-31T09:11:30Z")

</div>

For what its worth I checked my logs from last night on my linux server and I can see deep analysis ran for the additional content I added within the last 24 hours.

```auto
xxxx@xxxx:/data/Personal/Scripts$ grep -a "deep analysis on" /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Media\ Server*.log
/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/Plex Media Server.1.log:May 31, 2021 03:04:00.120 [0x7fcbfc9b6b38] DEBUG - The butler performed deep analysis on 27 files

```

---

<div class="post-metadata">

**Author:** ![gregeeh](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gregeeh/32/197984_2.png) [@gregeeh](https://forums.plex.tv/u/gregeeh)\
**Post date:** [May 31, 2021, 9:29pm UTC](https://forums.plex.tv/t/deep-analysis-not-being-done/719479/6 "2021-05-31T21:29:23Z")

</div>

Thanks for your answer. I ran this command and it shows files were Deep Analysed last night. However looking at some Moives and TV Shows XML Data Info shows no sign of a Deep Analysis being performed. I’m looking for deepAnalysisVersion=“4”

---

<div class="post-metadata">

**Author:** ![FordGuy61](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@FordGuy61](https://forums.plex.tv/u/FordGuy61)\
**Post date:** [May 31, 2021, 9:52pm UTC](https://forums.plex.tv/t/deep-analysis-not-being-done/719479/7 "2021-05-31T21:52:59Z")

</div>

Here’s some additional information regarding the Plex Media Scanner options.

FWIW, I tried running this on my Synology, but never got it working. Pretty much anything other than “–help” resulted in the process crashing. Guessing there’s some additional paths, etc that must be set, in addition to what is mentioned in the document.

[Plex Media Scanner via Command Line](https://support.plex.tv/articles/201242707-plex-media-scanner-via-command-line/)

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [May 31, 2021, 10:28pm UTC](https://forums.plex.tv/t/deep-analysis-not-being-done/719479/8 "2021-05-31T22:28:05Z")

</div>

How long does the butler (Scheduled Tasks) run for?

One major factor here is the amount of time for deep analysis to run after everything else is done.

Also, please remember, if you have a large library then it’s going to take multiple sessions to get everything done (it reads every file completely)

---

<div class="post-metadata">

**Author:** ![pshanew](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/pshanew/32/160555_2.png) [@pshanew](https://forums.plex.tv/u/pshanew)\
**Post date:** [May 31, 2021, 11:19pm UTC](https://forums.plex.tv/t/deep-analysis-not-being-done/719479/9 "2021-05-31T23:19:14Z")

</div>

Manually running Plex Media Scanner on Linux requires the PLEX\_MEDIA\_SERVER\_APPLICATION\_SUPPORT\_DIR environment variable to be set (at least in my experience). By default on Linux (using the native package) it should be set to “/var/lib/plexmediaserver/Library/Application Support.” Something like the following should work:

`PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support" /usr/lib/plexmediaserver/Plex Media Scanner --analyze-deeply --force --item item_id`

You can try running without `--force`, but in my experience the scanner will return immediately without performing analysis if not included.

---

<div class="post-metadata">

**Author:** ![anon5074910](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@anon5074910](https://forums.plex.tv/u/anon5074910)\
**Post date:** [June 1, 2021, 8:46am UTC](https://forums.plex.tv/t/deep-analysis-not-being-done/719479/10 "2021-06-01T08:46:02Z")

</div>

> [@gregeeh](#):
>
> Thanks for your answer. I ran this command and it shows files were Deep Analysed last night. However looking at some Moives and TV Shows XML Data Info shows no sign of a Deep Analysis being performed. I’m looking for deepAnalysisVersion=“4”

I normally don’t check the xml itself as I typically trust the logs but checking a file I added yesterday I can see this morning **deepAnalysisVersion=“4”** was added to the xml so at least for me on my linux plex server it appears to be working correctly.

---

<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:** [August 30, 2021, 8:46am UTC](https://forums.plex.tv/t/deep-analysis-not-being-done/719479/11 "2021-08-30T08:46:42Z")

</div>

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