[TEST] The client adapter does not support streaming responses. Please use :buffer response mode.
Closed this issue · 9 comments
I'm receiving the error during tests:
The client adapter does not support streaming responses. Please use :buffer response mode.
But I don't understand how to specify that streaming mode is supported.
Config:
config :reverse_proxy_plug, :http_client, ReverseProxyPlug.HTTPClient.Adapters.HTTPoison
Elixir version: 1.16.1
It will be detected automatically - it is whether or not stream_response/1
exists in the module, essentially.
To eliminate some possibilities:
- do you have
httpoison
installed as a dependency? - do you have any
:client
options supplied to individualReverseProxyPlug
lines in the router?
It will be detected automatically - it is whether or not
stream_response/1
exists in the module, essentially.To eliminate some possibilities:
- do you have
httpoison
installed as a dependency?- do you have any
:client
options supplied to individualReverseProxyPlug
lines in the router?
Hi thank you for the response!
- Yes httpoison is installed with latest version: 2.2.1
- No any other option added:
forward("/url", MyApp.Plug.UrlProxy)
we are just using forward with no any other opts
This is also happening to us in our development instances after bumping to 2.4. We have HTTPoison 2.2.1
. I also tried with Tesla, but not luck.
// config.exs
config :reverse_proxy_plug, :http_client, ReverseProxyPlug.HTTPClient.Adapters.HTTPoison
// router.ex
get "/*path", ReverseProxyPlug, upstream: ....
@mwhitworth any news on that?
@mwhitworth any news on that?
I'm waiting for appropriate access to fix and override some CI issues, as I've left the Tallarium organization.
Once that happens (the contact is away on leave), I'll address this as soon as possible.
@mwhitworth any news on that?
I'm waiting for appropriate access to fix and override some CI issues, as I've left the Tallarium organization.
Once that happens (the contact is away on leave), I'll address this as soon as possible.
No problem, thank you very much
According to our observation, the problem lies here:
reverse_proxy_plug/lib/reverse_proxy_plug.ex
Lines 412 to 416 in ad649d6
If you have :http_client
config set, it results in the first branch. However, since this branch does not involve dynamic code loading, it can cause crash (at subsequent ensure_response_mode_compatibility/1
check) after module unloading happened somewhere else in your development process. For instance, auto-recompiling using exsync.
If :http_client
config is NOT set, it results in the second branch (fallback to Adapters.HTTPoison
) where it always calls Code.ensure_loaded?/1
, thus the module is always loaded before ensure_response_mode_compatibility/1
check.
So interestingly, "NOT" setting :http_client
config in your config.exs can be temporary workaround.
According to our observation, the problem lies here:
reverse_proxy_plug/lib/reverse_proxy_plug.ex
Lines 412 to 416 in ad649d6
If you have
:http_client
config set, it results in the first branch. However, since this branch does not involve dynamic code loading, it can cause crash (at subsequentensure_response_mode_compatibility/1
check) after module unloading happened somewhere else in your development process. For instance, auto-recompiling using exsync.If
:http_client
config is NOT set, it results in the second branch (fallback toAdapters.HTTPoison
) where it always callsCode.ensure_loaded?/1
, thus the module is always loaded beforeensure_response_mode_compatibility/1
check.So interestingly, "NOT" setting
:http_client
config in your config.exs can be temporary workaround.
Yeah in that way it works 🤯