Jump to content

DSM 6 to DSM 7 Emby Migration Instructions


Carlo

Recommended Posts

Sounds like you might have 2 issues going on which could be file/directory permissions and IP/networking.

What IPs do you have bound to your NICs in Synology Control Panel?  Are they bonded or individual IPs?
Did you turn on the Synology Firewall or Proxy?
Are you using the default ports in Emby of 8096 and 8920?
Have you entered any IPs, network settings or computer names in Emby on the Network tab?

Carlo

Link to comment
Share on other sites

Sandgorgon

Thanks for jumping in. I'm just getting more confused at the moment.
The Embry Server has stopped running again (permissions issue). Here's the log message

It says it can't read the policy file. The folder owner is "emby" but I can't open the folder to check the file.

Does it need the chown run AGAIN? I did it last night AGAIN and it seemed to get the server up and running, but now it's not working again.

As to your questions regarding IP addresses, One is set the (DHCP) 192.168.0.124 and the other is (Static IP) 192.168.0.156

These are the same as used on DSM6 which worked fine.

I haven't touched the Firewall so it should be the same as it was in DSM 6. There are not special rules and the Firewall is enabled. (I tried disabling). 

I haven't changed the ports from default but then I can't get it running to configure it anyway :(

Same goes for the Emby Network tab. Can't get to it anyway, but whenI looked last night, it was empty.

I took a look in the config/users folder and there are three folders  with guid style names. All are owned by emby but only one of them has any access permissions at all. The other 2 are blank, and that includes the one being referenced in the error log (below)

Here's the log error message if that helps (probably not).

 

2022-03-22 14:49:10.094 Error UserManager: Error reading policy file: /var/packages/EmbyServer/var/config/users/1f152ec8c39d4f55b24a389380682c30/policy.xml
    *** Error Report ***
    Version: 4.6.7.0
    Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /var/packages/EmbyServer/var -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -pidfile /var/packages/EmbyServer/var/EmbyServer.pid -defaultdirectory /volume1/Public -updatepackage emby-server-synology7_{version}_x86_64.spk
    Operating system: Linux version 4.4.180+ (root@build13) (gcc version 7.5.0 (GCC) ) #42218 SMP Mon Oct 18 19:16:55 CST 2021
    Framework: .NET Core 3.1.21
    OS/Process: x64/x64
    Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
    Processor count: 4
    Data path: /var/packages/EmbyServer/var
    Application path: /volume1/@appstore/EmbyServer/system
    System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/var/packages/EmbyServer/var/config/users/1f152ec8c39d4f55b24a389380682c30/policy.xml' is denied.
     ---> System.IO.IOException: Permission denied
       --- End of inner exception stack trace ---
       at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
       at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
       at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
       at System.IO.File.OpenRead(String path)
       at Emby.Server.Implementations.IO.ManagedFileSystem.OpenRead(String path)
       at Emby.Server.Implementations.Serialization.MyXmlSerializer.DeserializeFromFile(Type type, String file)
       at Emby.Server.Implementations.Library.UserManager.GetUserPolicy(User user)
    Source: System.Private.CoreLib
    TargetSite: Void ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo])
    InnerException: System.IO.IOException: Permission denied
    Source: 
    TargetSite: 
    
 

Edited by Sandgorgon
Link to comment
Share on other sites

Sandgorgon
On 3/22/2022 at 11:36 AM, cayars said:

Sounds like you might have 2 issues going on which could be file/directory permissions and IP/networking.

What IPs do you have bound to your NICs in Synology Control Panel?  Are they bonded or individual IPs?
Did you turn on the Synology Firewall or Proxy?
Are you using the default ports in Emby of 8096 and 8920?
Have you entered any IPs, network settings or computer names in Emby on the Network tab?

Carlo

Still no luck with Emby on DSM 7. 
As shown in my last email, the log file shows it failed to load the policy file from the referenced user folder.

