none
Lync 2013 problem with LYSS database operation (GetLyssDBUsage)

    Question

  • Hi,

    I installed a Lync Server 2013 Front End Server and get now the following error in the Lync EventLog:

    Cannot perform a LYSS database operation.

    Message=StoreContext{traceId=[18446744072462389819], activityId=[0a5c9c47-b9f5-4e4e-a4fe-06add87ef232]} GetLyssDBUsage sproc failed: SprocNativeError = [15247]

    Exception: System.Data.SqlClient.SqlException (0x80131904): User does not have permission to perform this action.

    Object 'dbo.ItemQueue' was successfully marked for recompilation.

    Object 'dbo.DataBlob' was successfully marked for recompilation.

       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.SqlDataReader.TrySetMetaData(_SqlMetaDataSet metaData, Boolean moreInfo)

       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

       at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()

       at System.Data.SqlClient.SqlDataReader.get_MetaData()

       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)

       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)

       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

       at System.Data.SqlClient.SqlCommand.ExecuteReader()

       at Microsoft.Rtc.Common.Data.DBCore.Execute(SprocContext sprocContext, SqlConnection sqlConnection, SqlTransaction sqlTransaction)

    ClientConnectionId:4e666c7b-d9a3-43c5-a2a8-9607accedd15

    Stack Trace:    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.SqlDataReader.TrySetMetaData(_SqlMetaDataSet metaData, Boolean moreInfo)

       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

       at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()

       at System.Data.SqlClient.SqlDataReader.get_MetaData()

       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)

       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)

       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

       at System.Data.SqlClient.SqlCommand.ExecuteReader()

       at Microsoft.Rtc.Common.Data.DBCore.Execute(SprocContext sprocContext, SqlConnection sqlConnection, SqlTransaction sqlTransaction)

    Cause: Cannot perform an LYSS database operation.

    Resolution:

    Verify that the data is valid and that the LYSS database is available.

    Has anyone an idea why this is happening? The error message tells that there might be a problem with a user permission. The installation is a basic standard installation. Tried to give the Network Service full Admin permissions of the SQL server with no success.

    Tuesday, March 26, 2013 10:56 AM

Answers

All replies

  • What changed?  I saw something very similar after one of the Windows Updates that installed SP1 for SQL2012.

    Thank you.



    Please “Vote As Helpful” and/or “Mark As Answer” if this post helped you.

    Tuesday, March 26, 2013 1:45 PM
  • Hi, changed nothing, it is a very clean installation of Lync 2013.

    Should I install SQL 2012 SP1?

    Greetings

    Tuesday, March 26, 2013 2:10 PM
  • No, SP1 broke it for me.


    Please “Vote As Helpful” and/or “Mark As Answer” if this post helped you.

    Tuesday, March 26, 2013 3:23 PM
  • Do you have the same errors in eventlog like me?
    Tuesday, March 26, 2013 4:05 PM
  • It was a few months ago. I fixed that problem at that time. I believe that I saw something very similar.

    Go to your Lynclocal database and check if LYSS database is there.

    Thank you.



    Please “Vote As Helpful” and/or “Mark As Answer” if this post helped you.

    Tuesday, March 26, 2013 4:10 PM
  • Checked, Lync LYSS Database is there and OK.
    Tuesday, March 26, 2013 4:16 PM
  • Then, it is different.  In my case Lyss database was disconnected.

    Check if your user has security permissions to that database, including execute permission.

    Thank you.



    Please “Vote As Helpful” and/or “Mark As Answer” if this post helped you.

    Tuesday, March 26, 2013 4:22 PM
  • This point is confusing me. What is the user account that is executing the stored procedure? I suppose it is the Network Service. Executing sp_who2 shows me 1 connection to LYSS database with Network Service User Account.

    This user has the user right to execute.

    Tuesday, March 26, 2013 4:26 PM
  • I checked how it should be and this is what you need:

    If you have more than one Lync server, you have to do it on every Lync server.

    Open SQL Management Studio and connect to Lynclocal instance.

    Right click on Lyss database and click Properties. Select permissions.  There is should be a group called "RTC Component Local Group".  This is the local group for your Lync server. Click on that group and check permissions below.  Grant checkbox should be check next to the Connect and grantor is dbo. (I made a mistake about execute).

    Make sure that your user is a member of that local group.  Make sure that the user is a member of CSAdministrator
    and to RTCUniversalServerAdmins domain groups.

    Thank you.



    Please “Vote As Helpful” and/or “Mark As Answer” if this post helped you.

    Tuesday, March 26, 2013 4:36 PM
  • Is already checked. I gave the user group now also the execute and update permission. I will check this out if this resolves the issue.

    I missed to post the 2nd error message in the log, that appear immediately after the first:

     

    Storage Service had a failure while refreshing its calculation of DB space used.

    DB Space Used Refresh Error. Detected false value for lyssDBUsageReader.HasData() while refreshing LyssDBUsage

    Cause: The Timer task to refresh the DB space used value ran into an exception. This action will be retried and should auto recover.

    Resolution:

    Check event details. If problem persists, notify your organization's support team with the event details.

    Tuesday, March 26, 2013 4:54 PM
  • Added permission execute and update, does not resolve the issue.

    Any other ideas?

    Wednesday, March 27, 2013 6:54 AM
  • Please check you SQL Server configuration for Lync Server 2013.

    http://technet.microsoft.com/en-us/library/gg425848.aspx


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Friday, March 29, 2013 3:28 AM
    Moderator
  • Did you resolve the issue? Please let us know. We have the same pair of errors here.

    Wednesday, July 10, 2013 5:51 PM
  • Nothing got the error in the eventlog fixed.
    Thursday, July 11, 2013 9:18 AM
  • I had the same issue and I was able to resolve the problem by changing the [lyss] database owner to SA.

    The symptom was in the [lyss].[dbo].[GetLyssDBUsage] stored procedure at the line "exec sp_updatestats".

    I verified this line was indeed the problem:

    Edit the [lyss].[dbo].[GetLyssDBUsage] stored procedure and commenting out the following if statement but not the statements inside the if block

            --if (cast(rand() * 10 as int) = 5)

            --begin

                exec sp_updatestats

                exec sp_recompile 'dbo.ItemQueue'

                exec sp_recompile 'dbo.DataBlob'

            --end

    Create a domain user account

    Add that domain user account to the "RTC Component Local Group" local group account on the server running the database engine

    Connect to the database engine as that domain user

    Execute the following query

    DECLARE @GroupIDsTableType GroupIDsTableType

    EXEC [dbo].[GetLyssDBUsage] @_GroupIDs = @GroupIDsTableType, @_SchemaName = 'dbo', @_CheckInProcess = 1

    You should get this error:

                   

    Msg 15247, Level 16, State 1, Procedure sp_updatestats, Line 15

    User does not have permission to perform this action.

    The original owner of the database was a domain user account that had sysadmin rights on the SQL Server instance. I'm not sure why that owner did not work but changing the database owner to SA solved the problem.

    Don't forget to change things back if you edited any code.

    Friday, February 21, 2014 7:25 PM