Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Connect to Plex Server #1650

Closed
kmlucy opened this issue Oct 31, 2017 · 18 comments
Closed

Cannot Connect to Plex Server #1650

kmlucy opened this issue Oct 31, 2017 · 18 comments

Comments

@kmlucy
Copy link
Contributor

kmlucy commented Oct 31, 2017

Ombi build Version:

V 3.0.2239

Update Branch:

PR

Media Sever:

Plex

Media Server Version:

1.9.6.4385

Operating System:

Host: Debian Stretch
Docker: LSIO - Ubuntu Xenial 16.04.3 LTS

Ombi Applicable Logs (from /logs/ directory or the Admin page):


fail: Ombi.Controllers.External.TesterController[1000]
      Could not test Plex
System.UnauthorizedAccessException: Access to the path '/root/.dotnet/corefx/cryptography/x509stores/ca' is
denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at System.IO.UnixFileSystem.CreateDirectory(String fullPath)
   at System.IO.Directory.CreateDirectory(String path)
   at Internal.Cryptography.Pal.DirectoryBasedStoreProvider.Add(ICertificatePal certPal)
   at System.Security.Cryptography.X509Certificates.X509Store.Add(X509Certificate2 certificate)
   at Internal.Cryptography.Pal.ChainPal.SaveIntermediateCertificates(X509ChainElement[] chainElements, Hash
Set`1 downloaded)
   at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Cer
tificate2Collection extraStore, OidCollection applicationPolicy, OidCollection certificatePolicy, X509Revoca
tionMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan timeout)
   at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate, Boolean th
rowOnException)
   at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate)
   at System.Net.Security.CertificateValidation.BuildChainAndVerifyProperties(X509Chain chain, X509Certifica
te2 remoteCertificate, Boolean checkCertName, String hostName)
   at System.Net.Http.CurlHandler.SslProvider.VerifyCertChain(SafeX509StoreCtxHandle storeCtx, EasyRequest e
asy)
   at System.Net.Http.CurlHandler.SslProvider.VerifyCertChain(IntPtr storeCtxPtr, IntPtr curlPtr)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Api.Api.<Request>d__8`1.MoveNext() in C:\projects\requestplex\src\Ombi.Api\Api.cs:line 69
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Api.Plex.PlexApi.<GetStatus>d__9.MoveNext() in C:\projects\requestplex\src\Ombi.Api.Plex\PlexApi.
cs:line 52
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Controllers.External.TesterController.<Plex>d__49.MoveNext() in C:\projects\requestplex\src\Ombi\
Controllers\External\TesterController.cs:line 201
warn: Ombi.Controllers.External.PlexController[0]
      Error thrown when attempting to obtain the plex libs
System.UnauthorizedAccessException: Access to the path '/root/.dotnet/corefx/cryptography/x509stores/ca' is
denied. ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at System.IO.UnixFileSystem.CreateDirectory(String fullPath)
   at System.IO.Directory.CreateDirectory(String path)
   at Internal.Cryptography.Pal.DirectoryBasedStoreProvider.Add(ICertificatePal certPal)
   at System.Security.Cryptography.X509Certificates.X509Store.Add(X509Certificate2 certificate)
   at Internal.Cryptography.Pal.ChainPal.SaveIntermediateCertificates(X509ChainElement[] chainElements, Hash
Set`1 downloaded)
   at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Cer
tificate2Collection extraStore, OidCollection applicationPolicy, OidCollection certificatePolicy, X509Revoca
tionMode revocationMode, X509RevocationFlag revocationFlag, DateTime verificationTime, TimeSpan timeout)
   at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate, Boolean th
rowOnException)
   at System.Security.Cryptography.X509Certificates.X509Chain.Build(X509Certificate2 certificate)
   at System.Net.Security.CertificateValidation.BuildChainAndVerifyProperties(X509Chain chain, X509Certifica
te2 remoteCertificate, Boolean checkCertName, String hostName)
   at System.Net.Http.CurlHandler.SslProvider.VerifyCertChain(SafeX509StoreCtxHandle storeCtx, EasyRequest e
asy)
   at System.Net.Http.CurlHandler.SslProvider.VerifyCertChain(IntPtr storeCtxPtr, IntPtr curlPtr)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Api.Api.<Request>d__8`1.MoveNext() in C:\projects\requestplex\src\Ombi.Api\Api.cs:line 69
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Api.Plex.PlexApi.<GetLibrarySections>d__11.MoveNext() in C:\projects\requestplex\src\Ombi.Api.Ple
x\PlexApi.cs:line 68
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Controllers.External.PlexController.<GetPlexLibraries>d__9.MoveNext() in C:\projects\requestplex\
src\Ombi\Controllers\External\PlexController.cs:line 88

Problem Description:

I am unable to connect to my Plex Server. I am running Ombi in the LSIO preview container. I have V2 and V3 running side by side with the same settings, and V2 connects fine. I have the 'ignore certificate errors' box checked, and have restarted Ombi. I get this error when I test connectivity:
We could not connect to the Plex server ***
and this error when I try to load libraries:
Access to the path '/root/.dotnet/corefx/cryptography/x509stores/ca' is denied. - Permission denied

#1538

Reproduction Steps:

Install Ombi through LSIO preview container. Attempt to connect to Plex.

@tidusjar
Copy link
Collaborator

Interesting, i'm running the same container and it works fine for me.

Are you able to set the permissions on that folder?

@kmlucy
Copy link
Contributor Author

kmlucy commented Oct 31, 2017

As far as I can tell, the folder does not exist. I haven't been able to find any directory named '.dotnet' or 'corefx' anywhere in the container filesystem.

@tidusjar
Copy link
Collaborator

Can you create that path? I can't seem to find any information on that error other than this: https://stackoverflow.com/a/42345327/3329836

@kmlucy
Copy link
Contributor Author

kmlucy commented Oct 31, 2017

I manually created the folder, set the owner and group to abc, and the permissions to 777, but still get the same errors. I even tried putting the commands in a Dockerfile so they ran before Ombi started, but no change.

I know it has something to do with SSL, because I am able to connect if I set my Plex server to not require secure connections and disable the SSL checkbox in Ombi.

@tidusjar
Copy link
Collaborator

tidusjar commented Nov 2, 2017

@kmlucy
Copy link
Contributor Author

kmlucy commented Nov 2, 2017

After creating the necessary folder path, changing the owner and group of the entire path to abc, and changing the permissions of the entire path to 777, it still doesn't work, but the errors have changed:

We could not connect to the Plex server ***!

and

An error occurred while sending the request. - Server returned nothing (no headers, no data)

Something is weird, because when I manually run curl on my Plex server, I do get back headers and a 401 error message since I didn't include the API key.

Logs:

fail: Ombi.Controllers.External.TesterController[1000]
      Could not test Plex
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Server returned nothing (no headers, no data)
   at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error)
   at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult)
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Api.Api.<Request>d__8`1.MoveNext() in C:\projects\requestplex\src\Ombi.Api\Api.cs:line 69
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Api.Plex.PlexApi.<GetStatus>d__9.MoveNext() in C:\projects\requestplex\src\Ombi.Api.Plex\PlexApi.cs:line 52
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Controllers.External.TesterController.<Plex>d__49.MoveNext() in C:\projects\requestplex\src\Ombi\Controllers\External\TesterController.cs:line 202
warn: Ombi.Controllers.External.PlexController[0]
      Error thrown when attempting to obtain the plex libs
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.CurlException: Server returned nothing (no headers, no data)
   at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error)
   at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult)
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Api.Api.<Request>d__8`1.MoveNext() in C:\projects\requestplex\src\Ombi.Api\Api.cs:line 69
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Api.Plex.PlexApi.<GetLibrarySections>d__11.MoveNext() in C:\projects\requestplex\src\Ombi.Api.Plex\PlexApi.cs:line 68
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Ombi.Controllers.External.PlexController.<GetPlexLibraries>d__9.MoveNext() in C:\projects\requestplex\src\Ombi\Controllers\External\PlexController.cs:line 107

