We have a C# web application that is using SQL dependency to expire cached query data. Although everything is working okay we are seeing a lot of errors being generated particularly in our production environment.
The first error messages is this:
Service Broker needs to access the master key in the database 'SubscriberManager'. Error code:32. The master key has to exist and the service master key encryption is required.
It shows up in both the server event log and the SQL server log files. I believe the actual content of the messages something of a red herring as I have created a database master key.
I have also tried
- Recreating both the service master key and the database master key.
- Made sure the database owner is sa.
- Made sure the user account has permissions to create services, queues, procedures and subscribe query notifications
- Made sure the broker is enabled
I have seen other people with similar errors whilst researching the issue but the error code almost always seems to be 25 or 26 not 32. I have been unable to find anything that tells me what these error codes mean so I'm not sure of the significance.
Also I am seeing a lot of errors like this:The query notification dialog on conversation handle '{2FA2445B-1667-E311-943C-02C798B618C6}.' closed due to the following error: '
-8490
Cannot find the remote service 'SqlQueryNotificationService-7303d251-1eb2-4f3a-9e08-d5d17c28b6cf' because it does not exist.'.
I understand that a certain number of these are normal due to the way that SqlDependency.Stop doesn't clean everything up in the database, but we are seeing thousands of these on one of our production servers.
What is frustrating as we have been using SQL notifications for several years now without issue so something must have changed in either our application or the server setups to cause this but at this point I have no idea what.
The applications are .net 4.0 MVC and WCF running on Windows 2012 servers calling SQL 2012 servers also running on Windows 2012.