The EmbyServer folder contains 3 user folders, all have emby as the owner but 2 of them have no rights at all. One of these is the one trying to be used.

I uninstalled, reinstalled, recopied the old Emby folders and re applied the chown. but still no luck.
I don't know how to get Emby to try and use one of the different user folders, and I don't know how to change the rights to the other folders.
 

Note: I updated Plex and that is now working fine under DSM 7, but I want to get Emby back up and running.

Thanks

@cayars


 

Link to comment
Share on other sites

Login via SSH and do a "sudo -i" to go root

Then run "chown -R emby:emby /volume1/@appdata/EmbyServer" but of course change the path if you have Emby installed in a different location.

You should most definitely be able to access the following location as root:
/var/packages/EmbyServer/var/config/users/1f152ec8c39d4f55b24a389380682c30/policy.xml
or using the pseudo name

/volume1/@appdata/EmbyServer/config/users/1f152ec8c39d4f55b24a389380682c30/policy.xml

If this doesn't work take a screen shot for us showing what the users directory looks like under users.  Use an "ls -l" command to show sizes and permissions.

Link to comment
Share on other sites

Sandgorgon
1 hour ago, cayars said:

Login via SSH and do a "sudo -i" to go root

Then run "chown -R emby:emby /volume1/@appdata/EmbyServer" but of course change the path if you have Emby installed in a different location.

You should most definitely be able to access the following location as root:
/var/packages/EmbyServer/var/config/users/1f152ec8c39d4f55b24a389380682c30/policy.xml
or using the pseudo name

/volume1/@appdata/EmbyServer/config/users/1f152ec8c39d4f55b24a389380682c30/policy.xml

If this doesn't work take a screen shot for us showing what the users directory looks like under users.  Use an "ls -l" command to show sizes and permissions.

Ran the chown (again). Server still fails to start up with the permissions error on the policy.xml file.

image.png.e8ac2190344dd1c88dab5c832448b80e.png

image.png.c7af22ef3312bfbda8853c75738445f0.png

I was unable to open the 1f1... folder with the WinSCP browser but could with Putty.

The error log text is the same as posted previously

 

 

 

 

Edited by Sandgorgon
incorrect images pasted
Link to comment
Share on other sites

Try this from SSH

From SSH sudo find /volume1/@appdata/EmbyServer/config/users \
\( -type f -exec chmod 644 {} \; \) , \
\( -type d -exec chmod 645 {} \; \)

The \ at the end of the first two lines just means the more to the command on the next line.

That should change the permissions for both directories and files under users.
Try again in Emby after this.  If it works do one more thing for me and create a new user.

Back in SSH does the new directory created for this user have the same permissions as others?
Looking for two things. One is that the permissions set above match but more important that you get inherited permission on the new directory just created.
It's possible permission inheritance was destroy previously.  If that, sticky or special permissions were changed it's going to be more work and your whole Emby structure should be checked.

Any idea how these user folders got their permissions wiped out? Stuff happens to the best of us so no issue there, but knowing how it happened could help to fix it.

Carlo

Link to comment
Share on other sites

Sandgorgon

That fixed getting the server up and staying up.

I took a quick glance at some of the other folders in the EmbyServer folder.

The "sync", "metadata" and "transcoding-temp" folders also have no rights assigned

The "config\dlna" folder has no rights and a bunch of other files in the config folder don't either.

I'm guessing that having no rights makes them hard to be referenced by anyone.........

so maybe the permission inheritance you mentioned is "broken". I've uninstalled, reinstalled a few times as well as copy the old Emby files across etc.

