Accidently deleted Tv directory. Nothing is visible when I re create it

I accidentally deleted my /tv directory, I lost all of my shows. That is fine.

The problem is when I try to remake the /tv directory and add files to it. The files are there and permissions are good, the movies work just fine.

I’ve tried to re-add the /tv directory and add a season in there and plex won’t pick it up. I’ve tried updating the metadata and have done several media scans on that library and still nothing.

Any help would be appreciated. Thank you.

System Information:

me@xps:/plex$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial

Please attempt to scan again
after scanning stops,

Settings - Server - Troubleshooting - Download Logs

Attach the ZIP file and we’ll see what it doesn’t like.

1 Like

Hey Chuck. Thanks. When I add a file to that directory it only says it is scanning for a split second and then stops with no results. I’ll get you the logs right now.Plex Media Server Logs_2019-07-02_17-57-55.zip (3.3 MB)

**I also have some of the plex logging to my syslog…I have a bunch of these.
Jul 2 18:00:17 xps usbmuxd[3105]: [18:00:17.115][1] config_get_device_record: failed to read ‘/var/lib/lockdown/e7f747e92df48abf2a397491be621fa7dadb437f.plist’: No such file or directory

  1. Plex doesn’t use plist files. That’s from someone on a mac.
  2. PLEASE turn VERBOSE logging back off until requested. Verbose loses more data than it provides. We only see 2 minutes versus 2-3 hours of elapsed time. The buffer is only 26 MB in size.
  3. Your modem-router doesn’t allow plex.direct domain (DNS Rebinding protection is active without the exception for plex.direct domain.) This blocks PMS from talking to the players properly.
matches target host name '192-168-1-136.15728a6d19704f33ac7ff5471efa2807.plex.direct')
Jul 02, 2019 17:39:05.417 [0x7f84537fe700] ERROR - Error issuing curl_easy_perform(handle): 51
Jul 02, 2019 17:39:05.417 [0x7f84537fe700] WARN - HTTP error requesting GET https://192-168-122-1.15728a6d19704f33ac7ff5471efa2807.plex.direct:32400 (0, No error) (SSL: no alternative certificate subject name matches target host name '192-168-122-1.15728a6d19704f33ac7ff5471efa2807.plex.direct')
Jul 02, 2019 17:39:05.417 [0x7f845b7fe700] ERROR - Error issuing curl_easy_perform(handle): 51
Jul 02, 2019 17:39:05.417 [0x7f845b7fe700] WARN - HTTP error requesting GET https://192-168-1-136.20d31ae6a07b41ffb154c5c5564be846.plex.direct:32400 (0, No error) (SSL: no alternative certificate subject name matches target host name '192-168-1-136.20d31ae6a07b41ffb154c5c5564be846.plex.direct')

I found the error.

The is locking up Plex and the kernel. It can’t delete what was open at time of delete (iNotify)

Jul 02, 2019 17:32:28.529 [0x7f7ec3fff700] ERROR - Failed to remove watch for "/plex/Media/Tv" (22)

After turning off Verbose logging (Leaving only DEBUG enabled),

  1. stop and disable plex from autostarting at boot
  2. restart the host.
  3. Start plex (don’t enable auto boot yet)
  4. Remove the Library section for your shows (delete the library section)
  5. When it finishes, Enpty Trash, Optimize Database
  6. Create fresh - adding only 1 directory which is under /plex

Let’s see what it shows.

  1. I don’t use plist files. I’m on linux. Unless, I am mistaken.
  2. Verbose logging disabled
  3. I have disabled DNS Rebinding as a security precaution. Is it necessary for Plex? I was able to watch TV and Movies fine last night. Only when I deleted the tv folder by accident did the problem start. Also, the movies still work fine and I can add and delete no problem.

**Also: I was watching my syslog and as you can see non stop lock errors. I unplugged my iphone and they stopped.

Jul  2 18:58:02 xps usbmuxd[1009]: [18:58:02.574][1] config_get_device_record: failed to read '/var/lib/lockdown/e7f747e92df48abf2a397491be621fa7dadb437f.plist': No such file or directory
Jul  2 18:58:03 xps usbmuxd[1009]: [18:58:03.574][1] config_get_device_record: failed to read '/var/lib/lockdown/e7f747e92df48abf2a397491be621fa7dadb437f.plist': No such file or directory
Jul  2 18:58:04 xps usbmuxd[1009]: [18:58:04.574][1] config_get_device_record: failed to read '/var/lib/lockdown/e7f747e92df48abf2a397491be621fa7dadb437f.plist': No such file or directory

