Jump to content

Emby just deleted all of my Movies


KRULL

Recommended Posts

I have a Synology DS916+ with Emby 3.2.10..0-1 installed. I play via an Nvidia Shield TV with SPMC and the Emby for Kodi add-on (v2.3.46). In the Emby for Kodi settings I have "Offer delete after playback " set to on, with a confirmation required.

 

I watched an item in my Movies section (/volume1/Media/Movies/) and upon completion I said yes to delete it.

It hung for a while before doing that, which I put down to the NAS being in the middle of a RAID scrub. Upon trying to get another item to refresh which it hadn't after renaming it, I went to see why it hadn't happened minutes later, and noticed that 99.99% of the content in my /volume1/Media/Movies/ location was deleted. Three folders remained, all of which only contained .nfo files.

 

I will have some backed up (not all due to a recent NAS replacement and not setting up the new backup program), but I am not touching that until the RAID scrub finishes.

 

I stopped Emby, how can I see what the hell went on to lose a few TBs of movies?

Edited by KRULL
Link to comment
Share on other sites

I'm not positive what impact the Kodi interaction had here but what was the structure of your movie files?  Were they all in a single folder?

Link to comment
Share on other sites

/volume1/Media/Movies With each movie then it's own folder with images and .nfo

 

E.g.: /volume1/Media/Movies/Krull (1983)/Krull (1983).mkv

Link to comment
Share on other sites

xnappo

Do you have your kodi.log (maybe in kodi.log.old) by any chance for when this happened?  The Emby server log would also be good.

 

I don't know how this could happen from the 'offer delete'.  We did have a bug a long time ago with the database sync, but that occurred with a different message.

Link to comment
Share on other sites

I'll check the SPMC log, I have restarted it a few times since, not sure if that effects it.

 

I Googled the hell out of it and couldn't find how to get the Emby log from a Synology, how is this done?

I have started it again if that makes a difference.

 

I saw another post in the Windows threads that also had their entire Movie collection deleted by Emby. The file they deleted was at the root of the Movie folder and not in it's own.

Link to comment
Share on other sites

Emby Log - https://drive.google.com/file/d/0B_c9j9nuEk4uQ3ZjSDNrY3FsWE0/view?usp=sharing

 

I copied from very earlier in case there is relevant info. It was around "2017-04-09 15:09:59" that it all happened, when I finished watching an item Emby incorrectly labelled as "Blonde Ringlet" that I selected OK to delete. Not sure if that matters, but the file was actually something like  /volume1/Media/Movies/UFC/F1 Quali.mp4

 

The SPMC (Kodi) log doesn't go back to that time due to restarts, so it can add nothing.

 

Link to comment
Share on other sites

The only think I can think of is that you had a media file in your root folder that was identified as a movie by the system and you asked to delete that item.

Link to comment
Share on other sites

Nope, not a single file was in the root folder, everything was within another folder within /volume1/Media/Movies/, everything. I went through the process of doing that on 19th March, I know the date as I have the SSH process saved in my notes when I decided I wanted to have all the metadata and images with the media file:

 

Switch to Root access:

sudo -i

 

Password again

 

Go to Movie Folder to create Folders.

cd /volume1/Media/Movies

 

for file in *; do

  if [[ -f "$file" ]]; then

    mkdir "${file%.*}"

    mv "$file" "${file%.*}"

  fi

done

 

 

That file that was played and requested to be deleted was /volume1/Media/Movies/UFC/F1 Quali.mp4 so you can see, that was with the "UFC" folder in /Movies.

 

I have just checked by USB backup from 23 Dec and have 2.7TB of the movies there, so not a tonne to replace. I am still quite wary of Emby doing it again, although I will have my backup program running a full coverage in a few days, and until then, no file will be deleted.

 

What I did notice is that a couple of days ago, the prompt to "Offer delete after playback " was not working. I disabled it on the Shield, restarted it, reenabled it, restarted and it was back.

 

I also noticed that Emby will bypass the NAS's recycle bin, and permanently delete a item instead of moving to the Recycle bin

Link to comment
Share on other sites

Do I assume that the Emby logs show nothing, and no one has any idea why Emby decided to delete all of my movies?

Link to comment
Share on other sites

xnappo

Unfortunately there is nothing in that Emby log.  You should have more than just that one?  Usually it makes one every time it restarts and keep the old ones.  At least it used to.

 

I your Emby for Kodi set up for direct paths?  If so changing to plugin paths would be safer as Kodi will no longer have access to the file system. 

 

Also - make absolutely sure that the Kodi scraper does NOT know about your collection.  They should not be in sources.xml.  

 

xnappo

Link to comment
Share on other sites

Thanks for the reply, there were more logs, but that was the one during the event, the next was when I restarted it a few hours later. Logs from that date are now not showing.

 

Emby for Kodi is set as, Sync Options -> Playback Mode = Addon (Default) if that is what you mean.

Log in method is Emby Connect if that makes any difference.

 

SPMC (Kodi's) scrapper has never been setup since using Emby, sources.xml has links to two folders, I have done some file shuffling since this all happened, but it is similar to how it was in the pass, except it would have been SMB instead of NFS.

I have highlighted one folder that is in the Movie folder that I set for direct access ti use occasionally outside of Emby.

 

<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>Emby</name>
            <path pathversion="1">smb://</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>Emby</name>
            <path pathversion="1">smb://</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>BAR</name>
            <path pathversion="1">nfs://192.168.1.67/volume1/video/BAR/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>Direct</name>
            <path pathversion="1">nfs://192.168.1.67/volume1/video/Movies/00Direct/</path>
            <allowsharing>true</allowsharing>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
    </music>
    <pictures>
        <default pathversion="1"></default>
    </pictures>
    <files>
        <default pathversion="1"></default>
        <source>
            <name>EMBY ADD ON SOURCE</name>
            <path pathversion="1">http://kodi.emby.media/</path>
            <allowsharing>true</allowsharing>
        </source>
    </files>
</sources>
 
 
I have not deleted anything with Emby since this all happened and I gave it access to the full library. Backup is still running, so it will remain that way until finished. After that I may to a complete clean install of of SPMC and therefore the Emby add on.
Link to comment
Share on other sites

xnappo

Okay, it is fine to have the folders in there for access, as long as the Kodi scraper isn't set to look in there for movies.

 

Unfortunately it seems we have lost all forensics as to what happened.  Again - it is slightly safer to use 'addon paths' instead of 'direct paths'.  

Link to comment
Share on other sites

The only think I can think of is that you had a media file in your root folder that was identified as a movie by the system and you asked to delete that item.

 

Just on this point, as I have seen you post it for others that have had contents of folders deleted by Emby, if this is a known bug or liability, I think it would be advisable to make sure this concern is posted boldly in the media naming Wiki's where no mention of it is made. It lists having files in the root folder as a viable option.

Link to comment
Share on other sites

Okay, it is fine to have the folders in there for access, as long as the Kodi scraper isn't set to look in there for movies.

 

Unfortunately it seems we have lost all forensics as to what happened.  Again - it is slightly safer to use 'addon paths' instead of 'direct paths'.  

 

Thanks, was another Emby log required, or was i the SPMC (Kodi) log that may have shown more?

Link to comment
Share on other sites

One even later or earlier than when the event occurred?

The log I have provided covers from 2hrs prior to 20 mins after the deletion happened?

Link to comment
Share on other sites

That's exactly what I posted.

 

Emby Log - https://drive.google.com/file/d/0B_c9j9nuEk4uQ3ZjSDNrY3FsWE0/view?usp=sharing

 

I copied from very earlier in case there is relevant info. It was around "2017-04-09 15:09:59" that it all happened, when I finished watching an item Emby incorrectly labelled as "Blonde Ringlet" that I selected OK to delete. Not sure if that matters, but the file was actually something like /volume1/Media/Movies/UFC/F1 Quali.mp4

 

The SPMC (Kodi) log doesn't go back to that time due to restarts, so it can add nothing.

Link to comment
Share on other sites

Ok right, I already reviewed that. for the next release of Emby Server I have added more logging to help us hunt this down, so we'll need to try again with that. Thanks !

Link to comment
Share on other sites

xnappo

Thing is there is no delete in that log.   I am wondering if the dialog that offered to delete was a Kodi dialog rather than our Emby for Kodi offer delete feature?  

 

We certainly don't know of path where files get deleted, but if Kodi doesn't have access to the path directly it eliminates one variable. 

Link to comment
Share on other sites

I just noticed that what I thought was “/volume1/Media/Movies/UFC/F1 Quali.mp4” shows as the following:

 

2017-04-09 14:25:12.7413 Info HttpResultFactory: Transmit file /volume1/Media/Movies/F! Quali.mp4

 

So it seems I was wrong on location and name, which doesn’t seem right for various reasons, but I guess it must be. That would be correct as to when I started watching it.

 

The deletion was via the Emby for Kodi add "Offer delete after playback" option, not Kodi itself. It appeared on my screen when I finished watching/stopped the item. The folder that Kodi had direct access to via SMB, but not scrapped was “/volume1/Media/Movies/UFC/”.

 

I can request a deletion to any item via Kodi by sending the keyboard command “Delete”, it will then offer a confirmation pop up to execute, but that is not what happened here, it was the Emby add on deletion request that popped up when I finished or stopped the playback. It is quite rare I delete via the “Delete” keyboard command, as 99% of the time we use the Emby Add on pop up. To do it via Kodi’s menu, it is the Context menu, then scroll to Emby Options then select the delete option, but I never use that.

Link to comment
Share on other sites

  • 1 month later...

​Well i just had the same issue..

​Yesterday i reorganized my movies into separate subfolders of the movie folder for better performance of library updates (which rly gets way faster like that).

​Only one movie remained as file in the movie folder becaue i wanted to delete the file anyways. After i deleted this movie over Kodi via Emby Addon - pop up first i thought nothing happened, well after a while i got a nice info in kodi that all hundreds of files got deleted and only thought !!!WTF!!!

​Some check would be great like 'if file is directly in library folder then DONT DELETE EVERYTHING JUST THIS ONE FILE' ... :-/

Link to comment
Share on other sites

Angelblue05

Sorry this happened to you. The add-on doesn't know the path to the file when deleting. We just send the item id associated to the file. @@Luke is there something we can do to prevent this from happening on the server? Some kind of verification? If the parent folder matches the library folder than prevent any deletion from happening?

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...