Jump to content

DSM 6 to DSM 7 Emby Migration Instructions


cayars

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

Posted (edited)
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

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