Lately we moved to SQL 2017 and while trying to execute R script I am receiving the below 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 0x80004005: ."
Script used is below.
Script is working fine for Python.
Any suggestions how can I proceed and check for the possible issues.
asked Feb 05 at 02:32 PM in Default
I don't have SQL Server 2017, but experienced similar problems with R Services (in database) for SQL Server 2016. From what I understand, the most common culprit is the R version mismatch. For example, if SQL Server RTM is installed (without R) and later upgraded to SP1 then using the RTM disk to add R services will not install them properly. Installing machine learning components without internet access lists the matching versions of the cab files for both R (SRO, SPS) and Python (SPO, SPS). One of the ways to fix this problem is to uninstall R Services and then run the setup again to install them.
With 2017, you can try the following: open elevated command prompt, change directory to wherever the SQL Server 2017 setup file is located and use
or whatever you instance name is. If this barks then try to change the features to read this (other flags are the same)
This should silently uninstall just the R Services (The value for Python is SQL_INST_MPY). After that invoking setup normally and opting the route to add features to existing instance should show the R Services box unchecked (so you can now check it) and proceed. From what I experienced, this is a far better option then attempting to reinstall/repair SQL Server installation.
After install completes, restart the SQL Server Services (which will also cause the restart of the launchpad). I am not sure why, but when I tried to test R via round trip similar to yours, I received a very obscure error message stating something like the R Services is configured but is not ready yet so please wait until it is ready. Restarting the SQL Server service (and launchpad) cured this issue.
One more point I would like to mention is "big brother". If you have the domain policies which will mess with configuration settings by the means of logon scripts then everything might work like a clock until the box is restarted, at which time the big brother's logon script might mess something up.
Hope this helps.