Probably not related. Just thought I’d share.

  1. Done
  2. Done
  3. Service started (no auto boot)
  4. I’m not sure what you mean “delete the library section”. Do you mean delete the TV Shows Library from the web interface? Or are you talking about a Library directory in /plex?
    4a. I deleted the Tv show library, emptied the trash and tried to add the tv directory again. It still is showing nothing though.

I did mean for you to delete the section, not the files in the /plex directory.

Please now collect and post a fresh set of logs.

As for that plist file, its presence is very out of place and unexpected. Something to keep an eye on. It should not be there because, you’re right, we don’t have them in Linux.

Okay great. Then I proceeded accordingly.
Collecting new logs.
Plex Media Server Logs_2019-07-02_19-07-08.zip (3.1 MB)
attached.
That is strange indeed. I need to look into that. Thanks for noticing!

**I’m starting to worry it might be DB corruption. I would be surprised if that was the case as it has been running for less than 24 hours.

What you have isn’t going to work anymore.
The new scanners and metadata agent won’t accept it.

I would like you , as a demonstration & test case, to create a test area.
Next, cancel all scanning and add the TestTV section - referencing only this directory.

Copy these files

Jul 02, 2019 19:01:19.276 [0x7f6bd6c50740] DEBUG - Adding subdirectory for scanner: "/plex/Media/TV Shows/American.Dad.S14E05.HDTV.x264-KILLERS[ettv]"
Jul 02, 2019 19:01:19.276 [0x7f6bd6c50740] DEBUG - Adding subdirectory for scanner: "/plex/Media/TV Shows/American.Dad.S14E05.720p.HDTV.x264-KILLERS[rarbg]"
Jul 02, 2019 19:01:19.276 [0x7f6bd6c50740] DEBUG - Adding subdirectory for scanner: "/plex/Media/TV Shows/American.Dad.S14E02.WEBRip.x264-TBS[ettv]"

Into a directory structure which is:

/plex/test/tv/American Dad/
  Season 14/
   American Dad - S14E02.ext       <-  this is the video file
   American Dad - S14E03.ext
   American Dad - S14E04.ext
   American Dad - S14E05.ext

What’s happened is you were able to marginally get by with non-standard naming.
Now, with the changes, Naming must be compliant.

If you’re like the rest of us and have a lot of media, this is not a pleasant thought but the answer is simple. FileBot will turn this into perfect structure and naming in minutes (literally).

As for the DB corruption, I’m not happy with the Gracenote errors I’m seeing but first, I would like to address it finding your media again. Poor / non-compliant naming will always cause slow matching.

