Giter Site home page Giter Site logo

Comments (11)

rmdashrfv avatar rmdashrfv commented on July 29, 2024 1

@palkan can you remove the invalid tag. This has been solved.

Thank you very much!

from anycable-rails.

rmdashrfv avatar rmdashrfv commented on July 29, 2024

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.

rmdashrfv avatar rmdashrfv commented on July 29, 2024

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.

palkan avatar palkan commented on July 29, 2024

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.

rmdashrfv avatar rmdashrfv commented on July 29, 2024

@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.

palkan avatar palkan commented on July 29, 2024

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.

rmdashrfv avatar rmdashrfv commented on July 29, 2024

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.

palkan avatar palkan commented on July 29, 2024

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.

palkan avatar palkan commented on July 29, 2024

Which anycable-go version do you run?

from anycable-rails.

rmdashrfv avatar rmdashrfv commented on July 29, 2024

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.

rmdashrfv avatar rmdashrfv commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.