Troubleshooting

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 frequently occur with suggestions on how to fix them.

Unrecognized escape sequence

ConvertFrom-StringData : parsing "myInstance\mydatabase" - Unrecognized escape sequence \m.
At C:\DEV\ls-insight\LS Insight 2020.3.1\LS Insight 2020.3.1\DeploymentScript.ps1:429 char:71
+ ... nt $ParameterPath -Encoding UTF8| Out-String | ConvertFrom-StringData
+ CategoryInfo          : NotSpecified: (:) [ConvertFrom-StringData], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromStringDataCommand

This error occurs when the source SQL server is a named instance so there is a "\" in the server path. When this happens, you need to escape the backslash by adding three more. So instead of the server path being myInstance\mydatebase in the parameter file, it should be myInstance\\\\mydatabase.

Resource parameters not unique and non-existing

New server for the project is being created - this will take a few minutes
VERBOSE: Performing the operation "About to process resource" on target "lsinsightv20203-ji.LSInsightV20203-JI".
Get-AzSqlDatabaseImportExportStatus : Cannot bind argument to parameter 'OperationStatusLink' because it is null.
At C:\DEV\ls-insight\LS Insight 2020.3.1\LS Insight 2020.3.1\DeploymentScript.ps1:562 char:78
+ ... tExportStatus -OperationStatusLink $importRequest.OperationStatusLink
+                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidData: (:) [Get-AzSqlDatabaseImportExportStatus], 
ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Azure.Commands.Sql.
ImportExport.Cmdlet.GetAzureSqlDatabaseImportExportStatus

This error occurs when one of the following resource names is not unique and non-existing in the Azure subscription.

  • Azure SQL server (ServerName in parameter file) - must be unique and non-existing in Azure subscription
  • Azure SQL database (DataBaseName in parameter file) - must be unique and non-existing on Azure SQL server

It is always assumed that the resources are created from scratch, so if you have run the Deployment script before with the same parameters and the resources have been created in Azure, you need to either delete them before running again or change the resource names in the parameters.txt file.

If the Azure data factory (ADF) name already exists, the script asks if you want to overwrite it. This should not be done, so you should always answer no to the question and then stop the script, and either delete the ADF from Azure or rename it in the parameter file.

No error when DeploymentScript is run, but resources are not created

If the script finishes and no errors are displayed, but some resources are not created in Azure, it is possible that there is an issue with some of the parameters. If this happens and you are not running the script through VS Code, we recommend using VS Code to run the script. Then you can see if any of the errors mentioned above occur and if the suggested solutions can be used to fix the issue, or at least include the error in a support request.

Also, if something is strange you can check the error log that is created in the project folder once the script has run. All errors that occur are logged to the Error log text file.

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 parameter file. 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 given in the parameter file.

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.

Incorrect company name

Operation on target LookupCurrentWaterMark failed: Failure happened on 'Source' side. 
ErrorCode=SqlOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=
A database operation failed with the following error: 'Invalid object name 'Yay$Gen_ Product Posting Group
$437dbf0e-84ff-417a-965d-ed2bb9650972'.',Source=,''Type=System.Data.SqlClient.SqlException,Message=Invalid 
object name 'Yay$Gen_ Product Posting Group$437dbf0e-84ff-417a-965d-ed2bb9650972'.,
Source=.Net SqlClient Data Provider,SqlErrorNumber=208,Class=16,ErrorCode=-2146232060,State=1,Errors=
[{Class=16,Number=208,State=1,Message=Invalid object name 'Yay$Gen_ Product Posting Group$
437dbf0e-84ff-417a-965d-ed2bb9650972'.,},],'

This error occurs when the company name, provided in the parameter file, does not exist in the database provided. In the example above the incorrect company name is 'Yay'. If you receive this error you need to review the parameters file to make sure that the company name you provide, is the exact name of the company as provided in the Companies table in LS Central.

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.