Jump to content

Default user / group permissions seem to to be set wrong


Recommended Posts

JuJuJurassic
Posted (edited)

 

So I have a brand new server, Ubuntu 20.04, that I've just put Emby on, as I decided to move away from plex

Normally it seem the permission to the media folders are the problems, but I seem to have problems accessing the actual system files.

The media folders are mounted fine, if a little generous as you can see from here

julianh@media:/opt$ ls -l /mnt
total 2688
drwxrwxrwx 2 root root   65536 Jan 30  2021 3d
drwxrwxrwx 2 root root 2097152 Nov 11 17:43 films
drwxrwxrwx 2 root root  524288 Oct 12 18:30 music
drwxrwxrwx 2 root root    4096 Nov 12 13:34 tvshows

I had "The configured user limit (9192) on the number of inotify watches has been reached." I  increased it to 24,576 using "echo fs.inotify.max_user_watches=24576 | sudo tee -a /etc/sysctl.conf" then "sudo sysctl -p"

But I'm still having problems, it looks as if the file permissions on the emby server itself are wrong, although I suspect ownership.

julianh@media:/opt$ ls -l
total 12
drwxr-xr-x 9 root root 4096 Nov 16 07:16 emby-server
-rw-r--r-- 1 root root   68 Nov 16 15:21 sudo
-rw-r--r-- 1 root root   68 Nov 16 15:21 sysctl
julianh@media:/opt$ ls -l emby-server/
total 52
drwxr-xr-x  2 root root  4096 Nov 16 07:16 bin
drwxr-xr-x  4 root root  4096 Nov 16 07:16 etc
drwxr-xr-x  5 root root  4096 Nov 16 07:16 extra
drwxr-xr-x  2 root root  4096 Nov 16 07:16 lib
drwxr-xr-x 42 root root  4096 Nov 16 07:16 licenses
drwxr-xr-x  3 root root  4096 Nov 16 07:16 share
drwxr-xr-x  5 root root 28672 Nov 16 07:16 system
julianh@media:/opt$
 

looks like a couple of typos on the /opt, I'll get to them later 🙂 

Any suggestions?

Should I "chown -R emby:emby /opt/emby-server"

Thanks

Julian

 

 

embyserver.txt

Edited by JuJuJurassic
JuJuJurassic
Posted

Hi Luke,

 

Yes I looked through it, but it seems to be concerned with the media directories. I've set the media folders to 777, so there's no access problems I can see there. The fstab is 

//10.1.1.11/tvshows /mnt/tvshows cifs username=****,password=****,file_mode=0777,dir_mode=0777,_netdev 0 0
//10.1.1.12/films /mnt/films cifs username=****,password=****,file_mode=0777,dir_mode=0777,_netdev 0 0
//10.1.1.12/3d /mnt/3d cifs username=****,password=****,file_mode=0777,dir_mode=0777,_netdev 0 0
//10.1.1.13/musicfiles /mnt/music cifs username=****,password=****,file_mode=0777,dir_mode=0777,_netdev 0 0

The windows user on the smb share side has full permissions to the share

The permissions are 

 ls -l /mnt/
total 2688
drwxrwxrwx 2 root root   65536 Jan 30  2021 3d
drwxrwxrwx 2 root root 2097152 Nov 11 17:43 films
drwxrwxrwx 2 root root  524288 Oct 12 18:30 music
drwxrwxrwx 2 root root    4096 Nov 12 13:34 tvshows
 

I can create and delete directories on the smb shares as a normal user without any problems, so it shouldn't be permissions in this area anyway.

I found this in the log file interesting

*** Error Report ***
    Version: 4.6.4.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Linux version 5.4.0-90-generic (buildd@lgw01-amd64-054) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 202
    Framework: .NET Core 3.1.13
    OS/Process: x64/x64
    Runtime: opt/emby-server/system/System.Private.CoreLib.dll
    Processor count: 16
    Data path: /var/lib/emby
    Application path: /opt/emby-server/system
    System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path is denied.
     ---> System.IO.IOException: Operation not permitted

That's what made me think I should change the ownership of the emby-server directory structure to emby:emby

Although the log also shows the initialisation of all the modules, so it's reading okay.

It currently set to;

julianh@media:~$ ls -l /opt/
total 12
drwxr-xr-x 9 root root 4096 Nov 16 07:16 emby-server
-rw-r--r-- 1 root root   68 Nov 16 15:21 sudo
-rw-r--r-- 1 root root   68 Nov 16 15:21 sysctl
julianh@media:~$ ls -l /opt/emby-server/
total 52
drwxr-xr-x  2 root root  4096 Nov 16 07:16 bin
drwxr-xr-x  4 root root  4096 Nov 16 07:16 etc
drwxr-xr-x  5 root root  4096 Nov 16 07:16 extra
drwxr-xr-x  2 root root  4096 Nov 16 07:16 lib
drwxr-xr-x 42 root root  4096 Nov 16 07:16 licenses
drwxr-xr-x  3 root root  4096 Nov 16 07:16 share
drwxr-xr-x  5 root root 28672 Nov 16 07:16 system
julianh@media:~$
 

The first error in the log is a port map, here is this triggering the rest of the errors I'm misinterpreting.

