IMD SolutionComputing LibraryShop main store

Troubleshooting

Why Ignition cannot connect to SQL Server Express named instance

Edge computing and IIoT Published 8 min read By IMD Solution engineering team

Short answer

The Gateway is dialing the wrong endpoint: it asks for the default instance MSSQLSERVER on localhost while your database is the named instance SQLEXPRESS. Correct the host and instance in the Gateway connection first; then prove server-side TCP/IP is enabled and choose discovery through the Browser service on UDP 1434 or a fixed port; credentials come last.

On this page
  1. What the receive timeout actually says
  2. Fix the endpoint: host and instance first
  3. Prove the engine accepts TCP
  4. Instance-name discovery or a fixed port: pick one
  5. Worked example: DESKTOP-ENHKM1F\SQLEXPRESS on a fixed port
  6. Work the checks in this order
  7. When credentials finally matter
  8. Questions asked

The receive timeout means the Gateway never reached a database endpoint at all: it is calling the wrong instance through the wrong channel, not failing a login. Your connection asks for the default instance MSSQLSERVER on localhost, while the installed database is the named instance SQLEXPRESS on the machine DESKTOP-ENHKM1F. Work the fault in order: correct the host and instance in the Gateway's database connection; prove that TCP/IP is enabled on the server side; then choose between instance-name discovery through the SQL Server Browser service and a fixed TCP port. Only when the error text changes from a timeout to a login failure do credentials and permissions come into play. Every check below runs on the database computer except the one that edits the Gateway connection.

What the receive timeout actually says #

The driver reports the fault like this: Cannot create PoolableConnectionFactory (The connection to the host localhost, named instance MSSQLSERVER failed. Error: "java.net.SocketTimeoutException: Receive timed out". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434. For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host.)

Read it as three claims. The host is localhost, the instance is MSSQLSERVER, and the failure is a socket receive timeout — a refusal or a login error would look different. The PoolableConnectionFactory wrapper only says the connection pool's first attempt failed; the nested text is the real fault. A JDBC connection that carries an instance name must first learn which TCP port serves that instance, and it asks the SQL Server Browser service, which Microsoft documents as claiming UDP port 1434 when it starts.

Receive timed out means that discovery question got no answer: the Browser service is not running, the UDP packet is filtered on the way in, or the lookup can never succeed because the requested instance does not exist. Here the third condition is already true — the requested name is the default instance, and this Express install registered a different one. No firewall edit can rescue a discovery lookup for an instance name that was never installed.

Fix the endpoint: host and instance first #

localhost resolves inside the process making the call. The database connection is opened by the Gateway process, not by the browser window that shows its configuration page, so localhost always means the computer running the Gateway. On this case's single Windows 10 test machine the Gateway and SQL Server Express share one box and a localhost host is legitimate; on any split setup it must be replaced with the database computer's name or address.

The instance is the outright error. MSSQLSERVER is the name SQL Server gives its default instance, while SQL Server Express installs as a named instance — SQLEXPRESS on this machine. A connection can truthfully carry the host alone for a default instance, or the host plus the named instance, but the pair localhost plus MSSQLSERVER matches neither, so the driver asks the Browser for an instance that is not there.

In the Gateway, open the connection in the Configure section: the Ignition manual for SQL Server Express documents a Server (Instance Name) item, and that item must hold SQLEXPRESS here. Save and test. If the next error still names MSSQLSERVER, the effective configuration still holds the old value, or a different connection is being tested. Express and LocalDB fail differently at this stage: if the target is actually LocalDB, work through why an Ignition Gateway cannot connect to SQL Server LocalDB instead.

Prove the engine accepts TCP #

A running SQL Server (SQLEXPRESS) service is not proof of a TCP listener. SQL Server Express installs with TCP/IP disabled by default, and local tools connect through a local transport that never touches TCP, so every local check can pass while the Gateway cannot get in. Enable the server-side protocol in SQL Server Configuration Manager: under SQL Server Network Configuration, select Protocols for SQLEXPRESS and set TCP/IP to Enabled. The separate Client Protocols list only governs clients running on that machine; enabling TCP there does nothing for the engine's listener.

