One of my clients was trying to automate SQL deployment. While testing they were stuck with an interesting error and then they contacted me. In this blog, I would share my learning about an installation error: System.ArgumentNullException – Value cannot be null.
They had an internal website where they would take inputs from the user about the server, instance name, standalone or clustered, features, etc. and based on that they generate a setup configuration file and install SQL using that file. Randomly they noticed that in some cases, installation was failing.
When I was engaged, I asked for the installation log to find the error message from a failed installation. I found the following information in the Detail.txt file.
The following is an exception stack listing the exceptions in outermost to innermost order Inner exceptions are being indented
Exception type: System.ArgumentNullException
Value cannot be null.
Parameter name: instanceName
HResult : 0x80004003
at Microsoft.SqlServer.Configuration.Fulltext.Util.IsDefaultInstanceName(String instanceName)
From Summary.txt, I was able to find the configuration file parameter which points to the setup configuration file of SQL Server.
As you can imagine, the issue was due to an empty value of the parameter. After carefully examining the files, we found that the InstanceName parameter was missing in the file in certain conditions. They thought since it is a default instance, they need not pass anything, but we needed to pass MSSQLSERVER.
They changed their code to take care of this empty value, the issue was resolved.
Reference : Pinal Dave (https://blog.sqlauthority.com)