Troubleshooting
Why MQTT Engine Filtered Namespaces works backwards
Short answer
Filtered Namespaces on each MQTT Engine server connection is a deny list: name Sparkplug B on the connection that must not subscribe to it and the custom namespace on the other. The SUBACK return code 128 in the Failed subscribe line marks the filter the broker ACL denied, and its position names which one.
On this page
- Why does the connection keep switching between connected and not connected?
- What does granted QoS [128, 0] mean in the failed subscribe line?
- Is the fault in the network, the session, or the subscription?
- Why does each connection subscribe to both namespaces?
- Is Filtered Namespaces an allow list or a deny list?
- How do I give each server connection only its own namespace?
- What should I stop tweaking while chasing this fault?
- How do I know the fix has taken effect?
- Questions asked
Two MQTT Engine server connections to one broker — one carrying Sparkplug B from Transmission, one carrying a custom namespace fed by LoRa devices — flap because each connection requests both namespace filters and the broker's ACL denies one of them. MQTT Engine reads the resulting SUBACK code 128, drops the session, and retries, which is the oscillation in the status column. The fix is one setting used the way it actually works: Filtered Namespaces on each server connection is a deny list. Name Sparkplug B on the connection that must not have it, and the custom namespace on the other.
Why does the connection keep switching between connected and not connected? #
Because the broker refuses one of the two topic filters the connection requests: MQTT Engine reads SUBACK return code 128 as a failed subscribe, drops the whole session, and retries, and that connect-drop-retry loop is the status flapping.
Follow the packet. Each server connection in MQTT Engine is an independent MQTT client session: name resolution, TCP to the broker port, CONNECT, CONNACK, and only then SUBSCRIBE. That SUBSCRIBE is one packet per connection carrying every namespace enabled at module level — not one filter per namespace per server. With Sparkplug B enabled and a custom namespace defined, both connections send the same pair of filters.
The broker answers with a SUBACK containing one return code per requested filter, in the order requested. Codes 0, 1 and 2 mean the filter was granted at that QoS; 128 (0x80) means failure. MQTT Engine compares the granted vector against what it asked for, treats any mismatch as fatal for the session, disconnects and retries. The Sparkplug machinery — birth and death certificates, sequence numbers, rebirth — sits above this and never runs, because the session is torn down before any PUBLISH arrives. That layer separation is the same one behind why broker support is not Sparkplug support.
What does granted QoS [128, 0] mean in the failed subscribe line? #
It is the SUBACK return-code vector — one code per requested filter, in the order requested — and 128 (0x80) is the failure code, so its position names the filter the broker denied.
These two lines come from a gateway running MQTT Engine 4.0.24 on Ignition 8.1.43:
ME-e67ecb13-ace4-4e69: server Test3 - Failed subscribe on [SM/test, spBv1.0/#] granted QoS [0, 0] != [128, 0]
ME-ab6f5668-904e-4d16: server Test1 - Failed subscribe on [SM/test, spBv1.0/#] granted QoS [0, 0] != [0, 128]
| Connection | Filters requested, in order | Requested QoS | Granted | Denied filter | What the ACL permits |
|---|---|---|---|---|---|
| Test3 (Sparkplug from Transmission) | SM/test, then spBv1.0/# | [0, 0] | [128, 0] | SM/test | spBv1.0/# only |
| Test1 (LoRa custom namespace) | SM/test, then spBv1.0/# | [0, 0] | [0, 128] | spBv1.0/# | the custom namespace only |
The decoding is positional arithmetic. Test3 requests 2 filters, so its SUBACK carries 2 codes. Code 1 is 128 and code 2 is 0, so 1 of the 2 filters was denied and it is the first one, SM/test. Test1's vector [0, 128] puts the 128 in position 2, so its denied filter is spBv1.0/#. Each connection has exactly one filter to remove from its subscribe — one deny-list entry each.
The reason-code tables list 0x80 as Unspecified error and place it on SUBACK alongside CONNACK, PUBACK, PUBREC, UNSUBACK and DISCONNECT; the code names neither the topic nor the reason. On a broker with topic authorization enabled, a 128 in a SUBACK is the denial, and the broker's own authorization log states it outright. The refusal happens at the authorization gate that governs how MQTT clients publish and subscribe through the broker.
Note the literal filter string in the log: SM/test, not the SM/# you may think you configured. Whatever the line prints is what went on the wire and what the ACL evaluated.
Is the fault in the network, the session, or the subscription? #
The subscription: a connection that reaches SUBSCRIBE has already proven name resolution, the TCP path and port, CONNECT and CONNACK, the credentials and the client ID, so none of those need retesting.
Separate the three failure classes before touching namespace settings:
- TCP or TLS: connect timeouts, connection refused, handshake or certificate errors. Check broker host, port, firewall path, CA and client certificates.
- MQTT session: CONNACK refusals — bad credentials, not authorized, client identifier rejected. Check username, password, client ID uniqueness.
- Subscription:
Failed subscribe on [...] granted QoS [...] != [...]. Check per-connection namespace filtering and the broker ACL rules.
The log lines above sit squarely in the third row. The broker is reachable and the credentials are accepted; treat this as a filtering fault, not a connectivity fault.
Why does each connection subscribe to both namespaces? #
Because MQTT Engine runs one client session per server connection, not one per namespace, and each session's single SUBSCRIBE carries every namespace enabled at module level — so both connections request both filters.
The broker ACL is written to grant each client identity exactly one topic space, the same discipline as writing ACL topic filters for Sparkplug. Each connection's SUBSCRIBE therefore contains one filter that its client may not hold, and neither session can ever complete its subscribe. This is also why the global enable-disable toggle cannot solve it: enabling Sparkplug B lets the Sparkplug connection work and breaks the LoRa one, disabling it does the reverse. A global setting moves both connections together; only a per-connection setting can divide them.
Is Filtered Namespaces an allow list or a deny list? #
A deny list: a namespace named in a server connection's Filtered Namespaces box is excluded from that connection's subscribe, and every namespace enabled globally and not named there is still requested.
The inversion is where these deployments go wrong. Engineers enter the namespace they want on the connection, which produces exactly the opposite result and leaves the same 128 in the log. The correct mapping is one-to-one with the decode table: on the connection receiving LoRa (Test1), enter Sparkplug B; on the connection receiving Sparkplug (Test3), enter the custom namespace under the exact name it carries in the namespace configuration — New Custom Namespace in this deployment. The setting lives in the Advanced panel of each server connection, reached from Configure, then MQTT Engine, on the Ignition gateway webpage.
How do I give each server connection only its own namespace? #
Enter one deny per connection: Sparkplug B in Filtered Namespaces on the LoRa connection, the custom namespace on the Sparkplug connection — each session then sends a single-filter subscribe its ACL already permits, and the SUBACK comes back all zeros.
- On the Ignition gateway webpage, go to Configure, then MQTT Engine, and edit the server connection receiving the LoRa payloads (Test1).
- Expand Advanced and add Sparkplug B to Filtered Namespaces. Leave the custom namespace out of that box.
- Save, then edit the connection receiving Sparkplug B from Transmission (Test3). Add the custom namespace to Filtered Namespaces under Advanced, typed exactly as it appears in the namespace configuration. Leave Sparkplug B out.
- Leave both namespaces defined and enabled at module level; filtering removes a namespace from one connection, not from the module.
- Save. Both connections restart their sessions with one filter each.
The decision per case: Test1 subscribes only to the custom namespace; Test3 subscribes only to spBv1.0/#; both namespaces stay live in the module. One caution while you are in the broker console: do not fix this by granting both filters to both clients or switching authorization off — it connects, but it hands each client data it was deliberately kept away from.
What should I stop tweaking while chasing this fault? #
QoS and client IDs: code 128 is an authorization refusal, not a quality-of-service negotiation, and the two client IDs in the log lines are already distinct, so neither change can fix this.
A broker refuses a denied filter at any requested QoS — 0, 1 and 2 are grants at that level — so moving the custom namespace to QoS 1 and Sparkplug to QoS 0 only changes the number printed next to the failure. A duplicate client ID does cause this style of flapping, because a broker must close the existing session when a second client claims the same identifier, so verify uniqueness once in the broker's client list, including the LoRa gateway's ID. The discriminator is the log: a client-ID collision produces disconnects with no Failed subscribe line at all. Transmission generates randomized client IDs unless someone pinned a static one, and the two Engine handles here — ME-e67ecb13-ace4-4e69 and ME-ab6f5668-904e-4d16 — are different.
How do I know the fix has taken effect? #
The Failed subscribe lines stop and both connections hold Connected; the fastest check is the filter list inside the line itself, because a correctly filtered connection sends one filter, not two.
If a line still names both filters, the filtering has not taken effect: either the entry does not match the configured namespace name character for character, or the edit landed on the wrong connection. Confirm on the broker side that its authorization log shows each remaining subscribe granted, then stop — the Sparkplug birth certificates and tag data follow on their own once the session survives.
Questions asked
Does the custom namespace have to stay enabled at module level when it is filtered on one connection?
Yes. Filtering removes a namespace from one server connection's subscribe only; it stays defined and enabled module-wide and the other connection still subscribes to it. Cirrus Link documents a recommendation to disable the Sparkplug B default namespace, but that applies to a single-server setup receiving only custom-namespace messages. With two servers divided by ACL, per-connection filtering is the right tool instead.
Does MQTT 5 change what return code 128 means in a SUBACK?
No. The reason-code references list 0x80, decimal 128, as Unspecified error and show it on SUBACK alongside CONNACK, PUBACK, PUBREC, UNSUBACK and DISCONNECT. The code itself carries no topic and no reason; a broker with topic authorization enabled returns it for the denied filter, and the broker's own authorization log is the place that names the cause.
The log shows SM/test but the namespace was configured as SM/#. Which string do I check against the ACL?
The one in the log. The Failed subscribe line prints the literal filter MQTT Engine put on the wire, composed from the namespace definition, and the broker evaluated that exact string. Compare it character for character with the ACL rule rather than the string you believe you typed; the Sparkplug filter in these lines is the literal spBv1.0/#.
Both of my servers need the same namespace as well as their own. Do I filter it anywhere?
No. Filtering only removes a namespace from a connection; it cannot duplicate or remap one. If two connections both need a filter, grant that filter to both client identities in the broker ACL and leave it out of both Filtered Namespaces boxes. The deny list exists to divide namespaces between connections, not to share them.