Restart the SQL Server (SQLEXPRESS) service in an agreed maintenance window — protocol and port settings apply only at startup, and the engine plus everything reading it is down for the restart. Then open the fresh SQL Server error log: the startup entries name the addresses and ports the engine is listening on. A TCP listener in that log proves the engine side; no TCP listener means no firewall rule will help. If the listener binds only a local address, a Gateway on another computer still cannot reach it even with the port open.

Instance-name discovery or a fixed port: pick one #

With TCP enabled, a named instance is addressable two ways, and testing works best when you commit to one before touching the Gateway again.

  • Discovery: leave the Server (Instance Name) item at SQLEXPRESS and set no port. The SQL Server Browser service must be running on the database computer, and inbound UDP on its discovery port must pass that computer's firewall. The engine may take a different port at each restart; discovery exists to chase it.
  • Fixed port: in the TCP/IP properties for SQLEXPRESS, under IPAll, clear the dynamic-port entry and set the TCP port to 1433, restart the service, and confirm the new listener in the error log. The Gateway connection then carries the host plus that fixed port with an empty instance field, and neither the Browser service nor UDP is involved.

Do not set an instance name and a port in the same connection while testing: pick the mechanism you want to prove and let the other stay out, or a passing test proves nothing about either path.

Path The Gateway connection carries The database computer must provide
Instance-name discovery host plus SQLEXPRESS, no port Browser service running; inbound UDP on the discovery port
Fixed port host plus the fixed port, instance empty TCP listener on the fixed port; inbound TCP on it when the Gateway is remote

Worked example: DESKTOP-ENHKM1F\SQLEXPRESS on a fixed port #

Inputs. The machine is DESKTOP-ENHKM1F, the Windows 10 test PC in this case, running both the Gateway and SQL Server Express; the installed instance is SQLEXPRESS; the chosen listener is TCP port 1433 under IPAll, the fix recorded for this case; UDP 1434 stays out of the design because the fixed-port path never performs discovery.

Rule in words. A fixed-port endpoint is the database host plus the listening TCP port, with the instance field empty — no instance name, so no Browser lookup.

Construction. Assemble the endpoint from its three parts, host, port separator and fixed port:

DESKTOP-ENHKM1F + : + 1433 → jdbc:sqlserver://DESKTOP-ENHKM1F:1433

In the Gateway connection the same assembly reads as server address DESKTOP-ENHKM1F, the fixed port, and an empty Server (Instance Name) item.

Prerequisites on the database side. TCP/IP enabled under Protocols for SQLEXPRESS, IPAll carrying the fixed port with its dynamic-port entry cleared, and a service restart to apply both.

Result. After the restart the SQL Server error log lists a TCP listener on the fixed port. That log line, not the Gateway page, is the proof that the endpoint exists; without it the assembled endpoint is a guess.

Decision. If the startup log lists 1433, enter the assembled endpoint in the Gateway: the connection either opens, or the fault moves on to authentication. If it lists any other port, the dynamic-port entry was not cleared — clear it, restart, and re-read the log before editing the Gateway again. And if the Gateway later moves off DESKTOP-ENHKM1F, the only new requirement is an inbound TCP rule for that same fixed port on the database computer.

