Drew S
Drew S

Reputation: 357

ColdFusion Websocket: The channel entry specified for subscribeTo is not valid

My company is using cfwebsocket on our ColdFusion 11 server. In the past it has worked fine, but recently we started getting this message every time we try to access the page that calls cfwebsocket:

Attribute validation error for the CFWEBSOCKET tag The channel entry specified for subscribeTo is not valid. 
"testing123" is not a valid channel registered for this application.

However in our Application.cfc I have setup the channel:

 <cfset this.wschannels = [{name="testing123"}] />

Another weird problem is that when I go to the WebSocket section of the ColdFusion Administrator. I get an error as well:

CFAdmin WebSocket Error It's really weird because we had this working before. We haven't changed our firewall at all. Can anyone point me in the right direction?

Upvotes: 1

Views: 782

Answers (2)

charlie arehart
charlie arehart

Reputation: 6884

Another reason that error can occur (in CF2021, at least) is simply if you make a request against the channel when it's not yet properly defined (in the application.cfc.

And what's really frustrating is that even if you correct the problem in your code, the error will persist.

And beside that error (which one would get on a page subscribing to a channel), the same problem would lead to a different but equally persistent error Channel [name] does not exist or is not running on a page PUBLISHING to a channel.

There are a couple of ways to make the error go away (once you've corrected the mistake). One would be to restart CF (overkill but easy). Another would be to cause the application (application.cfc) to be reloaded, such as by calling the cf applicationstop() function. Yet another would be to change the app name (or give the app a name if it has none, such as by adding a line to the application.cfc like this.name = "test" (presuming use of cfscript).

Any of these would cause CF to no longer associate the failed attempt to use that channel name with this application. And now the request should work (again if all else is correct).

Finally, while I can confirm that this cause of the problem does NOT lead to the error in the CF11 Admin which the OP had reported, still since this post comes up in a search for that first error and this IS another solution for it, I wanted to share this.

(And FWIW, I confirmed this behavior in CF2023, 2021, and down to even CF11.)

Upvotes: 0

haxtbh
haxtbh

Reputation: 3534

If you have updated to Update 3 then the reason for the problems is due to Adobe breaking websockets in that update.

I submitted a bug just after it was released - http://bugbase.adobe.com/index.cfm?event=bug&id=3865461

Its been fixed and you can request a hotfix from them which does resolve the issue, otherwise you will have to wait until Update 4!

Upvotes: 3

Related Questions