Beacon services log is throwing this error and the beacons are unable to download the inventory rules and settings.
Beacon Policy Downloader failed to download policy with exception message: Could not download item from https://fnms.xyz.com/inventory-beacons/api/policy
on prem FNMS 2020R1, multi server setup
[ERROR 2020-10-05 06:21:01,091 1628160ms Controllers ] [End][DownloadController.ExecuteAsync]
System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting the varchar value 'Tenant has not been set' to data type smallint.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at ManageSoft.Database.Impl.DatabaseLayerBaseSql.Execute(CommandType p_CommandType, String p_CommandText, DatabaseParameter p_Parameters)
at Flexera.Beacon.Web.Shared.Controllers.DownloadController.GetAllActiveSapLandscapesXml(String tenantUid)
at lambda_method(Closure , Object , Object )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object methodParameters)
at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
Any help and guidance on this thread would be appreciated.
Oct 05, 2020 07:39 AM
Try to check below see if it's the cause
On the IIS on FNMS Batch server: the inventory-beacons service, "Anonymous" authentication is turned on or off? Try to disable it if it's on, if that's the case then the Beacon will work when it's off. OOTB we support only windows auth.
Oct 05, 2020 10:52 PM
@Kevin_Hou's response is marked as the solution to this thread, so this comment may not be directly relevant. However for future reference:
The following message suggests that you are using a database with a multi-tenant schema, but the process reporting this error has connected to the database and is trying to run a query in single-tenant mode:
Conversion failed when converting the varchar value 'Tenant has not been set' to data type smallint.
It is strange that you're seeing this in a beacon services log. That suggests that despite the database being a multi-tenant database there is something in the system that makes the beacon service think it is working with a single-tenant database.
Oct 08, 2020 09:36 PM
Hi @ChrisG ,
Many thanks for you insights and in this scenario we are using a Multi tenant but the no. of tenants we have is only 1.
Not sure how we can overcome /resolve this error and by mistake its accepted as a solution, and any further suggestions on this will be very helpful for us.
Oct 09, 2020 06:15 AM
What do you see if you execute the following SQL statements against your compliance database?
SELECT * FROM DatabaseConfiguration WHERE Property = 'CMMultiTenancy' EXEC sp_helptext 'TableFilter_MT'
On a single-tenant database this should give output like the following:
On a multi-tenant database output should look like:
Oct 09, 2020 07:42 AM - edited Oct 09, 2020 07:59 AM
Hi @ChrisG ,
thanks for the inputs have run the query as suggested have executed the query and attaching the result. Got the output as Multitenant DB config result as per your snapshot.
Please check and suggest.
Oct 11, 2020 11:11 PM
Oct 11, 2020 11:21 PM
So those screenshots definitely confirm that you are working with a multi-tenant database there. However the error appearing in the log from the beacon service suggests that it thinks the system is a single-tenant system and the service isn't connecting to the database in a multi-tenant mode. I'm not sure what information the beacon service uses to determine which mode to operate in though--maybe somebody else has some knowledge of that?
Oct 12, 2020 03:09 AM