Comments (11)
@palkan can you remove the invalid tag. This has been solved.
Thank you very much!
from anycable-rails.
Upgrading the Heroku Stack from 20 to 22, and ruby version from 3.0.3 to 3.1.2 didn't help in any way.
from anycable-rails.
I was able to get this error fixed and the process itself to actually run. But the issue is now that Heroku does not support HTTP/2. AnyCable cannot run on Heroku no matter what you do. Don't waste your time folks!
from anycable-rails.
Please, read the documentation carefully.
AnyCable runs on Heroku without any problems. Proved by many production installations. Our demo application also runs on Heroku (latest stack): https://demo.anycable.io/
from anycable-rails.
@palkan I can send you a video of following the documentation carefully. As you're aware, it doesn't take long to get set up. So far, every engineer I talk to has told me that it's not possible. And after following the docs, I don't know what else to say about it. Happy to update my comment though, if I find otherwise.
I think even the Procfile didn't have the intended effect on Heroku? Or was that just me?
from anycable-rails.
It's not possible to have HTTP2 on Heroku accessible from the outside. But no one can stop us from using it within a dyno. From the docs:
The only way (for now) to run AnyCable applications on Heroku is to have two separate applications sharing some resources: the first one is a typical web application responsible for general HTTP and the second contains AnyCable WebSocket and RPC servers.
"every engineer" != "every good engineer"
I think even the Procfile didn't have the intended effect on Heroku?
My app uses the same Procfile as in the docs; you can find the source code here: anycable/anycable_rails_demo#4
From the exception, it seems that gRPC server tried to listen on the 0.0.0.0. Since you don't specify this address in the Procfile, it could be either defined via env (ANYCABLE_RPC_HOST=0.0.0.0:50051
) or in the YML config (or explicitly in the code).
The default value is "127.0.0.1".
You can debug configuration by running the following command: heroku run "bundle exec rails runner 'pp AnyCable.config'" -a your-rpc-app
.
from anycable-rails.
I was able to get the process to spin up and listen with this as the web
command in the Procfile:
web: ANYCABLE_DEBUG=1 bundle exec anycable --server-command="anycable-go --host=0.0.0.0 --port=$PORT" --rpc-host="0.0.0.0:50051"
If I'm not mistaken, that should satisfy the "ANYCABLE_RPC_HOST" variable requirement. Once I added this, I can confirm that the process spun up properly in debug mode and was listening correctly.
The issue that made me (and others) determine that we weren't able to do it on Heroku was that when a message was sent, it wouldn't actually deliver messages to the client. This is the error that would occur:
2022-07-31T19:45:28.805798+00:00 app[web.1]:
E 2022-07-31T19:45:28.805Z context=ws Websocket session initialization failed: rpc error: code =
Unavailable desc = last connection error: connection error: desc =
"transport: Error while dialing dial tcp: address 0.0.0.0: missing port in address"
But it did actually receive the message itself:
D 2022-08-01T00:21:09.013Z context=pubsub Incoming pubsub message from Redis: { ...message_data }
I'm not sure why there's this remaining problem?
"Unavailable context=rpc RPC failure: last connection error: connection error: desc = "transport: Error while dialing dial tcp: address 0.0.0.0: missing port in address"
I'll definitely try again. By the way you make it sound, I was close to having it done before I took everything down?
from anycable-rails.
address 0.0.0.0: missing port in address
The error says that is says: the RPC address value for anycable-go is invalid, it must include a port as well. Do you the ANYCABLE_RPC_HOST config var set? You should remove it (as well as --rpc-host="0.0.0.0:50051"
). The default values should be enough.
from anycable-rails.
Which anycable-go version do you run?
from anycable-rails.
I do have ANYCABLE_RPC_HOST config var set (as well as ANYCABLE_HOST), both of which were "0.0.0.0".
I'll remove --rpc-host="0.0.0.0:50051"
as well.
I was running the default version. IIRC 1.1.0?
from anycable-rails.
Hm. It must have been either the addition of --rpc-host="0.0.0.0:50051"
or having the ANYCABLE_RPC_HOST variable overwriting something with 0.0.0.0
.
It does in fact work now.
Using anycable-go 1.1.0.
"every engineer" != "every good engineer" indeed 🤷♂️
from anycable-rails.
Related Issues (20)
- can't run bundle exec anycable HOT 9
- AnyCable Deployment Guide HOT 4
- Nearly Complete Deployment w/Anycable HOT 3
- Does anycable truly depend on latest & greatest Ruby/Rails? HOT 2
- Rails 7 compatibility issue HOT 41
- log4r broken in development HOT 6
- Flutter app is connecting fine to wss, but actual subscribe is throwing unknown command type errors HOT 2
- Cannot call handle_open to handle JWT expiration HOT 2
- RPC memory usage - pods OOMkilled with 4GB allocated per pod HOT 4
- Anycable-rails and Seachkick together hangs the server HOT 2
- Tenant getting lost during identifier serialization HOT 3
- ActionController::RoutingError (No route matches [GET] "/cable")
- Devise authentication/sessions not working HOT 1
- What's the best way to close open connections on forking? HOT 5
- Issue with anycable-rpc crashing on start `terminate called after throwing an instance of 'std::logic_error'` HOT 2
- ActiveSupport::Logger.broadcast method is dropped HOT 8
- Issues with gRPC Communication between AnyCable Go and AnyCable Rails HOT 2
- ActionController::RoutingError (No route matches [GET] "/cable"): HOT 7
- reconnect option not forwarded in ActionCable::RemoteConnections::RemoteConnection#disconnect HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anycable-rails.