Jump to content

Duplicate libraries


sfatula

Recommended Posts

sfatula

Nothing new for me, except maybe reporting again. This has happened to me maybe 30 times over 2 years, not unusual at all. Seems to happen after a server reboot most of the time as far as I can recognize. Could be every time. Not sure if maybe Emby has a problem with shutdown process or what. It's a pain to resolve.

ubuntu 4.5.4.0 server,, not sure when this one happened though there have been some system updates that required reboot this week.

Yes, I can delete one (which usually deletes the other), then I lose some settings, have to take screen captures, re-add, set thumbnail, etc. It's just a pain.

I presume it shows up twice as the sqlite database has double entries perhaps? Is there anything that can be done to figure out why and hopefully permanently resolve?

 

Duplicates.png

Link to comment
Share on other sites

What do you show in this folder? '\Emby-Server\programdata\root\default'

I am on Windows so this location may differ.

Only one Admin account of the server?

Edited by Guest
Link to comment
Share on other sites

sfatula

I've looked there before, I see this:

Home-Server:/var/lib/emby/root/default$ ls -l
total 32
drwxr-xr-x 2 emby emby 4096 Aug  8  2020 'Archive Concerts'
drwxr-xr-x 2 emby emby 4096 Aug  8  2020 'Archive Movies'
drwxr-xr-x 2 emby emby 4096 Aug  8  2020 'Archive TV shows'
drwxr-xr-x 2 emby emby 4096 Aug  8  2020  Collections
drwxr-xr-x 2 emby emby 4096 Aug  8  2020  Lena
drwxr-xr-x 2 emby emby 4096 Aug  8  2020  Music
drwxr-xr-x 2 emby emby 4096 Apr 19 01:09 'Recorded Shows'
drwxr-xr-x 2 emby emby 4096 Apr 19 01:09  Recordings

 

Edited by sfatula
Link to comment
Share on other sites

I have had this happen once or twice to me, but I deleted the library and added it back in.. I think I tried to rescan as well...

Link to comment
Share on other sites

There is a known issue with this in the forum I found.. looking through thread titles with 'Duplicate Library'...

This is probably the culprit of the problem.

Link to comment
Share on other sites

Happy2Play

Yes there are some old issues where the plugin would create duplicates.  But I am guessing sfatula has not done a restore to possibly make this happen.

I don't really think a cause was ever found, but not a lot of info to go on.  Minus digging into the database, I don't believe anything can be done beside remove and re-add.

Link to comment
Share on other sites

This, from my experience can be caused without doing a restore.. for whatever reason. I remember I installed thinking it was a good idea to have.. and might have tried a backup or it may have occurred in Scheduled Tasks.. but never did a restore.

I know I deleted the plugin DLL file from the server...

Edited by Guest
Link to comment
Share on other sites

sfatula

I don't believe I have ever restored even once. So.... You are saying that the backup plugin itself can cause this if I understand correctly.

Given that I run a backup of the system in the middle of the night, and, no new recordings happen during that time, would that backup suffice for Emby purposes if I ever did have to recover? I am presuming though I'd have to make sure all the various directories are stored, haven't looked into what those are.

If that's not good enough as Emby is running, I could always stop it, backup, start it.

Link to comment
Share on other sites

A system backup, if configured to encompass EMBY would probably definitely be enough as the entire server and all of its files would be backed-up..

So removing the Server Configuration Plugin would not be a problem. It is only going to back up the Server Configuration, useful in case of settings issues or re-install..

Restoring the system would put everything just like it was and as long as your drives/storage or library locations were where they are originally everything should be fine. 

@ebr

Edited by Guest
Link to comment
Share on other sites

I've seen this a lot as well as you can usually just delete the new one then do a full scan

I think I've seen this happen most to system with optional paths setup in the DVR section.
If using a path for both Movies and TV Shows try blanking out the first or default path so you only have the movie & show paths.

That seems to help I think but isn't a cure.

Link to comment
Share on other sites

  • 1 year later...
sfatula

Sucks, but it still happens every few months. Happened again today.

If the database were MySQL, I'd be able to log when it happened automatically for at least a hint.

Edited by sfatula
Link to comment
Share on other sites

  • 3 months later...

So, I'm trying to convert a VERY old Plex environment to a newer Emby environment. Most of my experience with Emby is via my Synology NAS, where everything is local to the server. I'm trying to replicate an environment where the source files are spread across multiple NAS servers, and local storage (one of those environments that grew in complexity over the years).

I edit the folder info on the old system to copy the data (name, folder locations), then in a different browser tab I create a new Emby Library with a type of  'Home videos & photos'. I name the Library, then add 1-4 folders. I then click the OK button, and after several minutes it will finish, but often with multiple copies of the same Library. I've verified that I only hit the OK button once (why isn't it disabled after a click?), and I leave the tab so I can't hit anything accidentally.

Upshot, I am finding that Emby is creating 2 copies of the Library folders something like 60% of the time. Deleting one of them "hollows out" the other (all the folders are removed, and any attempt to add them back in generates a "not found" error).

This seems to happen more often when there are multiple folders associated with the Library (even when the total count of all the items in the folders is small <100). But I have had it also happen with a single folder (even when that folder is on a local disk).

All of the folders are either on a local (via USB) disk, or are mounted via Samba from up to 3 different NAS.

Anybody have any suggestions other than try and try and try until one of them sticks? It is really frustrating...

Emby Version : 4.7.6.0

MacOS: 10.14.6 ( old 68K mini).

Latest Firefox as the browser

All help appreciated!

Link to comment
Share on other sites

@wyst If I got this correct you Ideally want to run Emby on a PC and have files stored on a couple NAS boxes as well as additional PCs.

This should be fairly easy to do.  On the NAS boxes you will have to turn on NFS or CIFS/samba and share a media folder folder.

I'd suggest sharing one folder from each box. I typically create a new share called "Media" that I share.  Under media I'll have Movies, TV Shows, DVR, Home Videos, Pictures or whatever else is needed.  I create a new user on Synology similar to "media-user" with password and set permissions for this user to have read/write, etc

Now on the PC I use the option to login with a different username. I can mount a drive letter to //SYNOLOGY/Media as Z: while maybe Y: is mounted to a 2nd Synology box.  Now in Emby I can use Z:\Movies, Z:\DVR, Z:\Pictures, etc

That's all that should be needed.  PS the reason I use a different username is that it has access only to the shared media and nothing else.  Unlike my account it will never have root/admin access so it's better all around security wise.

Carlo

Link to comment
Share on other sites

On 8/23/2022 at 6:55 PM, cayars said:

@wyst If I got this correct you Ideally want to run Emby on a PC and have files stored on a couple NAS boxes as well as additional PCs.

This should be fairly easy to do.  On the NAS boxes you will have to turn on NFS or CIFS/samba and share a media folder folder.

That isn't the problem I am having. I have the NAS servers exporting via SAMBA, and they are all mounted on the Mac Mini which is running the Emby server. The files and folders are readable, the network and servers are stable (and have been for years).

My problem is that when I go to add a new library (I have many based on subjects) via the Emby web interface, more often then not the library gets duplicated, normally twice, sometimes up to 5 times. These are all identical (same folders listed, same count of items, same photos generated for videos, etc). Trying to delete one of them will "hollow out" all the others (they will all have 0 folders), so it vaguely looks like some kind of referencing error (where all of the duplicate libraries are referencing some master DB entry), but that is just a guess.

My problem is these constant duplicates when I try and create a new library. If I repeat creation, remove them all, create again, remove them all, etc often enough, I will usually get one to work with a single library for a single entry. But BOY is this painful. What should be a minute task on my side "name library, set folders, hit OK" becomes a multi-hour processes of again and again.

I do this carefully, so I know I am not double clicking on the OK button, and I only add one Library at a time.

I've taken to restarting the Emby server after each successful creation, as that seems to create a scenario that is more stable.

I'm hoping somebody can suggest a more stable and far less frustrating approach. One definition of insanity is doing the same thing over and over again, and expecting the results to be different, that is what this feels like.

Link to comment
Share on other sites

Thanks for the detailed explanation.  This sounds like it could possibly be in the design of the subdirectories.

Do any of the new librarys you setup happen to be under other libraries already added to Emby?
Do you have any symlinks manually setup?

Link to comment
Share on other sites

Quote

Do any of the new librarys you setup happen to be under other libraries already added to Emby?
Do you have any symlinks manually setup?

I discovered early on that having a library that contained folders for another library made Emby unhappy, so I stopped doing that.

I have a couple of libraries that have symbolic links into others, and while I think those have had duplicates appear, there are only a handful of those (maybe like 5 folders have symlinks). Most of the folders don't have any, and they are more likely to be duplicated (as it is the majority). So far, everything that has duplicates can be fixed, it just takes removing all of them, then trying to add it again. Often that will fail again, so I try it again, wash and repeat. After enough tries, it works as expected.

At the moment my current workflow is add new libraries until it creates a duplicate, remove all the duplicates, wait until a refresh shows none of the duplicates remain, restart the emby server, and try again. This is working for now, but I don't know if this is a fix, or if just something about the delay (or maybe not having any scans happening?).

Link to comment
Share on other sites

sfatula

Still happens a couple times a year for me. Never had libraries under others, no symbolic links, etc. Emby works for many months, then decides to duplicate libraries here and there for no obvious reasons. Going on for many many years now.

Link to comment
Share on other sites

To see what's going on we would likely need to see:
1. the disc layout for the different libraries.
2. The setup of each library
3. A clean log done after a restart with a library scan. No other actions going on while the scan is in progress would be best.
 

 

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...