mickel8
Membrane Core Team
Hi, I am trying to stream data to Google Cloud Speech-To-Text and receive a response but almost every request ends up with an error
%GRPC.RPCError{status: 2, message: "unexpected when waiting for headers: {:data, <<0, 0, 0, 0, 62, 42, 4, 50, 2, 8, 21, 50, 54, 10, 34, 10, 27, 32, 109, 97, 121, 98, 101, 32, 109, 97, 121, 98, 101, 32, 115, 111, 109, 101, 116, 104, 105, 110, 103, 32, 101, 108, 115, 101, 21, 57, 172, 96, ...>>}"}
or
%GRPC.RPCError{status: 2, message: "unexpected when waiting for headers: {:trailers, [{\"grpc-status\", \"0\"}, {\"content-disposition\", \"attachment\"}, {\"x-goog-ext-27651507-bin\", \"DbOLmjwVzczMPQ==\"}, {\"x-goog-ext-9650773-bin\", \"DUh68T8=\"}]}"}
The flow is more or less
GRPC.Stub.connect(@service_url,
cred: cred,
adapter_opts: adapter_opts,
adapter: GRPC.Client.Adapters.Gun,
headers: %{
"Authorization" => authorization_header(),
"Content-Type" => "application/grpc"
}
)
GRPC.Stub.send_request(stream, request)
GRPC.Stub.recv(stream, timeout: timeout)
When I changed the adapter from Gun to Mint, the library crashes
[error] GenServer #PID<0.16840.0> terminating
** (ArgumentError) request with request reference #Reference<0.200553127.2209087489.150902> was not found
(mint 1.4.2) lib/mint/http2.ex:765: Mint.HTTP2.get_window_size/2
(grpc 0.6.0) lib/grpc/client/adapters/mint/connection_process/connection_process.ex:347: GRPC.Client.Adapters.Mint.ConnectionProcess.get_window_size/2
(grpc 0.6.0) lib/grpc/client/adapters/mint/connection_process/connection_process.ex:205: GRPC.Client.Adapters.Mint.ConnectionProcess.handle_continue/2
(stdlib 5.1.1) gen_server.erl:1067: :gen_server.try_handle_continue/3
(stdlib 5.1.1) gen_server.erl:977: :gen_server.loop/7
(stdlib 5.1.1) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
Last message: {:continue, :process_request_stream_queue}
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mickel8
Okay I found the problem
That’s because of my default
handle_infocallback which drops messages. Gun by default sends messages to a process that spawns it. Because it’s my gen server who calls grpc functions, it’s also my gen server who spawns gunif anything from gun comes to my gen server before I call
GRPC.Stub.recv(sogun:awaitunder the hood), this message will be dropped by myhandle_infoif messages come after I call
GRPC.Stub.recv, everything is okay as Stub.recv is blocking and goes through the whole mailboxLooks like GRPC.Stub.recv can’t be used in GenServers