Skip to content
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

FunctionClauseError no function clause matching in :hackney_response.stream_body_recv/2 #730

Open
spyrbri opened this issue Nov 9, 2023 · 6 comments
Assignees

Comments

@spyrbri
Copy link

spyrbri commented Nov 9, 2023

Hello, after upgrading from 1.18.1 to 1.19.1 we started getting this error.

It happens randomly. One request may pass through but the next may fail.

FunctionClauseError: no function clause matching in :hackney_response.stream_body_recv/2
:hackney_response.stream_body_recv/2 (hackney)(/app/deps/hackney/src/hackney_response.erl:169)
:hackney_response.read_body/3 (hackney)(/app/deps/hackney/src/hackney_response.erl:312)
anonymous fn/1 in :hackney.body/1 (hackney)(/app/deps/hackney/src/hackney.erl:510)
Tesla.Adapter.Hackney.handle/1 (tesla)(lib/tesla/adapter/hackney.ex:102)
Tesla.Adapter.Hackney.call/2 (tesla)(lib/tesla/adapter/hackney.ex:33)
Tesla.Middleware.FollowRedirects.redirect/3 (tesla)(lib/tesla/middleware/follow_redirects.ex:46)
Tesla.Middleware.JSON.call/3 (tesla)(lib/tesla/middleware/json.ex:54)

This is an example of a failed request

:hackney_response.stream_body_recv("", 
  {:client, {1699, 521127, 152004}, 
   {:metrics_ng, :metrics_dummy}, 
   :hackney_tcp, '[ANONYMIZED_HOST]', 80, 
   "[ANONYMIZED_HOST]", [recv_timeout: 5000], 
   #Port<0.3196>, 
   {:default, #Reference<0.3739800695.3888119809.153571>, 
    {:connection, :hackney_tcp, '[ANONYMIZED_HOST]', 80, 109744905, false}, 
    #PID<0.861.0>, 
    :hackney_tcp}, 
   #Reference<0.3739800695.3888119809.153571>, 
   true, 
   :hackney_pool, 
   5000, 
   false, 
   5, 
   false, 
   5, 
   nil, 
   nil, 
   {:hparser, :response, 4096, 10, 0, 
    :on_trailers, "\r", {1, 1}, "", [], :undefined, 
    "chunked", "keep-alive", "application/json; charset=utf-8", "", :done}, 
   {16, 
    {:dict, 16, 16, 16, 8, 80, 48, 
     {[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []}, 
     {{[], 
       [["server-timing", {15, "Server-Timing", "total;dur=106.72569298185408"}]], 
       ["x-content-type-options", {6, "X-Content-Type-Options", "nosniff"}], 
      [], 
      [], 
      [["etag", {11, "ETag", "W/\"1217c0895af4af2440e1ea3724ebe820\""}]], 
       ["x-permitted-cross-domain-policies", {8, "X-Permitted-Cross-Domain-Policies", "none"}], 
       ["cache-control", {12, "Cache-Control", "max-age=0, private, must-revalidate"}]], 
      [["x-download-options", {7, "X-Download-Options", "noopen"}]], 
      [], 
      [["content-type", {1, "Content-Type", ...}], 
       ["transfer-encoding", {2, ...}]], 
      [["referrer-policy", {9, ...}]], 
      [["connection", {...}], ["x-frame-options", ...], [...]], 
      [], 
      [], 
      []}}}}, 
   :connected, 
   :waiting, 
   nil, 
   :normal, 
   false, 
   false, 
   false, 
   :undefined, 
   false, 
   &:hackney_request.send/2, 
   :waiting, 
   nil, 
   4096, 
   "", 
   [], 
   {1, 1}, 
   :undefined, 
   "chunked", 
   nil, 
   "POST", 
   "/path", 
   nil})

Do you have any idea why this can be happening?

@TeoDiaz
Copy link

TeoDiaz commented Nov 23, 2023

I have the same issue with version 1.18.2.

Logs point me out to this line

@benoitc
Copy link
Owner

benoitc commented Nov 24, 2023

Did you try latest version ? This issue should be solved but let me know.

@benoitc benoitc self-assigned this Nov 24, 2023
@TeoDiaz
Copy link

TeoDiaz commented Nov 24, 2023

Hi @benoitc , This morning I just update to the 1.20.1 and since then I have not seen the error again, so I think it's solved.

Is there any place were we can see the Changelog or what fixes where implemented on each version?

@benoitc
Copy link
Owner

benoitc commented Nov 24, 2023

The change log is here : https://github.com/benoitc/hackney/blob/master/NEWS.md

@TeoDiaz
Copy link

TeoDiaz commented Nov 24, 2023

Thanks a lot, so I can confirm that this issue was fixed by my side, let see if @spyrbri can update the version.

Thanks for the response.

@spyrbri
Copy link
Author

spyrbri commented Dec 14, 2023

It looks ok for us too, thank you! 🎆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants