Troubleshooting

Onboarding script errors

Azure data factory pipeline errors

Onboarding script errors

Sometimes the onboarding script fails, no errors are displayed in the PowerShell client, and no resources are created in Azure. When this happens, it is best to run the script with VS Code and then the errors will appear. Other times the onboarding script displays the error in the terminal window of the PowerShell client. The following is a list of a few errors that can occur and how to fix them.

Wrong password provided for admin user on existing SQL server in Azure

If you decide to deploy the LS Insight Data Warehouse database to an existing SQL server in Azure you need to enter a username and password for that server. If you provide the wrong credentials and the script fails to restore the LS Insight DW to the server you will get the following error when running the deployment script.

Creating a new Azure SQL database. This might take a few minutes...
WARNING: Something went wrong :(
Response status code does not indicate success: 400 (Bad request).

To double check what is happening you can go into the SQL server in Azure portal and check the Import/Export history. There you should be able to find the database you were importing and if you click on the database name link you should see the reason why the import failed.

To recover from this you need to run the deployment script again and make sure you have the correct user name and password for the SQL server. If you run the deployment script again without closing VS Code it will retain all the parameters except passwords so if you entered the wrong user name you need to make sure you select not to reuse the one you entered before. You will be prompted for reuse of each parameter by the script.

Wrong user name and/or password for user on SQL server on-premises

If you decide to deploy the LS Insight Data Warehouse database to an existing SQL server on-premises/VM you need to enter a user name and password for that server. If you provide the wrong credentials the script will not be able to write the companies you have selected to the database and you will get the following error when running the deployment script.

Adding company into the LS Insight database...
WARNING: Something went wrong :(
Login failed for user 'xxxx'

To recover from this you need to run the deployment script again and make sure you have the correct user name and password for the SQL server and that the user you are using has read and write permissions on the database you just imported to the SQL server. If you run the deployment script again without closing VS Code it will retain all the parameters except passwords so if you entered the wrong user name you need to make sure you select not to reuse the one you entered before. You will be prompted for reuse of each parameter by the script.

Azure module too old

The LS Insight PowerSshell deployment modules need have the correct Az powershell module setup. If your Az module is too old, you will get the following error when the deployment script is creating the SQL database in Azure:

Creating a new Azure SQL database. This might take a few minutes...
WARNING: Something went wrong :(
Cannot bind argument to parameter 'StatusMessage' because it is an empty string.

You need to run PowerShell/VS code "as administrator" to be able to check and update the module. To check what Az module is installed, run the following in PowerShell:

 Get-InstalledModule Az

This should list all modules that are installed and the Az module should be on top. The version there should be 5.7. If it is not, you can run the following command to to update the Az module:

 Install-Module -Name Az -RequiredVersion 5.7.0

You can then run the Get-InstalledModule Az again to check if the module has been updated to 5.7, and if it has, you are ready to re-run the deployment script.

Azure data factory pipeline errors

There can be several reasons why a pipeline fails to run. If you hover the mouse over the talk bubble icon in the error column of the pipeline monitor page, the error is displayed. Here is a list of a few of the most common errors that occur and suggegstions for how to fix them.

Connection to LS Central source database fails

Operation on target LookupCurrentWaterMark failed: ErrorCode=SqlFailedToConnect,
'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Cannot connect to SQL Database: 
'LSR000054',Database: 'mydatabase2', User: 'skynet'. Check the linked service configuration is correct, 
and make sure the SQL Database firewall allows the integration runtime to access.,Source=Microsoft.DataTransfer.
ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=Cannot open database "mydatabase2" requested by 
the login. The login failed. Login failed for user 'skynet'.,Source=.Net SqlClient Data Provider,
SqlErrorNumber=4060,Class=11,ErrorCode=-2146232060,State=1,Errors=[{Class=11,Number=4060,State=1,Message=Cannot 
open database "mydatabase2" requested by the login. The login failed.,},
{Class=14,Number=18456,State=1,Message=Login failed for user 'skynet'.,},],'

When this error occurs, something is wrong with the LS Central source information in the ADF. You must check the following parameters:

  • $SourceServerName
  • $SourceDatabaseName
  • $SourceUserName
  • $SourcePassword

Make sure that you have the correct server and database names and that you are using SQL user, and not Windows user, user credentials. LS Insight does not allow the use of Windows user credentials, so you need to create or use an SQL user that has read permission to the source database.

To make sure that your server, database, and user credentials are working, you can connect through SQL Server Management Studio on the machine where you are going to set up the integration runtime gateway, and verify that you can connect to and run a SQL query on the database or do test connection from the LSCentralSource linked service in the ADF.

Integration runtime gateway turned off

Operation on target LookupCurrentWaterMark failed: The Self-hosted Integration Runtime 
'LSInsight-integrationRuntime' is offline,last connect time is '06/03/2020 16:43:56.832'.

When this error occurs the machine, where the integration runtime gateway is running, has been turned off. It is very important that the machine, where the gateway is set up, is up and running when the pipelines are scheduled to run. This machine also needs to have access to the source database using the credentials provided in the parameter file.