Home Forums SQL Server 2012 SQL 2012 - General An error occurred in Service Broker internal activation while trying to scan the user queue 'msdb.dbo.ExternalMailQueue' RE: An error occurred in Service Broker internal activation while trying to scan the user queue 'msdb.dbo.ExternalMailQueue'

  • Hi jeff,

    This issue seems to be related to databasemail.

    you must be seening the below message or a similer one in your log on regular basis :

    "An error occurred in Service Broker internal activation while trying to scan the user queue 'msdb.dbo.ExternalMailQueue' for its status. Error: 1222, State: 56. Lock request time out period exceeded. This is an informational message only. No user action is required."

    The possible reason is the mails are not getting sent or the databasemail.exe is missing in taskmanager .

    Try:

    ALTER DATABASE [msdb] SET SINGLE_USER WITH ROLLBACK IMMEDIATE

    ALTER DATABASE [msdb] SET DISABLE_BROKER

    SELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb' ;

    ALTER DATABASE [msdb] SET ENABLE_BROKER

    SELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb' ;

    ALTER DATABASE [msdb] SET MULTI_USER

    EXEC msdb.dbo.sysmail_stop_sp;

    EXEC msdb.dbo.sysmail_help_status_sp;

    EXEC msdb.dbo.sysmail_start_sp;

    EXEC msdb.dbo.sysmail_help_status_sp;

    EXEC msdb.dbo.sysmail_help_queue_sp @queue_type = 'mail';