Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Connect to remote R Services (In-Database) #3361

Closed
tkkasimov opened this issue Mar 29, 2017 · 7 comments
Closed

Connect to remote R Services (In-Database) #3361

tkkasimov opened this issue Mar 29, 2017 · 7 comments

Comments

@tkkasimov
Copy link

tkkasimov commented Mar 29, 2017

Can I connect to remote R Services (In-Database) from my notebook with rtools for visual studio? Log Microsoft.R.Host.Broker is below. It seems like R Services (In-Database) from Sql Server 2016 is not supported. Does it so?

[2017-03-29 11:44:12Z] <Microsoft.R.Host.Broker.Startup.Program> (I):
Certificate issued by CN="FQDN"

[2017-03-29 11:44:12Z] <Microsoft.R.Host.Broker.Startup.Program> (I):
Certificate issued to CN="FQDN"

[2017-03-29 11:44:16Z] <Microsoft.R.Host.Broker.Interpreters.InterpreterManager> (T):
Auto-detecting R ...

[2017-03-29 11:44:16Z] <Microsoft.R.Host.Broker.Interpreters.InterpreterManager> (W):
No compatible R interpreters found

[2017-03-29 11:44:16Z] <Microsoft.R.Host.Broker.Interpreters.InterpreterManager> (I):
0 interpreters configured:

[2017-03-29 11:44:16Z] <Microsoft.AspNetCore.Hosting.Internal.WebHost> (D):
Hosting starting

[2017-03-29 11:44:17Z] <Microsoft.AspNetCore.Hosting.Internal.WebHost> (D):
Hosting started

[2017-03-29 11:48:23Z] <Microsoft.AspNetCore.Server.Kestrel> (D):
Connection id "0HL3MG1DQUR4G" started.

[2017-03-29 11:48:23Z] <Microsoft.AspNetCore.Server.Kestrel> (E):
ConnectionFilter.OnConnection
Exception: System.AggregateException: One or more errors occurred. ---> System.NotSupportedException: The server mode SSL must use a certificate with the associated private key.
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionFilter.d__3.MoveNext()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.NotSupportedException: The server mode SSL must use a certificate with the associated private key.
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionFilter.d__3.MoveNext()<---

@MikhailArkhipov
Copy link
Contributor

Have a look here #3315.
We are also working on ability on providing certificates in files rather than in store (#3331).

@MikhailArkhipov
Copy link
Contributor

Did workaround in #3315 (importing certificate or moving it to the trusted root) work for you?

@tkkasimov
Copy link
Author

I did all steps, suggested by @karthiknadig and also moved cert to trusted root. But now I'm have the following error:

[2017-04-04 10:19:54Z] <Microsoft.R.Host.Broker.Interpreters.InterpreterManager> (T):
Auto-detecting R ...

[2017-04-04 10:19:54Z] <Microsoft.R.Host.Broker.Interpreters.InterpreterManager> (W):
No compatible R interpreters found

[2017-04-04 10:19:54Z] <Microsoft.R.Host.Broker.Interpreters.InterpreterManager> (I):
0 interpreters configured:

[2017-04-04 10:19:54Z] <Microsoft.AspNetCore.Hosting.Internal.WebHost> (D):
Hosting starting

[2017-04-04 10:19:55Z] <Microsoft.AspNetCore.Hosting.Internal.WebHost> (D):
Hosting started

[2017-04-04 10:22:54Z] <Microsoft.AspNetCore.Server.Kestrel> (D):
Connection id "0HL3R5DKIC438" started.

[2017-04-04 10:23:00Z] <Microsoft.AspNetCore.Server.Kestrel> (E):
ConnectionFilter.OnConnection
Exception: System.AggregateException: One or more errors occurred. ---> System.ComponentModel.Win32Exception: The credentials supplied to the package were not recognized
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionFilter.d__3.MoveNext()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.ComponentModel.Win32Exception (0x80004005): The credentials supplied to the package were not recognized
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Server.Kestrel.Https.HttpsConnectionFilter.d__3.MoveNext()<---

@karthiknadig
Copy link
Member

Can you check if Network Service has access to the certificate?

@tkkasimov
Copy link
Author

@karthiknadig thanks, it helped me! I did copy cert back to personal, add permission to Network Service and copy back to trusted root. Now problem looks like so in VS:

Connecting to R Workspace failed.
Reason: No R interpreters installed

But I have the R Services (In-Database) from Sql Server 2016 installed

@MikhailArkhipov
Copy link
Contributor

Due to the way SQL installs R it is sometimes difficult to locate. However, you can configure intepreters manually in the broker config file.

In Microsoft.R.Host.Broker.json

“R” {
  “AutoDetect”: true,
  “Interpreters”: {
    “Key1”: {
       “Name1”: “BasePath1”
    },
    “Key2”: {
       “Name2”: “BasePath2”
    },
    …
}

AutoDetect is the default setting and can be omitted. Key1, Key2 etc is what’ll go after # in the URL. Name is supposed to be descriptive.

@tkkasimov
Copy link
Author

Thanks, it helped!

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

No branches or pull requests

3 participants