IMD SolutionComputing LibraryShop main store

Troubleshooting

Error 4007 address invalid means the OPC UA hop fails first

Edge computing and IIoT Published 6 min read

Short answer

Error 4007 is logged on the Neuron-to-OPC-UA connection, not on MQTT. Verify reachability to the configured OPC UA endpoint, compare the node's host and port field by field against the server's endpoint, then confirm the broker publish. Direct OPC UA over MQTT is not supported.

On this page
  1. Why does the log blame OPC UA when MQTT is what I started?
  2. Does the gateway host even reach the OPC UA server?
  3. Which endpoint fields do I compare against the server?
  4. Is this the same failure I'd see on any OPC UA client?
  5. After OPC UA connects, how do I verify the publish path?
  6. Can I carry OPC UA itself over MQTT and skip the conversion?
  7. How do I close the fault cleanly?
  8. Questions asked

The log line Unknown error (4007) Address Invalid is reported while the gateway's OPC UA node is trying to connect to its server, so the failing hop is OPC UA, not MQTT. An MQTT client can show itself ready and a subscriber like MQTTX can sit connected on the broker while nothing is published, because there is no input data to publish. Trace the path in order: reachability to the OPC UA endpoint, the node's endpoint configuration, then the publish and subscription path. Changing broker or MQTTX settings cannot repair a client-to-server OPC UA connection.

Why does the log blame OPC UA when MQTT is what I started? #

Because 4007 is raised during the OPC UA node's connection attempt, before any data exists to hand to the publish path. The gateway reads its inputs over OPC UA, converts them, and only then publishes to the broker; a fault in the first stage starves everything after it. Treat MQTTX's empty view as a symptom, not a cause.

The sequence to keep in mind is three segments:

  • Segment 1: the gateway's OPC UA node connects to the configured OPC UA server endpoint. The 4007 error lives here.
  • Segment 2: the gateway converts the read data and publishes it to the broker.
  • Segment 3: MQTTX subscribes on that broker and displays messages.

An OPC UA session failure produces exactly what was observed: the error in the log, a still-ready MQTT connection, and no message in the subscriber. The same empty subscriber would also result from a broken publish configuration, which is why the order of checks matters — you fix segment 1 first, and only a clean segment 1 makes segment 2 and 3 diagnoses meaningful.

Does the gateway host even reach the OPC UA server? #

Test reachability from the gateway host to the endpoint exactly as configured, using the configured host and the configured port — for example a TCP connect to port 4840 on the server address the node holds. Do not test a guessed default address; test the values the node itself carries.

Work the result against one of two outcomes:

  • The host or route is unreachable: the failure is network. Correct the address, routing, link state, or whatever filtering sits between the two hosts, and retest before touching the node configuration.
  • The host is reachable but the log still reports 4007: the network is fine and the node's endpoint configuration is now the suspect. Move to the field-by-field comparison below.

Reachability alone never proves the endpoint is right. A server can answer on the host while the client is aimed at the wrong port or the wrong interface on a multi-homed machine.

Which endpoint fields do I compare against the server? #

Compare three things field by field: the node's configured host or address, its port, and the endpoint the server actually exposes. A single differing field is enough to produce Address Invalid.

A worked example with typical plant values:

  • Node configured endpoint: opc.tcp://10.0.3.20:4840
  • Endpoint the server reports for itself: opc.tcp://plc-line1.local:4840
  • Host comparison: 10.0.3.20 versus plc-line1.local — the IP may still route to the machine, but if the server validates the endpoint URL against the name it advertises, the client's endpoint description will not match what the server returns. Port comparison: 4840 versus 4840, matching.

That host mismatch is the classic 4007 generator. OPC UA servers return their own endpoint descriptions during connection setup, and a client that rewrites the domain or port in those URLs risks a mismatch the server rejects. The OPC Foundation's own discussion of servers that advertise a hostname different from the discovery address makes the same point: clients replacing the domain and port in returned URLs commonly produce exactly this mismatch. Stale addresses after a host rename or a network change produce it too — so check whether the address points at the interface the server actually listens on.

Field Read from Compare against
Server host/address Gateway OPC UA node configuration Endpoint the server itself reports
Port Gateway OPC UA node configuration Same reported endpoint
Reachability Test from the gateway host The configured endpoint, not another host or port

Decision: any field that differs — correct the node, retry, and watch the log. All fields matching and 4007 persisting — the remaining suspects are the security policy, credentials, or a network control on the OPC UA port, which the endpoint comparison cannot show.

Is this the same failure I'd see on any OPC UA client? #

