none
sp_syspolicy_events_reader - cannot execute as the database principal

    Question

  • I am receiving large numbers of this error (copied from the Application Event Log).  I can't seem to find any information on this error.  Can anyone help me understand when sp_syspolicy_events_reader would be called, and why it surfaces the error "cannot execute as the database principal ##MS_PolicyEventProcessingLogin##"??

    Event Log: Application
    TimeGenerated: 01/21/2010 03:16:24
    Source: MSSQLSERVER
    Type: Information
    Category: Server
    Event: 9724
    User:
    Computer: XXXX
    Description: The activated proc '[dbo].[sp_syspolicy_events_reader]' running on queue 'msdb.dbo.syspolicy_event_queue' output the following:  'Cannot execute as the database principal because the principal "##MS_PolicyEventProcessingLogin##" does not exist, this type of principal cannot be impersonated, or you do not have permission.'
    Thursday, January 21, 2010 1:26 PM

All replies

  • Hi,

    Take a look at this thread to see if it helps, see
    http://social.msdn.microsoft.com/Forums/en/sqlservicebroker/thread/4be7eb6f-1346-4f6c-8184-a86f39b43e20.
    Chunsong Feng
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, January 22, 2010 9:08 AM
  • Thanks ChunSong, but this is way over my head.  There's no custom code running on my server, just a basic client-server database application... so I have no idea where these conversations are coming from.  How would I trace that down?

    Friday, January 22, 2010 3:07 PM
  • Just chek if the principle is valid on master and msdb securables.

    USE master
    SELECT * FROM sys.database_principals WHERE [name] = '##MS_PolicyEventProcessingLogin##'
    go
    USE msdb
    SELECT * FROM sys.database_principals WHERE [name] = '##MS_PolicyEventProcessingLogin##'
    go
    

    If they found to orphaned users fix them using sp_change_users_login.

     


    Sivaprasad S http://sivasql.blogspot.com Please click the Mark as Answer button if a post solves your problem!
    Friday, August 13, 2010 2:06 AM
  • I realize this is old, but I've got SQL 2012 SP1 and just ran across this problem.  Here's what worked for me...

    I had ##MS_PolicyEventProcessingLogin## in both MASTER and MSDB, but not in the server security folder.  So I went to each of those DBs and used sp_change_users_login like this:

    use [master]
    go
    exec sp_change_users_login 'Auto_Fix', '##MS_PolicyEventProcessingLogin##', NULL, 'UglyPassword01!';
    go
    use [msdb]
    go
    exec sp_change_users_login 'Auto_Fix', '##MS_PolicyEventProcessingLogin##', NULL, 'UglyPassword01!';
    go

    Now, I have no idea what impacts this has on anything, but the errors went away :)


    John Nelson #2

    Tuesday, October 29, 2013 4:59 PM