Troubleshooting the Service Bus
The following sections describe issues that may occur in writing applications for the Windows Azure Service Bus, and how to resolve them.
Troubleshooting Windows Azure Applications
The following sections describe troubleshooting Windows Azure applications.
Application runs in the development fabric, but crashes when it is deployed
An Service Bus application runs without error in the deployment fabric, but crashes after it is deployed to the Windows Azure servers.
The Service Bus assemblies are currently not integrated into the Windows Azure platform. Therefore, the application is trying to access an assembly that does not exist on the server.
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
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.
The Service Bus assemblies are currently not integrated into the Windows Azure platform. On the local computer, if you have the Windows 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 Windows Azure platform, therefore the application cannot find the relevant information.
For your configuration to work with Windows 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 Windows Azure. It is recommended that you to perform this particular task programmatically.
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
When you attempt to connect to the 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.
There are a variety of possible causes for this error.
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:
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.
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.
- 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.
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 Windows 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
The application is not able to connect to the Service Bus, but 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)."
The authentication credentials may be set incorrectly.
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
When trying to connect to the Service Bus, you receive the following error:
"An error occurred when verifying security for the message"
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.
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
You cannot locate a service on the ATOM feed, even though you know the service is successfully running.
The default behavior for the service registry is not to expose a service through the ATOM feed.
Set the endpoint to be discoverable, as described in How to: Publish a Service to the Service Bus Registry.