I can match up all 137 full series (11200+ episode files) and retrieve metadata over my slow internet in under an hour. When I did all that renaming, it took me about an hour with filebot (i did small chunks of 10-15 series at a time.

Damn. What do you mean? I just installed it last night lol.

Sure.

The files you asked me to copy into this new directory structure do not exist.

me@xps:/plex/Media/TV Shows$ tree
.
├── 009 - Agents.of.S.H.I.E.L.D.S01E01-07.720p.WEB-DL.x264.AAC
├── 011 - Agents.of.S.H.I.E.L.D.S01E08-15.720p.WEB-DL.x264.AAC
├── 013 - Agents.of.S.H.I.E.L.D.S01E016-22.720p.WEB-DL.x264.AAC
├── 015 - Marvels Agents of S.H.I.E.L.D. S02 WEB-DL x264-FUM[ettv]
├── 016 - Daredevil - {2015} - Season 1 - Complete - X264 - Maxillion
├── 018 - Marvels Agents of S.H.I.E.L.D. S02 WEB-DL x264-FUM[ettv]
├── American Dad S01-S11 (2005-)
│   ├── American Dad S04 (360p re-blurip)
│   ├── American Dad S05 (360p re-blurip)
│   ├── American Dad S06 (360p re-blurip)
│   ├── American Dad S07 (360p re-blurip)
│   ├── American Dad S08 (360p re-blurip)
│   ├── American Dad S09 (360p re-blurip)
│   ├── American Dad S10 (360p re-webrip)
│   └── American Dad S11 (360p re-webrip)
├── American.Dad.S13E01.HDTV.x264-FUM[ettv]
├── American.Dad.S13E02.HDTV.x264-FUM[ettv]
├── American.Dad.S13E03.WEB-DL.x264-FUM[ettv]
├── American.Dad.S13E04.HDTV.x264-FUM[ettv]
├── American.Dad.S13E05.HDTV.x264-FUM[ettv]
├── American.Dad.S13E06.HDTV.x264-FUM[ettv]
├── American.Dad.S13E07.HDTV.x264-KILLERS[ettv]
├── American.Dad.S13E09.HDTV.x264-KILLERS[ettv]
├── American.Dad.S13E10.WEB-DL.x264-FUM[ettv]

I am going to assume you still want me to add some American Dad season 14 files to test.
me@xps:/plex/test/tv/American Dad/Season 14$ ll
total 2560
drwxrwxrwx 1 me me 524288 Jul  2 19:31 ./
drwxrwxrwx 1 me me 524288 Jul  2 19:31 ../
drwxrwxrwx 1 me me 524288 Jun 30 22:49 American.Dad.S14E02.WEBRip.x264-TBS[ettv]/
drwxrwxrwx 1 me me 524288 Jun 30 22:49 American.Dad.S14E05.720p.HDTV.x264-KILLERS[rarbg]/
drwxrwxrwx 1 me me 524288 Jun 30 22:49 American.Dad.S14E05.HDTV.x264-KILLERS[ettv]/
me@xps:/plex/test/tv/American Dad/Season 14$ pwd
/plex/test/tv/American Dad/Season 14

After trying to re add the tv library it still isn't showing anything for the tv shows...

That’s a LOT better thanks.

The official structure has always been:

/TLD here/
  Name/
    Season n/
      Name - SxxExx - optional text or title here.ext

Also be careful of punctuation where it doesn’t belong. Getting rid of spaces can hurt you and confuse Plex.

[chuck@lizum Almost Human.225]$ tree
.
└── Season 01
    ├── Almost Human.S01E01.Pilot.mkv
    ├── Almost Human.S01E02.Skin.mkv
    ├── Almost Human.S01E03.Are You Receiving.mkv
    ├── Almost Human.S01E04.The Bends.mkv
    ├── Almost Human.S01E05.Blood Brothers.mkv
    ├── Almost Human.S01E06.Arrhythmia.mkv
    ├── Almost Human.S01E07.Simon Says.mkv
    ├── Almost Human.S01E08.You Are Here.mkv
    ├── Almost Human.S01E09.Unbound.mkv
    ├── Almost Human.S01E10.Perception.mkv
    ├── Almost Human.S01E11.Disrupt.mkv
    ├── Almost Human.S01E12.Beholder.mkv
    └── Almost Human.S01E13.Straw Man.mkv

1 directory, 13 files
[chuck@lizum Almost Human.226]$

In this case, the name is “Almost Human” , delimiter is . (dot),

This is what FileBot does elegantly

Please restart Plex,
Scan the section again.
When it finishes ,

gather and post logs,

I will walk through them line by line one more time

Ok. So right now my working directory is /plex/Media/{Movies,TV Shows}/files This works fine for the movies just not the tv shows. Do you know why one would work and the other wouldn’t?

These are the current test and production trees:

me@xps:/plex$ tree test
test
└── tv
    └── American Dad
        └── Season 14
            ├── American.Dad.S14E02.WEBRip.x264-TBS[ettv]
            ├── American.Dad.S14E05.720p.HDTV.x264-KILLERS[rarbg]
            └── American.Dad.S14E05.HDTV.x264-KILLERS[ettv]

6 directories, 0 files
me@xps:/plex$ tree Media/
Media/
├── Movies
│   ├── 001 - Captain America - The First Avenger (2011)
│   │   ├── Captain.America.The.First.Avenger.1080p.BrRip.x264.YIFY.mp4
│   │   └── Captain.America.The.First.Avenger.1080p.BrRip.x264.YIFY-por.srt
etc...

What is your working directory in this example?

Looks like it still isn’t seeing the files. Attaching logs..

Plex Media Server Logs_2019-07-02_20-01-10.zip (2.2 MB)

I’m not sure how to explain this…

I repeated the steps above 5 times with no success. On attempt 6 I am seeing a test file I put in there.

So, I guess it is working now.

Let’s give this some time to see if you start getting media.

If not, given the gracenote failure, we can always

  1. Stop Plex
  2. cd /var/lib/plexmediaserver
  3. mv Library Library.save (This is how we save the existing server temporarily)
  4. Start Plex
  5. Create a new server with a different friendly name (temporarily))
  6. Add media in pieces to verify /plex is working correctly
  7. Add the rest
  8. then transfer the watch list if important. (difficult but can be done)

Sounds good.

I started dumping a bunch of files and directories into the tv show folder and they are all showing up :slight_smile: I’ll continue to monitor it.

I did want to ask a question about the log files.

  1. Which log files are the more important ones?
  2. What do you usually search for in the logs? (besides ERROR]
    2a) I ask because I can spend more time troubleshooting by myself and not take up so much of your time.
  3. Which directory do the logs reside? I didn’t see them in /var/log.
    3a) I just want to make sure I look at the correct logs.
  4. Can you do me a favor and trash the log files I uploaded? I don’t think I have anything private in their but better safe than sorry. I would have done it myself but there is no way for me to un download it.
  5. Thank you.

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