Setup error 1639 stopped me when I tried installing SQL Server 2019 on my virtual machine. I had not seen this one before. The message talks about a command line argument, but the real cause was something else.

The Error
First, I looked into the SQL Setup Summary.txt file and found the failure:
Feature: Java connector for HDFS data sources
Status: Failed
Reason for failure: An error occurred during the setup process of the feature.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL PolyBase Java
Component error code: 1639
Component log file: C:\Program Files\Microsoft SQL Server\150\Setup Bootstrap\Log\20190726_144242\sql_polybase_java_inst_Cpu64_1.log
Error description: Invalid command line argument. Consult the Windows Installer SDK for detailed command line help.How to Check
If you decode error number 1639 with the Windows net helpmsg command, you see the same text that Summary.txt reported:
net helpmsg 1639
That confirms the code but not the cause. The cause was in the log named in Summary.txt. Here are the lines that matter, ending with the failure:
MSI (s) (E4:80) [14:47:36:552]: Specified instance {7E0C055D-520F-474C-A7ED-755405FBA017} via transform :InstID01.mst;:InstName01.mst is already installed. MSINEWINSTANCE requires a new instance that is not installed.
MSI (s) (E4:80) [14:47:36:552]: MainEngineThread is returning 1639Why It Happens
The line just before the failure says it: the specified instance is already installed. When I searched the internet, I found this comes from an incomplete MSI install.
Then I remembered what had happened. During an earlier install, my virtual machine stopped because I shut down my laptop. I had then uninstalled SQL Server completely, but this one component clearly did not get removed properly.
The Fix
I found that msiexec can uninstall the leftover MSI, which fixes this kind of error. The general form is this:
msiexec /x {GUID}The GUID is in the error message. Here is the command I ran from the command prompt:
msiexec /x {7E0C055D-520F-474C-A7ED-755405FBA017}
Confirm It Worked
As soon as I clicked Yes, it uninstalled the component. I started the install again, and it worked fine.
How to Prevent It
Don’t let the machine stop in the middle of a SQL Server install, and that includes a laptop hosting a virtual machine. If it does happen, remember that an uninstall can leave a component behind.
Have you ever seen this error? Did you find another way to fix it? Please share it in the comments.

Error 1639 is not about your command line, it is about what the last install left behind.
Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.
Discover more from SQL Authority with Pinal Dave
Subscribe to get the latest posts sent to your email.





9 Comments. Leave new
I am getting an error “SQL Server Setup failed to restore the instance name.”
After I enter the command and am asked “Are you sure you want to uninstall this product?”, I respond yes and am returned the message SQL Server Setup failed to restore the instance name. is this what I should expect? Because when I run back through setup to install the database, I receive the same result … exactly what you describe above.
Same result as the two comments above..
Can’t seem to find out anything about this.. Did any of the previous commenters find a solution to this?
getting the same “SQL Server Setup failed to restore the instance name.”
caught on an error loop when running installer
does it needs to be clean reinstall?
Anyone got to the bottom of this issue?
Hi Luis,
Is this still an issue. I am facing the same problem with my SQL Server 2022 install. Please advice.
I am also getting the same “failed to restore” – any advice?
I faced similar issue, the error was same. I found the details in ‘sql_engine_core_inst_Cpu64_1.log’ file
Hi Mohamad Saleh..
I also experienced the issue in SQL server 2022 .. did you solve it .. if yes pls answer