@tidusjar
Copy link
Collaborator

tidusjar commented Nov 2, 2017

@kmlucy
Copy link
Contributor Author

kmlucy commented Nov 2, 2017

Even with both of those installed, the errors are the same.

@tidusjar
Copy link
Collaborator

tidusjar commented Nov 2, 2017

Are you connecting over SSL?

@kmlucy
Copy link
Contributor Author

kmlucy commented Nov 2, 2017

Ah, my bad. I had forgotten to recheck the SSL box after previous testing. The original error message is still occurring, even with the directory manually created, set to 777 permissions, set to the correct owner and group, and both packages installed.

@tidusjar
Copy link
Collaborator

tidusjar commented Nov 2, 2017

In that case I think we need to update the docker image to contain the folder "/.dotnet" with the user's permissions. I know you have stated you have some something similar.

If still no luck i'm going to have to raise an issue with the .Net Core team.
So can you provide as much information as possible, OS version, libcurl version, openssl version etc.

@kmlucy
Copy link
Contributor Author

kmlucy commented Nov 2, 2017

I managed to get it working. I gave 777 permissions to the /root directory. Previously, I had only been modifying the permissions of the /root/.dotnet directory and below. Once those permission are granted to the /root directory, the full path is created under the abc user automatically.

A temporary fix then is for the Docker image to change the /root permissions, but that is not ideal. A better solution would be figuring out why the .dotnet/ directory is being created in /root in the first place. In #1538, someone was saying that on their install, the .dotnet/ directory was in the Ombi app folder, so I'm not sure why the Docker install is different.

@tidusjar
Copy link
Collaborator

tidusjar commented Nov 2, 2017

What's the users home directory? I'm guessing it's not set. Excuse my poor linux knowledge

@kmlucy
Copy link
Contributor Author

kmlucy commented Nov 2, 2017

It is set to /config, and no worries.

@tidusjar
Copy link
Collaborator

tidusjar commented Nov 2, 2017

Hmmm... ok. I'm not sure how much I can help with the Docker image. I suggest you speak to the LinuxServer team?

@kmlucy
Copy link
Contributor Author

kmlucy commented Nov 2, 2017

Will do. Thanks for all the help!

@tidusjar tidusjar closed this as completed Nov 2, 2017
@aptalca
Copy link
Contributor

aptalca commented Nov 2, 2017

FYI, just pushed an update to the docker image that forces those .net folders to be created on /config with the correct permissions

@tidusjar
Copy link
Collaborator

tidusjar commented Nov 2, 2017

Excellent @aptalca !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants