Troubleshooting stubs

You can use workarounds to common problems that you might encounter when you use stubs.
Table 1. Resolutions for problems with stubs
Problem Resolution
The stub is producing this error message in its console output. [CRRIT1717E] The socket associated with the request message is no longer available.

This error is produced when a Send Reply action is unable to communicate with the client system that issued the request message. The most likely cause is that the client already received a reply from another Send Reply action within the stub and its connection is closed. This situation can occur when you have multiple events in the same HTTP stub that processes the same messages. If you have filtering configured that allows more than one event to reply to the same message, only one of them succeeds. The second Send Reply action fails with this error as the client is disconnected.

Check your filtering configuration to prevent multiple matches in different events.

Consider redesigning the stub to have a single event for these messages. Duplicate the event for each message type and configure filtering.

The stub is not logging events. In the Environments dashboard for HCL Quality Server (or in HCL OneTest™ API), verify that the stub has been configured to Log.

Alternatively, if localhost has been configured as the logging URL, logging will not work if the stub is run on a different agent.

Unable to configure routing to the stub When starting a stub in HCL OneTest API, you might see the following error on the console:
[CRRIT8674E] Unable to configure routing to the stub: 409 Conflict

This error might also appear in the HCL OneTest API Agent log file.

The problem occurs when you create two stubs with the same transport and operation and try to run both at the same time. The solution is to only run one at a time. You should be able to delete one of the stubs.

The stub running on the agent cannot connect to the results database. Ensure that the computer running the stub and the computer running HCL Quality Server have the required network connectivity to access the project results database.
The required database driver is missing. If you are using a MySQL driver, ensure that it has been installed correctly.

If you are using a non-standard JDBC driver, ensure that it is included in the CLASSPATH of the computer where HCL Quality Server is installed.

The traffic is not being routed to the stub.
  • Check the routing rule in the HCL Quality Server, Infrastructure Dashboard. If the rule is missing or has incorrect host name or IP address, fix it and then try to restart the stub.
  • Check the stub console output that is available on the location that contains the agent logs.
  • While starting the stub, a warning message "Failed to resolve host name" may be displayed. This issue occurs if the DNS lookup fails and the routing rules are not created correctly. To resolve this, check that you have connected to the correct network, specifically check whether the stub or environment is using host names from a private network.
  • If the problem still occurs, contact the system or network administrator to investigate the DNS resolution problems.
The proxy or intercept for the transport is not routing the traffic to the stub.

When you start stubs, they wait for the external proxies to retrieve the routing configuration rules from the server before they can complete the initialization process and start the main steps. Hence, when you run test suites that use stubs, the tests will not start until the proxies have received their configuration rules.

When there is a problem, verify the following things:
  • The proxy is registered for the domain that is selected in the HCL OneTest API project settings and the project's current environment or it is registered for all the domains and environments.
  • The proxy is running and there are no networking problems. Check the status of the proxy on the Infrastructure Dashboard in HCL Quality Server or in the HTTP/TCP proxy logs.
A sample for the stub console output that indicates that the configuration rule has not reached the external proxy in the allotted time is as follows:
[03/02/2015 11:41:21.382 AM] - - - - Starting initialization - - - -
[03/02/2015 11:41:21.382 AM] [Infrastructure] Sending routing configuration 
to HCL Quality Server...
[03/02/2015 11:41:28.394 AM] [Infrastructure] [CRRIT8674E] Unable to 
configure routing to the stub:
None of the available connected agents have been successfully configured. 
There are currently 1 connected agent(s) registered with HCL Quality Server.
[03/02/2015 11:41:28.394 AM] [Infrastructure] Application traffic in 
the environment will not be automatically routed to the stub.

In this example, only a single proxy is registered with HCL Quality Server. Either the proxy process stopped and its registration did not time out yet or the proxy could not connect to HCL Quality Server, and hence the proxy rules could not be applied in the allotted time.

If no proxies are registered with HCL Quality Server, you will see the following messages in the stub console output:
[03/02/2015 11:45:01.861 AM] - - - - Starting initialization - - - - 
[03/02/2015 11:45:01.861 AM] [Infrastructure] Sending routing configuration 
to HCL Quality Server... 
[03/02/2015 11:45:01.873 AM] [Infrastructure] [CRRIT8674E] Unable to 
configure routing to the stub: There are no connected HTTP(S) agents 
registered with HCL Quality Server in domain "default" and 
environment "example.com with proxy". Please check the configuration 
of the agents and control panel. 
[03/02/2015 11:45:01.873 AM] [Infrastructure] Application traffic in 
the environment will not be automatically routed to the stub.
For more troubleshooting tips, see Troubleshooting the HTTP/TCP proxy.
Publishing stubs from HCL OneTest API to HCL Quality Server fails with error Error: 507 (Insufficient Storage). Free up some space in the disk used by HCL Quality Server. To know which location is being used, look in the container.server.properties file for the workingDirectory property. The default location of the container.server.properties file is:
  • For versions 8.5.1.0 and newer:
    • Windows systems: C:\Program Files\HCL\HCLProducts\QualityServer\usr\servers\defaultServer\apps\RTCP.war\WEB-INF\classes
    • Systems other than Windows: /opt/HCL/HCLProducts/QualityServer/usr/servers/defaultServer/apps/RTCP.war/WEB-INF/classes
  • For versions earlier than 8.5.1.0:
    • Windows systems: C:\Program Files\HCL\HCLProducts\QualityServer\webapps\RTCP\WEB-INF\classes
    • Systems other than Windows: /opt/HCL/HCLProducts/QualityServer/webapps/RTCP/WEB-INF/classes
The TCP port number configured in the stub is already in use. Use the netstat command to see which port numbers are in use by which processes. If client programs are accessing the stub by using the TCP/HTTP proxy you can ignore this warning message. The Proxy will correctly route messages to the stub even if it using a temporary port number. If, however, you must run the stub on a fixed port, use the diagnosis results to take any of the following actions:
  • Configure a different port number for the stub. Either select a different transport for the operation in Architecture School > Logical View or modify the existing transport to use a different port number.
  • Terminate the program that is using the port number, and restart the stub.
The stub cannot be opened in the Stub Editor. You have created a stub from an operation that is a Subscribe action. The stub has the opposite messaging action which is a Publish. This type of stub cannot be edited in the Stub Editor. You must edit it using the Test Editor, which is normally used for editing test sequences.

When a stub is created, its messaging actions will be the reverse of the operation in order to simulate the server end of communication. For example, a Send Request/Receive Reply operation gives a stub of the form Receive Request/Send Reply. This type of stub has a Message Switch action and by default is edited in the Stub Editor. You can choose to edit it in the Test Editor by right-clicking the object in the Test Factory tree and selecting Open With > Test Editor. This option is not recommended for more complex stubs.

For a subscribe operation, the stub action is a publish. This cannot be edited in the Stub Editor because it expects an input message. Editing this type of stub will launch the Test Editor and you will see the Publish test action.

Feedback