Trying to configure MLS on SQL Server 2017, but when running a very basic external script like so:
EXEC sp_execute_external_script @language =N'R',
@script=N'OutputDataSet <- InputDataSet;',
@input_data_1 =N'SELECT 1 AS hello'
WITH RESULT SETS (([hello] int not null));
GO
I get this error:
Msg 39021, Level 16, State 1, Line 1 Unable to launch runtime for 'R' script. Please check the configuration of the 'R' runtime. Msg 39019, Level 16, State 2, Line 1 An external script error occurred: Unable to launch the runtime. ErrorCode 0x80070032: 50(The request is not supported.).
And if I look at the log EXTLAUNCHERRORLOG I see:
2020-12-29 17:53:49.554 SetCpuRateCap failed with error code 0x80070032.
I can't find a reference to this error anywhere, and am very perplexted. Tried all kinds of things (checking permissions, turning the resource governor off, updating to latest CU, reinstalling MLS, etc). We have a similar server that is running on same Azure platform (same size, W2012R2, same memory/cpu config), configured about the same time and it seems to not have this issue. This happens with both R and Python services.
Any help would be appreciated.
I have a solution we used today changing from R 3.3.3 and python 3.5.2 to R 3.5.2 and Python 3.7.1.
SQL 2017 CU22 installs the higher value of R & Python, so you have to run an exe to tell SQL to use the higher R & Python versions that were installed on disk.
The fix that worked for us :
(1) Create a new directory e.g. D:\MLSTEMP
(2) Create subdirectories D:\MLSTEMP\ < SQL_instance >00 and D:\MLSTEMP\ < SQL_instance >01
(3) Make sure the local MSSQLLaunchpad service, Everyone group & SQL service account has full access to both the D:\MLSTEMP and the sub dirs.
Note : the < > brackets are not part of the directory name
Note: launchpad service name is : NTService\MSSQLLaunchpad$ < instance_name >
(4) Go to your
D:\Program Files\Microsoft SQL Server\MSSQL14.SQL001\MSSQL\Binn\pythonlauncher.config
and
D:\Program Files\Microsoft SQL Server\MSSQL14.SQL001\MSSQL\Binn\rlauncher.config
files and alter the WORKING_DIRECTORY setting in each file to be WORKING_DIRECTORY=D:\MLSTEMP
(5) Restart the MSSQLLaunchpad service on the box.
Interestingly, the ****01 directory is the one that's used, not the ****00 dir.
It should now work. You may have to play with permissions a bit.
HTH.
User contributions licensed under CC BY-SA 3.0