I upgraded to DSM 7 a couple of days ago. Everything was working great before that :(

None of my previously working devices can connect to the server

 

Edited by Sandgorgon
Link to comment
Share on other sites

Sandgorgon
11 hours ago, Sandgorgon said:

That fixed getting the server up and staying up.

I took a quick glance at some of the other folders in the EmbyServer folder.

The "sync", "metadata" and "transcoding-temp" folders also have no rights assigned

The "config\dlna" folder has no rights and a bunch of other files in the config folder don't either.

I'm guessing that having no rights makes them hard to be referenced by anyone.........

so maybe the permission inheritance you mentioned is "broken". I've uninstalled, reinstalled a few times as well as copy the old Emby files across etc.

I upgraded to DSM 7 a couple of days ago. Everything was working great before that :(

None of my previously working devices can connect to the server

 

I can't connect to the Emby server, although it does show up as visible to try nd connect to. I've tried on a laptop and iPhone (which worked previously).

I also set up another Emby server on a desktop, using the NAS media library and that works fine in all respects.

Since I can't connect to the NAS Emby Server, I have been unable to try creating a new user and checking their rights etc

Link to comment
Share on other sites

Sandgorgon

I changed the chmod settings to 755 and 645 and the server runs, I can connect and play back stuff. I also created a new user.

Looks like it's sorted. Eventually.

Seamless upgrade! Sweet!

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Sandgorgon
53 minutes ago, Sandgorgon said:

I changed the chmod settings to 755 and 645 and the server runs, I can connect and play back stuff. I also created a new user.

Looks like it's sorted. Eventually.

Seamless upgrade! Sweet!

HOWEVER. (Spoke too soon)

Suddenly the Emby Server has no libraries.

So I readded the folders, but now it's going to want to rebuild the meta data from scratch.

The EmbyServer/metadata has no rights but I "tweaked them" and took  look inside. It's all still in there but the folders had various right permission combinations.

Should they all be the same, and if so, what should they be?

At this point I'd be happy to be able to wipe the whole thing and start rebuilding from scratch, if I knew that would be a reliable option.

I'm not comfortable tweaking rights on a variety of folders and files and not knowing if that is correct, safe etc.

If anyone can help with a CLEAR set of options, I'd be greatful.

As an example, does this look correct since a bunch configuration files appear to have different rights.
image.png.3f03b9783d808ff17f0ce78c1cd74506.png

And as mentioned, the metdata folder and it's contents are all over the place wrt rights

I just noticed that my Premier key got dropped so I have re added that too, but am now rebuilding the metadata from scratch.

I'm more than a little nervous that the system is in a flakey state and I will find more issues once I get back to using it every day so I'd rather get it sorted before that happens, even if it means a full reinstall (which I wanted to void, hence the migration)
 

Edited by Sandgorgon
Link to comment
Share on other sites

On 3/24/2022 at 1:03 PM, Sandgorgon said:

I changed the chmod settings to 755 and 645 and the server runs, I can connect and play back stuff. I also created a new user.

Looks like it's sorted. Eventually.

Seamless upgrade! Sweet!

Where did the 755 come from?  That's not something you want to do as you potentially open up the system.
 

From SSH sudo find /volume1/@appdata/EmbyServer \
\( -type f -exec chmod 644 {} \; \) , \
\( -type d -exec chmod 645 {} \; \)

Then also run for good measure this:

chown -R emby:emby /volume1/@appdata/EmbyServer

That will make sure emby is the owner of all files as well as the group emby.

EDIT: sorry, I typed this yesterday and thought it was sent but just found the tab in my browser open and never sent.
Sorry about that.

If this doesn't work send me a PM (private message) by hovering over my avatar and clicking the message link.
We can arrange a remote support session and I'll get things working for you as I can compare your permissions to mine so we know they are correct.

Edited by cayars
Link to comment
Share on other sites

  • 1 month later...

went so much into panic after DSM 7 upgrade and seeing all settings was gone. Glad this guide could recover everything. both user data and watched looks good.

thanks man

  • Thanks 2
Link to comment
Share on other sites

Glad you kept a cool head and worked through the guide!

Nicely done.

 

Link to comment
Share on other sites

  • 1 month later...
divide_by_zero

Hey @cayarsand Emby team.


So I screwed up a bit. The "emby_pkg" user didn't exist, and I deleted the "Emby" user. 

The data is copied, but obviously can't chmod for a user that doesn't exist.

How can I recreate the proper emby user? (I tried to manually create it but it says the user is reserved, so it's still there in some capacity.)

Thanks!

UPDATE in case it helps others: Did some googling and got clarity Local User (which I deleted) is different than the system internal account (ref https://emby.media/community/index.php?/topic/102803-i-deleted-new-emby-system-user-by-mistake-on-dsm-70/ ).

So in essence my deletion didn't have any effect (I think?). What I did need to do so I could CHMOD properly and finish my migration was to grant the emby (system) user RW access to to the filesystem, and then to my specific media folders. After that, the chmod worked as expected and it looks like I'm in business on DSM 7. (At a glance Users and Play-states are all good)

Thanks Cayars and team for all the great resources on this process!

Edited by divide_by_zero
Link to comment
Share on other sites

Glad you got it working!

BTW, just in case it was the internal user that somehow got wacked the first this I would try and do in that situation is make a copy of config & data folder  (just in case) and then use package manager to reinstall the same version overtop it.  That's a good way to fix a user issue to a missing DLLs or something "off" from the base setup.

Carlo

Link to comment
Share on other sites

Hi,

I believe I've successfully transitioned my existing library to the dsm 7 version of Emby Server following the instructions at the beginning of this post. However, any new additions to the library fail to save any images.  I can see the options when selecting "Edit Images" but after selecting a choice, they fail to save. While looking at the server logs, I notice the following error:

Error ProviderManager: UnauthorizedAccessException: Emby Server is being write access to /volume1/MediaShare/Emby Metadata/metadata/library/b9/b9c7b7ad2fca8e6358be53a2a7c6508c/poster.jpg. Please check your file permissions.

I have given the system internal user "emby" read/write access to the shared parent folder MediaShare.  Any thoughts on what might be causing this?  All other relevant info is downloaded and saved such as plot, rating etc.  Also of note, actor pictures only show up if already in existence from a previous media asset.

Any thoughts on where the issue lies?

Thanks!

Chris

Link to comment
Share on other sites

ok, seems that the subfolders below the library folder had different permissions between them.  Most notably, some did not allow write activities for non-owner users.  The folder owner was formerly emby_PKG, which was removed as part of the transition to dsm 7.  Now the owner is just listed as a number.  Don't know why some folders allowed write activities and some did not.  Changed permissions for any subfolders  that did not allow for write activities for non-owner users and the problem appears to be resolved.

Link to comment
Share on other sites

  • 2 weeks later...

Sounds like maybe you need to run a chown command for your media.  Normally this isn't needed but can certainly be done.  Take a look at the migration instructions again for both the chmod and chown commands we ran the installation directories.  You can adapt the paths to match your media and run them as well which should fix your issue if not corrected already.

Carlo

 

Link to comment
Share on other sites

  • 3 months later...
marky9074

@cayars Apologies for not reading the thread in its entirety. But thought I would just describe what I have done, what happened, and what is now not working. So, I was on the last version that was supported in DSM6, I tried to upgrade and got a nag warning. That was the trigger to purchase a DX517 as DSM would not update on my DS720+ whilst I still had the old DX513 attached (I was hanging it out in the hope that a new model would get released...)

  • So, DSM updated, then prompted me to auto update Emby (which I thought was odd as didn't realise it was a package available directly).
  • Went to Emby, found it wasn't the latest, downloaded and manually installed
  • Went back into Emby - found it was a new install
  • Started to add my photo library and one user
  • Tried to add my movies, but they were not selectable in the web browser (no matter what web browser), and even if I entered the path correctly as found when I logged in with SSH
  • Found this thread, and started from the section after installing DSM7 (having removed all files from /volume3/@appdata/EmbyServer with rm-rf *)
  • Started Emby, all good but users' icons missing, and Photo library not showing, and some images on server management web GUI missing (started adding users images again)
  • Deleted and re-added photo library, started manual scan - nothing happening
  • Come back some hours later, user icons have reappeared on their own, but photos still absent....

So, I am at a bit of a loss...

  • As a test if I go to add a new library for movies, I can select it OK (so the web UI issue has fixed itself)
  • Delete and try to re-add photo library - nothing happens
  • Checked permissions

Any suggestions would be much appreciated. Happy to set up a TeamViewer or remote session.

Screenshot 2022-11-06 084018.png

Link to comment
Share on other sites

 

That looks correct.

Is the actual location on disk /volume1/photo ?

What I do is have a "media" folder off the root volume for each volume.  ie media1 is on volume1, media7 is on volume7.

Then I'll have something like /volume1/media1/movies, /volume1/media1/tv-shows, /volume1/sports.
I could then grant permission to all the mediaX shares which will be one for each volume.

Once I've done the initial permission setup once for each volume as you show above I shouldn't need to touch it as any mount made in the future will be under one of thos mediaX volumes. This goes for externally mounted file system as well.

Because you're not using a common storage approach like this I'd assume you have separate shares you have to set up and manage. ie /volume1/movies, /volume1/home, /volume1/tv-shows.  I mention this because "photo" is a common name that might have already existed on your system.  If you open File Manager, there should be a share listed on the left called photo.  Right click it and choose properties and you'll get something like this:
image.png

That obviously has nothing to do with Emby and was just an example but it shows the actual location where this is located /volume1/MailPlus.  What I would check is the mount point entered in Emby.  Is it this same location or by dumb luck a different "photo" directory?

Assuming you know how to do this: Using SSH, issue a

Quote

sudo -i

command to go root/super user.  You'll have to make sure the logged in user has admin privs. It will prompt for the password which is that user's password. Navigate to the shared folder location and issue

Quote

ls -l

both lower case L above.  You'll likely get a long list of items that look similar to this

drwx------+ 1 emby  emby       1222 Jul 22 12:31  PIC
drwx------+ 1 emby  emby       4224 Sep  9 00:25  Pics
drwx------+ 1 emby  emby         24 Nov 28  2021 'TV Shows'
drwx------+ 1 emby  emby        244 Oct 11 19:52  VOD

Do you see the "owner" and "group owner" both as "emby" like above?

How about the "drwx" in the first 4 colums above starting each line? "d" just means it's a directory so that won't be there for files. The other 3 are the permissions for the owner (in this case emby) which is "R"ead, "W"rite, e"X"ecute

If not, show us a screen shot of what you have.

Carlo

 

 

Link to comment
Share on other sites

marky9074

@cayars Thanks for getting back to me.

Yes, my install has been migrated over various DiskStations over the years, and the media are all in separate shared folders....

Looking at the photo folder owner/group is PhotoStation and permissions drwxr-xr-x+

This has just rung a massive alarm bell as I have had this before in that I needed to go into the PhotoStation app (now Synology Photos) and fix the permissions in there.... That said, I assume the emby user/group is a system one as I do not see it under users/groups (and I cannot add them as it says they already exist), and therefore I cannot set permission for the emby user/group in the Synology Photos app....  

Any ideas?

Edit: Definitely a permissions issue:

System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/volume3/photo/2016' is denied.

 

Edited by marky9074
Link to comment
Share on other sites

Do you mean Synology Photos?

If so in settings you want this:
image.png

Then you can set permissions on the following pages.

 

Click the plus sign

 

 

image.png

image.png

Link to comment
Share on other sites

marky9074

Yes, this is exactly where I was in Synology Photos. There is no local user 'emby' so I cannot add it ('emby' is a system internal account?).... When you click on the pull-down list does it show a local 'emby' user for you? @FrostByte 

Link to comment
Share on other sites

marky9074

I just opened a ticket with Synology support to see if it was possible to add 'System Internal Users' to the Synology Photos 'Shared Space' permissions, but they come back saying it was a 'third-party package' and to contact the developers....

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