CometD version(s): 8.0.2
Jetty version: 12.0.10
Java version & vendor: zulu-17
We connect our listener to Salesforce and receive events. Time to time we receive "403::Unknown client" error in /meta/connect channel because of expired cookie, and CometD internally initiate the handshake call and the listener gets subscribed back to Salesforce.
In one of such incidents we observed that the subscription kept on failing. Once received the "403::Unknown client" error:
2026-07-15 22:11:11.640 GMT (tid=698526) [0004E] [CHANNEL:META_CONNECT:EventListener]: {"advice":{"reconnect":"handshake","interval":0},"channel":"/meta/connect","id":"2168506","error":"403::Unknown client","successful":false}
CometD initiated the handshake, which was successful:
2026-07-15 22:11:11.720 GMT (tid=452778) [0002I] [CHANNEL:META_HANDSHAKE:EventListener]: {"ext":{"replay":true,"payload.format":true},"minimumVersion":"1.0","clientId":"38ck1drtro5jeik3t68tzs732t7wb","supportedConnectionTypes":["long-polling"],"channel":"/meta/handshake","id":"2168508","version":"1.0","successful":true}
=== new "clientId":"38ck1drtro5jeik3t68tzs732t7wb" ===
Once we received the success response, we initiated the subscribe call which went through:
2026-07-15 22:11:11.846 GMT (tid=452778) [0005I] [CHANNEL:META_SUBSCRIBE:EventListener]: {"clientId":"38ck1drtro5jeik3t68tzs732t7wb","channel":"/meta/subscribe","id":"2168509","subscription":"/data/AssignedResourceChangeEvent","successful":true}
But then, the immediate /meta/connect call failed with "403::Unknown client" error:
2026-07-15 22:11:11.890 GMT (tid=698526) [0004E] [CHANNEL:META_CONNECT:EventListener]: {"advice":{"reconnect":"handshake","interval":0},"channel":"/meta/connect","id":"2168510","error":"403::Unknown client","successful":false}
So, CometD client re-initiated the handshake again and it was success
2026-07-15 22:11:11.964 GMT (tid=452778) [0002I] [CHANNEL:META_HANDSHAKE:EventListener]: {"ext":{"replay":true,"payload.format":true},"minimumVersion":"1.0","clientId":"38ck1drtro5jeik3t68tzs732t7wb","supportedConnectionTypes":["long-polling"],"channel":"/meta/handshake","id":"2168511","version":"1.0","successful":true}
=== received same clientId "clientId":"38ck1drtro5jeik3t68tzs732t7wb" ===
The subscribe call also came back with success:
2026-07-15 22:11:12.064 GMT (tid=452778) [0005I] [CHANNEL:META_SUBSCRIBE:EventListener]: {"clientId":"38ck1drtro5jeik3t68tzs732t7wb","channel":"/meta/subscribe","id":"2168512","subscription":"/data/AssignedResourceChangeEvent","successful":true}
But then the immediate /meta/connect call failed again:
2026-07-15 22:11:12.027 GMT (tid=698526) [0004E] [CHANNEL:META_CONNECT:EventListener]: {"advice":{"reconnect":"handshake","interval":0},"channel":"/meta/connect","id":"2168513","error":"403::Unknown client","successful":false}
Again a handshake call made by CometD:
2026-07-15 22:11:12.100 GMT (tid=698526) [0002I] [CHANNEL:META_HANDSHAKE:EventListener]: {"ext":{"replay":true,"payload.format":true},"minimumVersion":"1.0","clientId":"9ym7pj12fbpnmcmnqveeq04bn42","supportedConnectionTypes":["long-polling"],"channel":"/meta/handshake","id":"2168514","version":"1.0","successful":true}
=== got new clientId "clientId":"9ym7pj12fbpnmcmnqveeq04bn42" ===
But this time our subscribe call failed with "403::Unknown client":
2026-07-15 22:11:12.152 GMT (tid=452778) [0005E] [CHANNEL:META_SUBSCRIBE:EventListener]: {"advice":{"reconnect":"handshake","interval":0},"channel":"/meta/subscribe","id":"2168515","error":"403::Unknown client","successful":false}
And this time the /meta/connect call was successful:
2026-07-15 22:11:12.162 GMT (tid=698526) [0004I] [CHANNEL:META_CONNECT:EventListener]: {"clientId":"9ym7pj12fbpnmcmnqveeq04bn42","advice":{"reconnect":"retry","interval":0,"timeout":110000},"channel":"/meta/connect","id":"2168516","successful":true}
As our subscription call failed, we disconnected the client and re-initiated the handshake:
2026-07-15 22:11:27.242 GMT (tid=452780) [0002I] [CHANNEL:META_HANDSHAKE:EventListener]: {"ext":{"replay":true,"payload.format":true},"minimumVersion":"1.0","clientId":"38dfkq30rojjgmgo1bhcmip5in5em","supportedConnectionTypes":["long-polling"],"channel":"/meta/handshake","id":"2168522","version":"1.0","successful":true}
=== got new clientId "clientId":"38dfkq30rojjgmgo1bhcmip5in5em" ===
The subscribe call also went through:
2026-07-15 22:11:27.378 GMT (tid=452778) [0005I] [CHANNEL:META_SUBSCRIBE:EventListener]: {"clientId":"38dfkq30rojjgmgo1bhcmip5in5em","channel":"/meta/subscribe","id":"2168523","subscription":"/data/AssignedResourceChangeEvent","successful":true}
But then again the /meta/connect failed:
2026-07-15 22:11:27.309 GMT (tid=698526) [0004E] [CHANNEL:META_CONNECT:EventListener]: {"advice":{"reconnect":"handshake","interval":0},"channel":"/meta/connect","id":"2168524","error":"403::Unknown client","successful":false}
And finally, when CometD client tried to subscribe again, the call failed with Authentication error:
2026-07-15 22:11:27.379 GMT (tid=698526) [0002E] [CHANNEL:META_HANDSHAKE:EventListener]: {"ext":{"sfdc":{"failureReason":"401::Authentication invalid"},"replay":true,"payload.format":true},"advice":{"reconnect":"none"},"channel":"/meta/handshake","id":"2168525","error":"403::Handshake denied","successful":false}
This time our subscriber stopped permanently.
We checked with Salesforce team and they were not able to get us much information about why the immediate /meta/connect calls were failing. As we do not receive the clientId in the failed /meta/connect response, we could not confirm that if we were sending the proper clientId.
The question here is, could there be any chance that a wrong clientId was being sent in the /meta/connect call by the CometD client immediately after a handshake call came back with success? Or if CometD client was initiating parellal subscription calls where the clientId was overlapped with one request to another?
We observed this behaviour only once. There are no particular steps we can do to reproduce this issue, so that we can enable more logs to check the actual request/response. We have multiple other subscribers which were working fine during the same period. It just happened with only one subscriber.
Any thought, comment, suggestions are welcome here.