2021-11-16 15:23:51.307 Error HttpClient: <?xml version="1.0" ?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>402</errorCode><errorDescription>Invalid Request!!!!!</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
2021-11-16 15:23:51.319 Error App: Error getting connection info
    *** Error Report ***
    Version: 4.6.4.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Linux version 5.4.0-90-generic (buildd@lgw01-amd64-054) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 202
    Framework: .NET Core 3.1.13
    OS/Process: x64/x64
    Runtime: opt/emby-server/system/System.Private.CoreLib.dll
    Processor count: 16
    Data path: /var/lib/emby
    Application path: /opt/emby-server/system
    System.Net.Http.HttpRequestException: System.Net.Http.HttpRequestException: Name or service not known
     ---> System.Net.Sockets.SocketException (0xFFFDFFFF): Name or service not known
       at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
       --- End of inner exception stack trace ---
       at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
       at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
       at Emby.Server.Connect.ConnectEntryPoint.GetIpAddress(String lookupUrl)
       at Emby.Server.Connect.ConnectEntryPoint.TimerCallback(Object state)
    Source: Emby.Server.Implementations
    TargetSite: Void MoveNext()
    InnerException: System.Net.Sockets.SocketException: Name or service not known
    Source: System.Private.CoreLib
    TargetSite: Void Throw()
       at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
    
2021-11-16 15:23:51.776 Error PortMapper: Error creating port map
    *** Error Report ***
    Version: 4.6.4.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Linux version 5.4.0-90-generic (buildd@lgw01-amd64-054) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 202
    Framework: .NET Core 3.1.13
    OS/Process: x64/x64
    Runtime: opt/emby-server/system/System.Private.CoreLib.dll
    Processor count: 16
    Data path: /var/lib/emby
    Application path: /opt/emby-server/system
    System.Net.Http.HttpRequestException: System.Net.Http.HttpRequestException: An error occurred while sending the request.
     ---> System.IO.IOException: The response ended prematurely.
       at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
       --- End of inner exception stack trace ---
       at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
       at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
       at Mono.Nat.Upnp.UpnpNatDevice.GetSpecificMappingAsync(Protocol protocol, Int32 publicPort, CancellationToken cancellationToken)
       at Mono.Nat.Upnp.UpnpNatDevice.CreatePortMap(Mapping mapping, CancellationToken cancellationToken)
       at Emby.PortMapper.ExternalPortForwarding.CreateRules(INatDevice device, CancellationToken cancellationToken)
    Source: Emby.Server.Implementations
    TargetSite: Void MoveNext()
    InnerException: System.IO.IOException: The response ended prematurely.
    Source: System.Net.Http
    TargetSite: Void MoveNext()
       at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
    
2021-11-16 15:23:51.778 Error HttpClient: <?xml version="1.0" ?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>402</errorCode><errorDescription>Invalid Request!!!!!</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
2021-11-16 15:23:52.277 Error PortMapper: Error creating port map
    *** Error Report ***
    Version: 4.6.4.0
    Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
    Operating system: Linux version 5.4.0-90-generic (buildd@lgw01-amd64-054) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 202
    Framework: .NET Core 3.1.13
    OS/Process: x64/x64
    Runtime: opt/emby-server/system/System.Private.CoreLib.dll
    Processor count: 16
    Data path: /var/lib/emby
    Application path: /opt/emby-server/system
    System.Net.Http.HttpRequestException: System.Net.Http.HttpRequestException: An error occurred while sending the request.
     ---> System.IO.IOException: The response ended prematurely.
       at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
       --- End of inner exception stack trace ---
       at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
       at Emby.Server.Implementations.HttpClientManager.CoreHttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
       at Mono.Nat.Upnp.UpnpNatDevice.GetSpecificMappingAsync(Protocol protocol, Int32 publicPort, CancellationToken cancellationToken)
       at Mono.Nat.Upnp.UpnpNatDevice.CreatePortMap(Mapping mapping, CancellationToken cancellationToken)
       at Emby.PortMapper.ExternalPortForwarding.CreateRules(INatDevice device, CancellationToken cancellationToken)
    Source: Emby.Server.Implementations
    TargetSite: Void MoveNext()
    InnerException: System.IO.IOException: The response ended prematurely.
    Source: System.Net.Http
    TargetSite: Void MoveNext()
       at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
    

What do you think?

Thanks

Julian

JuJuJurassic
Posted

Hi Luke,

I decided to rebuild the box from scratch, I downloaded emby this morning, it was version 4.6.4.0, when I downloaded it this time it's 4.6.5.0, and the problem has disappeared.

Instead I'm getting SSL errors, but I'll look into that before I bother anyone.

could you please close the case and thank you for your help 🙂

Thanks

Julian

Posted

@JuJuJurassic can we please look at the ssl error? Please attach the server log from that. Thanks.

JuJuJurassic
Posted

Hi Luke,

 

Thank you for your help, I've attached the log showing the SSL errors.

I've not set up my emby server with SSL yet, but I can't register my premier key, although I suspect that's due to the fact I also changed my host name from media to emby.

Am I right or are the SSL errors stopping the authorisation of the key?

Thanks

Julian

embyserver.txt

JuJuJurassic
Posted

There seems to be a problem with SSL, here's another post with the problem, it looks more serious than I initially thought

 

Posted

Hi, yes we'll be getting a 4.6.6 update out to resolve it. Thanks.

JuJuJurassic
Posted (edited)

And that's why I moved from plex 🙂

Excellent support

 

As I'm new to emby, is there an easy way to update or do I just run the dpkg -i emby-server-deb_4.6.6.0_amd64.deb, when it's out. Is that today?

Edited by JuJuJurassic
Posted

4.6.6 is rolling out now. Thanks.

JuJuJurassic
Posted

Thanks Luke😀

What’s the upgrade procedure, just run it?

Posted

Just install over the top.

JuJuJurassic
Posted

Thanks Luke, its installed, the Premier key's working now, and it's scanning the media library I triggered the task. at 88.9 seems to pause there, but there's 8-12,000 video files to scan, I'll leave it a couple of days 🙂

 

Posted

Yes I imagine that will take time. Thanks for the feedback.

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