-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to find subscription with identifier: {"channel":"GraphqlChannel","channelId":"18bccb1dbd6"} #4702
Comments
Actually, this being raised in subscriptions.rb when the identifier can't be found in the |
Hi! Sorry for the trouble and thanks for the detailed report. What I expect on re-deploy is for clients to reconnect, re-sending GraphQL subscriptions as needed. A couple of quick thoughts:
|
@rmosolgo Right, so to address your questions (and what I think is going on here as well):
I think it's that we have this in our
This would start each instance on a blank slate of connections, so if we're scaling and running 3-4 instances, they're all pushing to the same redis. One instance may pick up a Perhaps |
My intention on
I hope that helps! |
@rmosolgo Thank you for taking the time out of the day to explain this a bit, appreciate it! :) We still haven't worked this issue out. We realized we weren't running ActionCable standalone in production, and thought perhaps this would be solved when we move ActionCable to be its own standalone service, but (I presume) because we also scale this out, this "issue" still persists. We don't really know to what extent its an issue, or if it is an issue at all — e.g, are we getting a certain percentage of lost websockets pushes? or are these errors completely harmless?
In this sense, should an ActionCable process that does not have the |
@rmosolgo We've moved away from scaling actioncable horizontally and have instead scaled it up, increasing the spec of the machine significantly and only running one machine. We are still seeing these errors every day and we're quite lost at where they come from We've reduced our |
I'm sorry I don't have anything better to offer on debugging this ... to answer those very old questions:
Yes, that sounds right to me... I think a process would only call
How I expect that to work is:
I notice that it sends I pushed a branch which adds a rescue to that code, in case you want to try it: #5053 |
Hey, I spent some more time with this and I was able to replicate the error in the test app in this repository. I could replicate this error by clicking "unsubscribe" twice. The first time, it unsubscribed (using Here's a screencap: So, I don't think #5053 is related -- this error is between the client and ActionCable, without any (Ruby) GraphQL-Ruby code involved. In the test app, I solved this problem by adding an unsubscribe() {
// Don't re-call `unsubscribe` to avoid Rails logging an error
if (!this._unsubscribed) {
this._unsubscribed = true
this.subscription.unsubscribe()
}
} Would an approach like that work for you? Also, reviewing this issue, I don't see which ActionCable client you're using. Are you using one of the ones from I'm going to close this issue since it's gone cold, but if you get back to me about the client code, I'll be happy to re-open it until the client is improved. |
Hey @rmosolgo, thanks for the writeup and action. We're seeing this issue (constantly) in production. We're using the
Is there somewhere you could include the idempotent unsubscribe fix above for us, or should we add it somewhere on our side? |
@steobrien, in my case, the error was coming from calling If that doesn't work for you, I can try adding a "once and only once" check here: graphql-ruby/javascript_client/src/subscriptions/createActionCableHandler.ts Lines 68 to 70 in 4836730
|
I don't think Relay can do it automatically for us in this context – But having said that, our |
I'm seeing everything behave sensibly in our implementation. Additionally, it looks like Relay's subscription
I confirmed this by calling
Subsequent calls appeared to no-op. So, it seems like something more mysterious is happening here. |
Ok, thanks for giving it a try. Could you open a new issue so we can keep investigating it? It'd be great to have:
Then we can dig in further! |
Sure thing. To your last bullet point, I'd love to figure out a way to reproduce, though. Right now, we see it frequently on production (1000 times today) but I'm struggling to figure out the pattern of events. I'll let you know if I can isolate that. |
Describe the bug
This is possibly not a bug in
graphql-ruby
, and I apologize in advance if that's the case, but I've just run out of ideas on what this could be and thought I'd open this bug report in case this is something anybody else has run into before, or if it's a common problem that I just can't find much information on.Basically, we see a lot of these errors in our AppSignal monitoring, but I can't reproduce it locally. We don't know if it's something that happens when we deploy new versions and somebody is using the site with (possibly now disconnected websockets?) or what's been going on really
Versions
graphql
version: 2.1.1rails
(or other framework): 7.0.8other applicable versions (
graphql-batch
, etc):Steps to reproduce
I'm sorry but honestly, no clue. We can't reproduce this locally, it only happens in our production and staging environments (on Amazon Fargate using ElastiCache Redis)
Expected behavior
Not to throw this error, or to find the subscription
Actual behavior
What specifically went wrong?
Place full backtrace here (if a Ruby exception is involved):
Click to view exception backtrace
The text was updated successfully, but these errors were encountered: