IMD SolutionComputing LibraryShop main store

Troubleshooting

Why Ignition Gateway cannot connect to SQL Server LocalDB

Edge computing and IIoT Published 7 min read

Short answer

The Ignition Gateway's JDBC driver connects only over TCP/IP, and SQL Server LocalDB never opens a TCP listener, so the connection fails even with port 1433 open and ping working in both directions. Replace LocalDB with a standard SQL Server Express instance, enable TCP/IP, set a fixed port of 1433 in IPAll, restart the service, and connect the Gateway with a SQL login.

On this page
  1. Why can't an Ignition Gateway connect to SQL Server LocalDB?
  2. Why don't an open port 1433 firewall rule and a passing ping fix it?
  3. What is LocalDB, and what does it listen on?
  4. Which database target works for a development connection?
  5. How do I configure SQL Server Express for the Gateway connection?
  6. Why does a local SQL client succeed while the Gateway fails?
  7. How do I verify the listener before blaming the Gateway?
  8. What is the decision for each case?
  9. Questions asked

Your Ignition Gateway cannot connect to a SQL Server LocalDB instance, and no firewall change will fix it: LocalDB never opens a TCP listener, and the Gateway's database driver connects only over TCP/IP. Ping and an open port rule prove the network path is healthy; they say nothing about whether any process accepts the connection. The fix is to install a standard SQL Server Express instance, enable its TCP/IP protocol, give it a fixed port, and point the Gateway at it with a SQL login. This article explains why LocalDB fails, which target works instead, how to configure Express step by step, and how to verify each hop before blaming the Gateway.

Why can't an Ignition Gateway connect to SQL Server LocalDB? #

Because LocalDB provides no TCP/IP listener at all, and the Gateway's JDBC driver speaks only TCP/IP. Even when the Gateway and LocalDB share one machine, the driver opens a TCP socket to the database port, and a protocol that never binds a port cannot answer it.

The maintainers of Microsoft's JDBC driver state this plainly in their own issue tracker: a JDBC connection to a SQL Server instance works only over TCP/IP, so a LocalDB target is out of scope for any TCP-only client. The Gateway's MS SQL Server driver is such a client, which is why your MySQL and full SQL Server connections work with identical Gateway settings while LocalDB does not. Those hosts run real TCP listeners; LocalDB runs none.

Why don't an open port 1433 firewall rule and a passing ping fix it? #

Firewall rules and ping test the transport path, not the endpoint. Ping proves IP reachability between the server and the workstation, and the port rule proves the packet is delivered, but on the LocalDB machine nothing is bound to that port, so the handshake ends in a reset or a timeout.

Trace it hop by hop. Say the Gateway sits on a server at 10.0.25.122 and the development workstation is at 192.168.1.50, both example addresses. The Gateway opens a TCP socket to the workstation on the database port and the firewall passes the SYN. At the workstation, no process holds a listening socket on that port, so the operating system refuses the connection before any database protocol starts. A port test passing on the way in therefore tells you nothing; a TCP-port check alone cannot prove a JDBC listener is healthy, which is exactly the distinction the page on troubleshooting SQL Server JDBC listener connections works through.

What is LocalDB, and what does it listen on? #

LocalDB is a lightweight, per-user SQL Server edition that starts on demand inside the user's session and serves local applications through shared memory or a named pipe, with no Windows service and no network binding.

That design explains every symptom you are seeing. LocalDB starts when a local application requests it and can stop when idle, so there is no service entry to configure and no listener to point a remote client at. A SQL client on the same machine connects through that local channel and works; a client that must arrive over TCP has nothing to arrive at. The lightweight footprint is the feature, and the missing listener is its direct consequence.

Which database target works for a development connection? #

A standard SQL Server Express instance is the only target of the three that works, because it is the only one with a TCP listener the Gateway's driver can reach, and it keeps your development data on the workstation, separate from production.

Target on the workstation TCP listener Reachable by the Gateway Verdict
SQL Server LocalDB none no, not even from the same machine not usable with the Gateway
Gateway moved onto the workstation, still on LocalDB none not applicable fails the same way; the driver still needs TCP
Standard SQL Server Express, TCP/IP enabled, fixed port yes, once enabled yes, with a firewall rule and a SQL login use this

The only cost of the recommended path is a one-time protocol configuration, which the next section covers.

How do I configure SQL Server Express for the Gateway connection? #

Six steps take a fresh Express install to a validated Gateway connection:

  1. Install standard SQL Server Express and choose mixed-mode authentication during setup, so the Gateway can log in with a SQL login instead of a Windows account.
  2. Open SQL Server Configuration Manager, expand SQL Server Network Configuration, open the protocols entry for your Express instance, and set TCP/IP to Enabled.
  3. Open the TCP/IP properties, go to the IP Addresses tab, scroll to the IPAll section, clear TCP Dynamic Ports, and set TCP Port to 1433. A fixed port removes any dependency on the SQL Server Browser service.
  4. Restart the SQL Server service for that instance. Protocol changes apply only after the restart, and a skipped restart produces the same no-listener symptom as LocalDB.
  5. Create a SQL login and grant it access to the development database only.
  6. On the Gateway webpage, confirm under Config that Databases Drivers lists the MS SQL Server driver, then create the connection with a connect URL in the documented jdbc:sqlserver scheme, for example jdbc:sqlserver://192.168.1.50:1433;databaseName=DevDB, substituting your own host and database names, and enter the SQL login credentials.

