2020-08-03 10:59 AM
I am trying to connect with a database inside Archer DB server using Archer OOB Flexible SQL Data Gateway Connector. I am able to generate the session token, but getting error with Add Connection API.
We are using Archer 6.7.00000.1184. The same connection string is working through a data feed. Kindly help me to resolve the issue.
Below is my JSON request and the error i am getting
API URL: http://xxx.xx.xx/RSAArcher/platformapi/DataGateway/Connections
JSON Request:
{
"TargetId": 374,
"Connection": {
"LocationAlias": "Test_DG1",
"DatagatewayConnector": {
"ConnectorType": "ArcherTech.Datasource.Content.GenericSql.GenericSqlDataSource",
"Properties": [
{
"Name": "dbProviderType",
"Value": "System.Data.SqlClient"
},
{
"Name": "connectionString",
"Value": "Data Source=ARCHER6-6\MSSQLXX;Initial Catalog=Test_DB_DataG;User ID=User12;Password=XXX;TransparentNetworkIPResolution=False"
},
{
"Name": "tableName",
"Value": "dbo.Table_1"
},
{
"Name": "idColumnName",
"Value": "Field_Id"
},
{
"Name": "idColumnType",
"Value": "smallint"
}
]
}
}
}
Error Response:
{"Message":"An error has occurred.","ExceptionMessage":"Object reference not set to an instance of an object.
","ExceptionType":"System.NullReferenceException","StackTrace":"
at ArcherApi.Controllers.ModuleDataGatewayController.Post(DataGateway moduleDataGateway)\r\n
at lambda_method(Closure , Object , Object[] )\r\n
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_1.<GetExecutor>b__3(Object instance, Object[] methodParameters)\r\n
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n---
End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\r\n---
End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\r\n---
End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"}
2020-08-05 09:36 AM
2020-08-05 10:24 AM
I guess, \b is for backspace. For Backslah, its \\. If i use \\, i am getting the below error on running search
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>5</EventID>
<Type>3</Type>
<SubType Name="Error">0</SubType>
<Level>2</Level>
<TimeCreated SystemTime="2020-08-05T07:04:20.1848410Z" />
<Source Name="Archer.NET" />
<Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
<Execution ProcessName="w3wp" ProcessID="14080" ThreadID="20" />
<AssemblyVersion>6.7.0.1184</AssemblyVersion>
<Channel />
<Computer>ARCHERX</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord Severity="Error" xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord">
<TraceIdentifier>Archer.NET</TraceIdentifier>
<UserId>206</UserId>
<Description>No datasource registered for the location: Test_DG1</Description>
<AppDomain>/LM/W3SVC/1/ROOT/RSAarcher-1-132410844792294787</AppDomain>
<Exception>
<ExceptionType>System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>No datasource registered for the location: Test_DG1</Message>
<Source>ArcherTech.Datasource.Content</Source>
<StackTrace> at ArcherTech.Datasource.Content.ContentDatasourceFactory.Create(SessionContext session, ContentPartLocation location)
at ArcherTech.Kernel.Brokers.Search.ContentSearchFilterCreator.Create(SessionContext sessionContext, DatasourceSearchFilterType filterType, ContentPartLocation location)
at ArcherTech.Kernel.Brokers.SearchFilteringBroker.ApplyFilterCriteria(ParseNode node)
at ArcherTech.Kernel.Brokers.SearchFilteringBroker.ProcessFilters(IList`1 nodes, Int32 currLevelId, Nullable`1 logicOperator)
at ArcherTech.Kernel.Brokers.SearchFilteringBroker.ExecuteCriteriaFilters(Int32 levelId)
at ArcherTech.Kernel.Brokers.SearchBuildoutBrokerBase.GetFilteredContent(SearchModuleCriteria moduleCriteria, Int32 levelId)
at ArcherTech.Kernel.Brokers.SearchBuildoutBrokerBase.BuildLevel(SearchModuleCriteria searchModuleCriteria, Int32 levelId, Boolean includeAll)
at ArcherTech.Kernel.Brokers.SearchBuildoutBroker.BuildSingleLevel(SearchModuleCriteria searchModuleCriteria, IDictionary`2 permissions)
at ArcherTech.Kernel.Brokers.SearchBuildoutBroker.Buildout()
at ArcherTech.Kernel.Brokers.SearchEngineBroker.ExecuteSearchBuildout(SearchCriteria criteria, String timeZone, IDictionary`2& searchModules, SearchBuildout& searchBuildout, SearchRequestSource searchRequestSource)
at ArcherTech.Kernel.Brokers.SearchEngineBroker.ExecuteSearch(SearchCriteria criteria, String timeZone, SearchRequestSource searchRequestSource)
at ArcherTech.Kernel.Managers.SearchEngineManager.ExecuteSearch(SessionContext sessionContext, SearchCriteria criteria, String timeZone, SearchRequestSource searchRequestSource)</StackTrace>
</Exception>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>
2020-08-05 10:33 AM
Sorry about that.
Can you point to the IP address?
I dunno if this will work, but from the server running the script, can you update the hosts file to point to the db? That is:
databasename\\withslashes ThisIsShorter
Or
databaseIPaddress ThisIsShorter
2020-08-05 10:49 AM
Yeah, tried that too.. IP address login is not working even for direct sql server connect or from datafeed. I verified the GetConnection Api result and confirmed the data source is having only one \, i.e "Data Source=ARCHER6-6\MSSQLXX;Initial Catalog=Test_DB_DataG;User ID=User12;Password=XXX;TransparentNetworkIPResolution=False". Even by having correct data source, its throwing above error.
2020-08-06 01:52 AM
Hi Rajaram,
just to check if its a single node you can remove the \MSSQLXX (i.e. Data Source=ARCHER6-6 )
and try to login and if it works in SQL client do the same in connection string also.
"Data Source=ARCHER6-6;Initial Catalog=Test_DB_DataG;User ID=User12;Password=XXX;TransparentNetworkIPResolution=False"
"Data Source=ARCHER6-6\MSSQLXX;Initial Catalog=Test_DB_DataG;User ID=User12;Password=XXX;TransparentNetworkIPResolution=False"
2020-08-06 06:45 AM
Nope its having multiple instance. I will need to make this instance as the default instance to try this.
2020-08-06 01:15 PM
Did you do an IIS reset after the API ran successfully? That is required pre-6.8.
2020-08-06 01:24 PM
Yes, Caylor.. Done IIS Reset after api successfull ran.
2020-08-06 01:55 PM
Are you able to log in and access your data with your SQL user to SSMS?
2020-08-06 03:18 PM
Yes, even i am able to connect sql by data feed using the same data source.