Yes, and that is useful: the same address-and-endpoint discipline applies to any OPC UA client that reports a device configured but never connecting. The error text differs between products, but the failing hop and the fix are the same shape. For the Ignition flavor of this exact symptom — an OPC UA device connection that sits connecting but never comes up — the walk-through in our article on an Ignition OPC UA device connecting but never connects applies the same endpoint comparison to that platform.

The practical takeaway is to keep one method regardless of client: read the server's self-reported endpoint, compare your client's configured endpoint against it field by field, and fix the first difference you find. Vendor-specific diagnostics only refine which field is wrong; they do not change which hop is failing.

After OPC UA connects, how do I verify the publish path? #

Confirm the four observations in order, and stop at the first one that fails, because that observation names the segment to inspect next.

  1. The OPC UA node connects with no 4007 in the log, and the input values are present in the project.
  2. The gateway's MQTT configuration names the broker and publish topic this project actually uses, and the gateway's broker session is up.
  3. A value change on the OPC UA input produces a publish that reaches the broker.
  4. MQTTX, connected to that same broker and subscribed to that exact topic, displays the message.

Decision per outcome: no data at step 1 — return to the endpoint and node checks; data present but no publish at step 3 — inspect the gateway's publish and topic configuration and its broker connection; a publish visible at the broker but absent in MQTTX at step 4 — the fault is MQTTX's broker address or subscription topic, not the data path. Change one layer at a time so each log entry stays attributable to one fix.

Can I carry OPC UA itself over MQTT and skip the conversion? #

No, not on this gateway. The OPC Foundation does define OPC UA PubSub, which can use MQTT as a transport, but the supported arrangement here is an OPC UA input converted and published as ordinary MQTT payloads. The gateway does not accept MQTT as a transparent transport for an OPC UA session.

That distinction matters for your design: MQTT is a broker-based publish/subscribe protocol at the transport level, while OPC UA is an application-layer protocol with its own session, address space and security model. Running them side by side — the OPC UA server staying up for OPC UA clients, and a bridge publishing mapped values to the broker — is the supported way to have both at once. Do not plan on pointing an OPC UA client at a broker endpoint; it will not establish a session.

How do I close the fault cleanly? #

Fix the first failing hop, retest, and only then move to the next segment. Apply the corrected endpoint or network change, confirm the 4007 line no longer appears and input data is available, verify the gateway publishes to the broker, and finally watch the message arrive in MQTTX. If the OPC UA branch still fails, stay on endpoint reachability and node address; if it passes and the subscriber stays empty, work the publish and subscription checks without reopening the resolved branch.

Questions asked

How do I fix error 4007 Address Invalid on the OPC UA node?

Test reachability from the gateway host to the configured endpoint, for example a TCP connect to the server's port 4840. Then compare the node's host and port fields against the endpoint the server itself reports and correct any difference. Retry while watching the log before you touch the broker settings.

Can I run OPC UA over MQTT without converting the data?

Not in this setup. The OPC Foundation does define a PubSub mode that carries OPC UA data over MQTT, but the gateway in question supports only an OPC UA input that is converted and published as MQTT payloads. Run the OPC UA server and a bridge alongside each other if you need both protocols at once.

MQTTX still shows nothing after the 4007 error is gone. What now?

The OPC UA branch is resolved, so the fault has moved downstream. Confirm the gateway connects to the broker and publishes to the topic you expect, connect MQTTX to that same broker, subscribe to that exact topic, and trigger an OPC UA value change. The first failing observation in that chain is the segment to inspect.

Why does an MQTT connection being ready not prove data will flow?

MQTT readiness only shows the broker session is up. It says nothing about the upstream OPC UA session that supplies the values. If the OPC UA node never connects, there is no data to publish, so the subscriber stays empty even though both clients report themselves connected.

Keep reading

  • Troubleshooting

    Why MQTT Engine writes fail with Bad_NodeIdUnknown

    Bad_NodeIdUnknown on an MQTT Engine tag write is an OPC UA namespace lookup failure at the server executing the write — the node id is not in its address space. It is not a VPN fault: with good edge tags and a live Engine tag, fix the write target's node path, not the transport.

    Edge computing and IIoT

  • Comparison

    Cloud IIoT to Ignition data integration options compared

    To push cloud machine data into a customer's Ignition install, choose a subscription route: publish MQTT with the Sparkplug payload to a broker the customer designates, and let them subscribe through the MQTT module they add. An OPC UA server interface is the stricter alternative. A JSON/XML web API only works with customer scripts that poll.

    Edge computing and IIoT

  • How-to

    Harden a Node-RED OPC UA server exposing PLC tags

    A default Node-RED OPC UA server accepts any client that can reach its port until three changes land: set message security mode to SignAndEncrypt with the Basic256Sha256 policy, remove mode None and anonymous login, and admit clients only through application-certificate trust lists. Those three changes are the whole decision; the rest is execution.

    Edge computing and IIoT