If you instead keep a named instance on a dynamic port, the client must resolve the current port through SQL Server Browser on UDP 1434, which adds a second firewall hop. The fixed port avoids it.

Why does a local SQL client succeed while the Gateway fails? #

Because a client on the same machine can reach the database through shared memory or named pipes, which bypass TCP entirely, so a successful local test tells you nothing about whether a TCP listener exists.

That is the most common trap, and it has siblings. Check your case against these:

Symptom Mechanism Check
Connection fails though the port is open and ping works target is LocalDB, or Express has TCP/IP disabled no LISTENING entry on the database port on the workstation
Works locally in SQL tooling, fails from the server local client used shared memory or named pipes connect explicitly over TCP from the Gateway server
Worked before, fails after a reboot or reinstall dynamic port changed while the Gateway URL pins the fixed port set the fixed TCP Port in IPAll and restart
Login rejected once TCP works instance in Windows-only authentication mode enable mixed mode and restart the service
Workstation sleeps or its address changes listener disappears or the address moves reserve the address or use a DNS name, and keep the PC awake

Once TCP itself works, two other fault classes appear, and neither is LocalDB. If the host is an edge PC that drops its SQL session after a power or network outage, the recovery steps are in reconnecting an edge PC to SQL Server after connection loss. If the handshake reaches the server but dies on encryption negotiation, the article on fixing an ODBC SSL security error 08001 on an edge PC covers that case.

How do I verify the listener before blaming the Gateway? #

Verify from the workstation outward, and run every network test from the Gateway server, because a test run on the database machine can succeed through a local mechanism the Gateway cannot use.

Worked example, using the example addresses above with the Gateway on 10.0.25.122 and the workstation on 192.168.1.50:

  1. On the workstation, run netstat -ano | findstr :1433. You must see a line with LISTENING on that port. No line means the protocol is disabled, the instance was not restarted, or the target is still LocalDB. Match the process ID shown to the SQL Server service in Task Manager.
  2. From the Gateway server, run Test-NetConnection -ComputerName 192.168.1.50 -Port 1433 and require TcpTestSucceeded : True. Ping does not cover this, because ping tests ICMP only.
  3. From the Gateway server, log in over TCP with sqlcmd -S tcp:192.168.1.50,1433 -U dev_login, using your SQL login. A successful login isolates the credential and authentication mode from the Gateway configuration.
  4. Save the Gateway database connection and read its status on the Gateway's database status page. It must report a valid connection.

When all four checks pass, the workstation, the path, the port and the login are proven, and the Gateway connection will validate with the same host, port and credentials.

What is the decision for each case? #

If the target is LocalDB, replace it: install standard SQL Server Express, enable TCP/IP, fix the port, restart the service, and connect the Gateway with a SQL login. If the target is already Express, decide by symptom: no LISTENING entry means the protocol or the restart; a login rejection means the authentication mode.

Either way the original goal survives. Express keeps the development database on the workstation, isolated from production, and adds only the one-time listener configuration that LocalDB cannot provide.

Questions asked

Can I keep the LocalDB database file when I move to SQL Server Express?

Yes. Stop the LocalDB instance cleanly, copy its .mdf and .ldf files, and attach them to the standard Express instance with CREATE DATABASE using the FOR ATTACH option. The Gateway then reaches the same development data through the Express TCP listener, and the dataset moves in one operation.

Does the Gateway need the SQL Server Browser service running?

Not when the port is fixed. With the TCP Port set in the IPAll section, the connection URL addresses the instance directly, so the Browser service on UDP 1434 can stay stopped. Browser is only needed when a named instance keeps dynamic ports and the client must ask for the current port number.

Does co-locating the Gateway on the same computer as LocalDB change anything?

No. The JDBC driver still opens a TCP socket, LocalDB still binds none, and the connection fails exactly as it does from a remote server. Moving the Gateway onto the workstation only removes the network hops that were already succeeding.

Where do I manage the SQL Server JDBC driver inside Ignition?

On the Gateway webpage, under the Config section, the Databases Drivers page lists the installed JDBC drivers and is where you add or update them. Confirm the MS SQL Server driver entry there before creating the connection, because a connection cannot validate without its driver present.

Keep reading

  • Troubleshooting

    Troubleshooting historian trend client connection failures

    A trend client connection failure has two first checks. If trend pens or Historian Client still load data, compare the failing client's connection definition against a working one instead of restarting the server. If every client fails, verify the historian and SQL services, then test TCP reachability from the failing node to the configured endpoint, port 1433 only if that is the configured port.

    Edge computing and IIoT

  • 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

  • Troubleshooting

    Ignition historian create table fails after a disabled restore

    The double in the failing CREATE TABLE means the MSSQL JDBC driver has no translator selected: a restore with the disable option checked disabled every translator, so generic type names reach SQL Server unchanged and the statement fails to parse. Enable the translators, select the MSSQL translator under Connections > Databases > Settings, restart the gateway, and the sqlt_data partition table creates.

    Edge computing and IIoT