Setup Error 1639: Invalid Command Line Argument in SQL Server

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.

Gouache painting of a half-assembled wooden birdhouse on a workbench, with one vermilion peg in its top and the unused pieces lying beside it

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

Command prompt running net helpmsg 1639, which returns: Invalid command line argument. Consult the Windows Installer SDK for detailed command line help.

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 1639

Why 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}

Command prompt running msiexec /x with the GUID, and a Windows Installer dialog asking: Are you sure you want to uninstall this product?

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.

Quick reference card: Setup error 1639

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.

Command Line, SQL Error Messages, SQL Scripts, SQL Server, SQL Server Installation
Previous Post
QUOTENAME Function: Custom Quote Characters and Dynamic SQL
Next Post
Error 35296: Log Backup on Secondary Replica Fails in a Distributed Availability Group

Related Posts

9 Comments. Leave new

  • Francis Leary
    July 29, 2020 4:33 am

    I am getting an error “SQL Server Setup failed to restore the instance name.”

    Reply
  • 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.

    Reply
  • 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?

    Reply
  • 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?

    Reply
  • Mohamad Saleh
    August 9, 2023 3:37 am

    Anyone got to the bottom of this issue?

    Reply
  • Mohamad Saleh
    August 9, 2023 3:39 am

    Hi Luis,
    Is this still an issue. I am facing the same problem with my SQL Server 2022 install. Please advice.

    Reply
  • I am also getting the same “failed to restore” – any advice?

    Reply
  • I faced similar issue, the error was same. I found the details in ‘sql_engine_core_inst_Cpu64_1.log’ file

    Reply
  • GEETHIKA DEVI KOTAMSETTY
    August 25, 2025 12:00 am

    Hi Mohamad Saleh..
    I also experienced the issue in SQL server 2022 .. did you solve it .. if yes pls answer

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.