SQL Server connectivity errors

When an application loses access to the database it may present an error. The error text will list that the connection is closed or is not open or available.

Last Updated: 3/4/2021

Common Causes

  • Network adapter power management settings
  • Network cables and equipment issues
  • Connecting to SQL Server over a wireless network
  • SQL Server issues

Environment / Applies To

  • Plant Supervisor 4
  • Plant Supervisor PSX
  • Self-Serve 2
  • Truck Scale Management
  • Bulk Receiving Terminal 2

Many Kahler Automation applications require access to a database that is hosted by Microsoft SQL Server. Typically SQL Server is installed on a computer designated as the 'server' computer. This server computer may be a stand alone computer or may also run other Kahler software programs.

If an application is unable to communicate with the SQL Server, it may display an unhandled exception error: 

System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is closed.

Solution Summary

Restart the server computer. Ensure the server computer has a solid network connection. 

Solution In-Depth

Network adapter power management settings

Network adapter power management settings on the server computer may interfere with an applications ability to communicate with SQL Server.

The option to allow the server computer to turn off the network adapter should be disabled.

To disable the option to allow the server computer to turn off the network adapter:

  1. Right click on the win_10_start_icon (Start Menu) and select Device Manager
  2. Find and double-click Network adapters
  3. Right-click the device listed and click on Properties

  4. Navigate to Power Management tab and uncheck the option Allow the computer to turn off this device to save power

Some network adapters may contain additional power management settings, which may be found under Advanced settings, or under individual properties in the Details tab.

Network cables

Faulty network cables may cause connectivity problems.

Note: The steps described in this section may require the assistance of an electrician or an IT professional.

  • Inspect network cable terminations to verify that they have been correctly terminated (all wires reach the end of the connector) and that there are no signs of corrosion
  • Inspect fiber optic cable terminations to make sure there are no contaminants blocking the signal
  • Ensure that network cables are not damaged in a way that may cause intermittent open/short circuits (cable may be damaged where it passes through walls, doors, etc. A visual inspection of the cable to ensure that it is not pinched, showing signs of rubbing or wear on the outer jacket, or any other physical damage has occurred)

Tip: A temporary replacement network cable can be used to quickly identify if the current cable is the problem.

  • Ensure that network cables do not exceeding ratings (see table below):
Cable type Speed ratings Maximum length
Cat 5 10 Mbps, 100 Mbps 328 feet (100 meters)
Cat 5e 10 Mbps, 100 Mbps, may support Gigabit 328 feet (100 meters)
Cat 6 10 Mbps, 100 Mbps, 1000 Mbps (Gigabit) 328 feet (100 meters)

 

Note: While Cat5e is specified to support 1000 Mbps (gigabit), only Cat6 is certified for 1000 Mbps.

Tip: Temporarily lowering the computer network adapter maximum connection speed to 10 Mbps can be done to determine if the problem is due to a cable that has exceeded ratings. If after lowering the connection speed connectivity issues stop, it is possible the issue is due to a cable that has exceeded ratings.

Network equipment

Misconfigured or faulty network equipment may cause connectivity problems.

Note: The steps described in this section may require the assistance of an IT professional.

Ensure that network equipment is configured to allow the necessary network traffic between applications and the server computer.

Connectivity issues may occasionally be resolved by resetting (power off and on) network equipment (switches, routers, etc.). If resetting network equipment is regularly needed to resolve connectivity issues, it may be a sign that the network equipment has been damaged or is about to fail.

Wireless network (WiFi)

Communication between Kahler Automation applications and SQL Server over a wireless network is not recommended. While wireless networks may be acceptable for web traffic, the reliability and bandwidth capabilities of a wireless network are not sufficient for database connectivity.

Note: Some Kahler Automation applications (e.g., Staged Order Viewer) do not need constant access to the database and can tolerate temporary connection losses.

SQL Server

There may be issues with SQL Server. Review SQL Server logs to see if any errors or unusual activity (e.g., restarts) occurred around the time that the application indicated the problem.

Windows log

Inspecting the Application and System logs in the Windows Event Log may provide insight into any related issues that the server computer or computer running the application may be having, which could cause problems.

Still Need Help?

Submit an online web ticket or call us at Kahler Automation 507-235-6648 Option 2.