Export (0) Print
Expand All

Troubleshooting Service Bus

Updated: June 18, 2014

The following sections describe issues that may occur in writing applications for Microsoft Azure Service Bus, and how to resolve them.

Troubleshooting Service Bus Applications

The following sections describe how to troubleshoot Service Bus applications.

Application runs in the development fabric, but crashes when it is deployed

Symptom

An Service Bus application runs without error in the deployment fabric, but crashes after it is deployed to the Microsoft Azure servers.

Cause

The Service Bus assemblies are currently not integrated into the Microsoft Azure platform. Therefore, the application is trying to access an assembly that does not exist on the server.

Resolution

Add the Service Bus assembly to your deployment package (for example, set the assembly to Local Copy). Note that therefore, you will have to update the assemblies manually.

Endpoints can be set programmatically, but fail when set in the configuration file

Symptom

An application works when the endpoints are set programmatically, but fail when those same configuration settings are stored in the associated App.config file. The application generates the following error:

System.Configuration.ConfigurationErrorsException: Configuration binding extension 'system.serviceModel/bindings/netTcpRelayBinding' could not be found. Verify that this binding extension is correctly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly.

Cause

The Service Bus assemblies are currently not integrated into the Microsoft Azure platform. On the local computer, if you have the Microsoft Azure SDK installed, your Machine.config file will be modified to add several Windows Communication Foundation (WCF) extensions, such as NetTcpRelayBinding. The application can then find the relevant information in the Machine.config file, such as in the netTcpRelayBinding section. This does not occur on the Microsoft Azure platform, therefore the application cannot find the relevant information.

Resolution

For your configuration to work with Microsoft Azure, copy the extensions from the local Machine.config file to your App.config file. Otherwise, tags such as netTcpRelayBinding will not be recognized. However, if you do this, your application will not run locally because of duplicate extensions. Therefore, you will have to keep two versions of the App.config file; one locally, and one for Microsoft Azure. It is recommended that you to perform this particular task programmatically.

Connectivity Issues

The following troubleshooting topics contain information about how to connect to the Service Bus. If you cannot find your solution later in this section, you may want to consider one of the following possibilities:

  • Run a network trace – the network may be down. Using Network Monitor to determine the status of the network may assist you in debugging your problem.

Client application cannot find the targeted endpoint

Symptom

When you attempt to connect to Service Bus with a client application, you receive the following error:

Unhandled Exception: System.ServiceModel.EndpointNotFoundException: The endpoint was not found. Please make sure that you can connect to the Internet using HTTP port 80 and TCP port 808.

Cause

There are a variety of possible causes for this error.

Resolution

  • Check to see whether the host is running. If not, there is no endpoint to which to connect. You can run the service by using one of the two procedures that are shown here:

    1. Debug Mode - Right click your service project in the Visual Studio Solution Explorer, click Debug. Then click Start new instance. After the service starts, repeat this procedure for the client. Note that you can debug the client even though the service is already running.

    2. Outside Debug Mode - Set your service project as the start-up project. From the Debug menu, click Start Without Debugging. By doing this, although the service application will run, Visual Studio is not affected. After the service starts, set the client project as the startup project, then run it.

  • Ensure that you have set the Copy Local property for the Microsoft.ServiceBus.dll assembly (in Visual Studio) to true. The cloud servers do not have the Azure SDK installed. Therefore, you must include the assembly with your package. Without it, your worker role will not run correctly.

  • Confirm that you can, in fact, connect to the Internet using HTTP port 80 and TCP port 808.

Client is unable to finish the security negotiation in the configured time-out

Symptom

The application is not able to connect to Service Bus, and instead returns the following error message:

"Client is unable to finish the security negotiation in the configured time-out (00:01:00). The current negotiation leg is 1 (00:00:59.9429968)."

Cause

The authentication credentials may be set incorrectly.

Resolution

Check to see whether you are authenticating the client. Specifically, check to see whether you have you set RelayClientAuthenticationType to None. By default, the value is RelayAccessToken, which requires that you provide an authentication claim, such as a shared secret. However, if you manually set the value to None, the client should not provide any authentication.

If you have not set the authentication type, you likely have RelayClientAuthenticationType with the default RelayAccessToken value. If this is the case, check to see whether your authentication claim is specified correctly. For more information, see Securing and Authenticating a Service Bus Connection.

Application cannot verify security when it connects to the Service Bus

Symptom

When trying to connect to Service Bus, you receive the following error:

"An error occurred when verifying security for the message"

Cause

One possible cause of this error is that the UTC time for the local computer is ahead of the UTC time on the Service Bus server. For example, the local UTC time stamp may be 8:06, whereas on the server the time stamp is 8:05. The server considers this to be an invalid time stamp, and generates the error message that is mentioned in the "Symptoms" section.

Resolution

Confirm that the UTC time for the local computer is correct. If necessary, manually set the clock back several minutes. The Service Bus does not consider slightly older messages to be a security violation; only ones that appear to come from further in the future.

The ATOM feed does not display your service

Symptom

You cannot locate a service on the ATOM feed, even though you know the service is successfully running.

Cause

The default behavior for the service registry is not to expose a service through the ATOM feed.

Resolution

Set the endpoint to be discoverable, as described in How to: Publish a Service to the Service Bus Registry.

Community Additions

ADD
Show:
© 2014 Microsoft