Work the checks in this order #

  1. Correct the endpoint: the host is the database computer (localhost only when the database shares the Gateway's machine), and the instance is SQLEXPRESS — or empty, once a fixed port is set.
  2. Enable TCP/IP under Protocols for SQLEXPRESS in SQL Server Configuration Manager; the Client Protocols list is not the server listener.
  3. Restart the engine service in an agreed window and confirm the listener in the fresh SQL Server error log.
  4. Commit to one addressing path: instance-name discovery with the Browser service running, or the fixed port with the instance field empty — never both.
  5. Open the database computer's firewall only for what the log shows: inbound UDP on the discovery port for the discovery path, inbound TCP on the listening port once the Gateway runs elsewhere.
  6. Read the new error text before changing anything else: a receive timeout still points at the endpoint or discovery, while a login failure finally moves the fault to credentials.

When credentials finally matter #

A timeout and a login failure are different fault classes, and the error text tells you which one you are in. When java.net.SocketTimeoutException disappears and the message becomes a login failure, the TCP path and the endpoint are proven; the questions left are whether the engine accepts SQL authentication for that login and whether the login has rights on the target database. Work that stage through Ignition database user source SQL Server permissions.

Two cases look related but are not this fault. If the same connection ran until an upgrade, its causes live in the upgrade path: fixing Ignition SQL Server connection faults after an upgrade covers them. And how the Gateway hands login credentials to the driver — including whether a Gateway encoding key can supply JDBC login credentials — is its own subject, worth checking once the timeout is gone.

Questions asked

Do I still need the SQL Server Browser service if the connection uses a fixed port?

No. The Browser service exists to translate an instance name into whatever TCP port that instance listens on right now. When the Gateway connection carries an explicit port and leaves the instance field empty, the driver never performs that lookup, so the Browser service can stay stopped on the database computer. Keep it running only for connections that address the instance by name.

SQL Server Management Studio connects locally, so why does Ignition still time out?

Management Studio on the database computer reaches the engine through shared memory, a transport that ignores the TCP settings and the Browser service entirely. The Gateway's JDBC driver travels over TCP, so it exercises the server-side protocol, the listening port and the discovery exchange. A working local login proves the service runs and the login works, but says nothing about the TCP path the Gateway needs.

Where does the Microsoft JDBC driver itself get set up in Ignition?

The driver arrives as an installer or a zip archive, and Ignition only needs the jar file inside it. Register that jar once in the Gateway's JDBC driver settings, then build the database connection on top of that driver entry. The timeout in this article happens after the driver has loaded, so an unregistered jar shows up earlier as a driver-not-found error, never as this timeout.

Does anything change when the Gateway and SQL Server Express run on different computers?

Only the host and the network path change. localhost always means the machine running the Gateway process, so a split setup puts the database computer's name or address in the server field instead. The firewall then matters for real: the database machine must allow inbound TCP on its listening port, plus inbound on the discovery port if you address the instance by name. Everything else in the fix is identical.

Keep reading

  • Troubleshooting

    Fix Ignition SQL Server connection faults after an upgrade

    After an Ignition 8.1.x upgrade, a faulted SQL Server connection is almost never a credentials problem: the new Java runtime disables TLS 1.0 and 1.1 (builds from 8u291), and a Microsoft JDBC driver as old as 4.0 cannot run on it. Read the Gateway exception, then patch SQL Server to TLS 1.2 per KB3135244 or replace the driver; the reported working pair was 9.4 in place of 4.0.

    Edge computing and IIoT

  • Selection guide

    Historian alternative for PLC batch tracking records

    Simple batch tracking needs one row per completed batch, not a tag historian. Size the choice with batches per day, retention and concurrent viewers: memory-card logging covers CSV-only jobs, a PC acquisition package adds web viewing and export with no report code, and a companion PC writing to SQL Server Express hands reporting to a database owner — the storage math is megabytes either way.

    Edge computing and IIoT

  • Explainer

    Whether a Historian 2023 R2 license includes SQL Server

    No Historian 2023 R2 license includes SQL Server Standard: the word Standard names the historian offering, not the database edition. From April 2023, older and larger historian licenses stopped bundling SQL Server Standard too, so the database is licensed separately on every deployment. Run Express where the historian's stored alarms, events and summaries fit its documented database size cap; buy Standard edition where they don't.

    Edge computing and IIoT

Why Ignition tag history disables after a gateway disconnect