Troubleshooting Event Submission


This section deals with problems that occur while trying to submit events into a SQL-NS application.

Event Provider Is Not Running

This section covers the class of event submission problems that relate to event providers not running.

The SQL-NS Service Hosting the Event Provider Is Not Started

Symptom: Event providers are not running, and the SQL-NS service is either stopped or paused (you can check the service state using the SQL Server Configuration Manager).

Cause: Either the SQL-NS service was never started, or it was stopped or paused explicitly. When the service is installed at registration time, it is not configured to start automatically on boot. Unless you manually changed the service's startup type to Automatic, the service will need to be restarted if a reboot occurred since it was last running.

Action: Start the SQL-NS service, either through the SQL Server Configuration Manager or by invoking the net start NS$<InstanceName> command from a command prompt.

Tip

If you want the SQL-NS service to start automatically when the machine boots, you can configure it for automatic startup, using the Services applet in Administrative Tools. When configuring the SQL-NS service for automatic startup, you must configure the SQL Server service as a dependency if the SQL Server runs on the same machine. Otherwise, the service control manager may attempt to start the SQL-NS service before the SQL Server at boot time. If this happens, the SQL-NS service will fail to start because it will not be able to connect to the SQL Server to access the instance and application database objects.


Event Providers Are Not Enabled

Symptom: Event providers are not running, and their status is reported as Disabled or Disable Pending.

Cause: Either the event providers were never enabled after the instance was created or updated, or they were explicitly disabled.

Action: Use the nscontrol enable command to enable the event providers from the command line. Alternatively, use the Instance Properties dialog box to enable the event providers in Management Studio. The section "Enabling and Disabling Components" (p. 492) in Chapter 14 provides details on the use of these tools.

Incorrect Schedule Supplied for Scheduled Event Provider

Symptom: A hosted, scheduled event provider does not run, or has not run for long period of time.

Cause: An invalid schedule may have been supplied in the event provider's declaration in the ADF.

Action: Examine the event provider's declaration in the <HostedProvider> element in the ADF. Verify that the correct start time and interval are specified.

A Built-In Event Provider Is Unable to Start

Symptom: The Application Event Log on the event provider's host machine contains entries from the NotificationServices event source with event IDs 2001, 2991, 2992, 2981, 2982, or 2983, or any other entry indicating a problem starting the FileSystemWatcher, SQLProvider, or AnalysisServicesProvider.

Cause: Either incorrect arguments were specified for the built-in event provider in its ADF declaration, or the provider encountered an error during its startup operations.

Action: Examine the event log messages for details about the nature of the errors. You may have to edit your ADF so as to supply the correct arguments to the event provider and then update the instance.

A Custom Event Provider Is Unable to Start

Symptom: The Application Event Log on the event provider machine contains entries from the NotificationServices event source with event IDs 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2015, 2017, 2023, or 2024, or any other entry indicating an error loading, instantiating, or initializing a custom event provider.

Cause: SQL-NS was unable to load the event provider class or encountered an error while trying to initialize the provider.

Action: Examine the event log messages for details about the nature of the errors. If the error messages indicate that SQL-NS was not able to instantiate the event provider class, verify that the <ClassName> and <AssemblyName> elements in the event provider's declaration in the ADF specify the correct values. Remember that the class name must include any namespace prefix, and the assembly name must specify a full path or a strong name.

If the event provider was compiled with a later version of the .NET Framework than the one SQL-NS uses (version 2.0.50727 at the time of this writing), you might see an error message saying that the specified event provider class could not be instantiated or was not found in the given assembly. If this is the case, you need to edit the NSService.exe.config file to configure the service to load components built with your version of the .NET Framework. The NSService.exe.config file is located in the binaries subdirectory of your SQL-NS install directory. Open the file in a text or XML editor and add a <startup> element as follows:

 <?xml version="1.0" encoding="UTF-8" ?> <configuration>     <startup>         <supportedRuntime version="v2.1.20321" />         <supportedRuntime version="v2.0.50727" />     </startup>     <system.diagnostics>         <switches>             <add name="LogAdministrative" value="2" />             ...         </switches>     </system.diagnostics> </configuration> 


Make sure there is a <supportedRuntime> element listed in the <startup> element that lists the version of the .NET Framework you are using. After editing the NSService.exe.config file, you must restart the service for the changes to take effect.

Note

The version number shown in the first <supportedRuntime> element in the preceding snippet of the NSService.exe.config file (2.1.20321) is just an example. It does not necessarily correspond to an actual or planned future version of the .NET Framework.


If SQL-NS was able to locate and load the provider but an error occurred during its initialization, you may have to debug your event provider class. Refer to the "Debugging a Custom Component" topic in the SQL-NS Books Online for instructions on how to do this.

Event Providers Do Not Submit Events

The problems covered in this section have to do with event providers that run but do not submit events as expected.

SQL Errors During Event Submission

Symptom: The Application Event Log on the event provider's host machine contains entries from the NotificationServices event source with event IDs in the 2000 range and SQL error messages in their descriptions.

Cause: The event provider was unable to perform a database operation required to submit events. The following are possible causes:

  • The event provider was unable to connect to the SQL Server.

  • The event provider encountered a permissions problem while executing SQL operations.

  • A database operation timed out.

  • A database operation generated a runtime error.

Action: Examine the event log messages for details about the nature of the errors.

If the event log messages indicate that the event provider was not able to connect to the SQL Server, follow the steps for diagnosing connectivity problems outlined in the "Unable to Connect or Log In to the SQL Server" section (p. 508) earlier in this chapter. When doing so, note that hosted event providers attempt to connect to the SQL Server using the credentials of the user under which the SQL-NS engine is running, if Windows Authentication is used. If SQL Server Authentication is used, hosted event providers connect using the SQL username and password supplied at registration time.

If the event log messages indicate permissions problems, see the "Event Provider Security" section (p. 236) in Chapter 8, "Event Providers," for information on the required permissions and database roles for event providers. Make sure you grant the correct permissions to the account the event provider uses to connect to the SQL Server.

If the event log messages indicate a SQL timeout on one or more commands, your SQL Server might be under too much load to execute the commands in a timely manner. You need to investigate the cause of the load on your SQL Server and take measures to alleviate it.

If the event log messages indicate other SQL runtime errors, the body of the error messages usually give clues as to the nature of the problems. The solutions might involve changes to the configuration of the event provider or to the event provider itself (in the case of custom event providers).

Other Event Provider Runtime Errors

Symptom: The Application Event Log on the event provider's host machine contains entries from the NotificationServices event source with event IDs in the 2000 range, containing information about runtime errors that the event provider encountered.

Cause: One or more of the event provider's runtime operations failed.

Action: The event log messages usually give a detailed description of the errors. The problem might be with the event provider itself, or with the event source from which it reads.

No Events Available from External Event Source

Symptom: The event provider is running but not submitting events. There are no errors in the Application Event Log.

Cause: The external event source from which the provider reads events is not supplying any new event data. For example, a stock event provider that reads stock data from a stock market feed might not be receiving events from that feed.

Action: The solution to this problem depends on the nature of the external event source and how events are read from it. The problem might be that the provider cannot connect to the event source, that the event source is not running, or that there really are no new events to submit.




Microsoft SQL Server 2005 Notification Services
Microsoft SQL Server 2005 Notification Services
ISBN: 0672327791
EAN: 2147483647
Year: 2006
Pages: 166
Authors: Shyam Pather

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net