marcingminski / sqlwatch

SQL Server Performance Monitor
https://docs.sqlwatch.io
Other
424 stars 168 forks source link

error with SQLwatchImport #477

Closed tune007 closed 1 year ago

tune007 commented 1 year ago

Getting the following error when trying to run SQLwatchImport.exe alone or with any parameters, please advise on how to go forward to fix this.

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.ArgumentNullException: Value cannot be null. Parameter name: Data Source at SqlWatchImport.SqlWatchInstance.get_ConnectionString() in c:\projects\sqlwatch\SqlWatch.Monitor\Project.SqlWatchImport\SqlWatchInstance.cs:line 33 at SqlWatchImport.SqlWatchInstance.d__51.MoveNext() in c:\projects\sqlwatch\SqlWatch.Monitor\Project.SqlWatchImport\SqlWatchInstance.cs:line 706 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result() at SqlWatchImport.Program.<>c.

b__0_0(Options options) in c:\projects\sqlwatch\SqlWatch.Monitor\Project.SqlWatchImport\Program.cs:line 195 at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult1 result, Action1 action) at SqlWatchImport.Program.Main(String[] args) in c:\projects\sqlwatch\SqlWatch.Monitor\Project.SqlWatchImport\Program.cs:line 187

marcingminski commented 1 year ago

Can you include the actual invocation commnad please with all your parameters (you can anonymise them)?

tune007 commented 1 year ago

hi this happens when running SQLwatchImport with or without any parameters, the info pasted above is for when just invoking SQLWatchImport. The same happens when running with SqlWatchImport.exe --add -s SQLinstanceToAdd -d SQLWATCH

marcingminski commented 1 year ago

Yeah without parameters - although I would except this to be handled - that's possible to happen as the error is about empty data source / connection string. However, with correct parameters I am not sure what's going on there. What version of .NET do you have?

marcingminski commented 1 year ago

Have you got the right setting for the repository in the config file, as in https://docs.sqlwatch.io/central-repository/data-import/SqlWatchImport/ ?

tune007 commented 1 year ago

Thanks Marcin, got this sorted, I had the settings wrong in the config file working now