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

** (KeyError) key :status_code not found in: %HTTPotion.ErrorResponse{message: "req_timedout"} #14

Open
thomasdola opened this issue Jun 30, 2017 · 10 comments

Comments

@thomasdola
Copy link

keep getting this error anytime i try to upload..
** (KeyError) key :status_code not found in: %HTTPotion.ErrorResponse{message: "req_timedout"}
any help ?

@ewitchin
Copy link
Member

We are looking into this issue. Thank you for reporting!

@mjaric
Copy link
Collaborator

mjaric commented Aug 17, 2017

Hi @thomasdola
Thanks for reporting the issue. I managed to reproduce the issue and it happens some time that authentication timeouts in rare cases. We will update library but it could be breaking change. We need to change return type for some functions which so far didn't return tuple {:ok, result} or {:error, error}.

I will let you know when this is done, and write little breakdown about which functions are changed.

Thank you
Milan Jaric

@thomasdola
Copy link
Author

thank you..
Another thing i noticed was anytime i start the server it tries to make a request to rackspace.
the issue with this is that in case i do not have internet or internet is being slow, it affects everything.. including running test, booting the server...
is there any solution to this..?
Or is it by design? If yes why?
thanks...

@mjaric
Copy link
Collaborator

mjaric commented Aug 18, 2017

I'm preparing new version which should return {:error, something} for all function calls. So it should help you to decide if you want to teardown your app or not, or repeat same call again, or something else. I doubt that first author of this library had in mind design where it should teardown your app, it is just missed case in code.

@thomasdola
Copy link
Author

thanks..
so when can we expect this update?

@mjaric
Copy link
Collaborator

mjaric commented Aug 18, 2017

Next week.

@mjaric
Copy link
Collaborator

mjaric commented Aug 19, 2017

@thomasdola this should be fixed now. Could you please give it a try from latest master commit. Please note that error (the timeout) will be bubbled back as return value of any call which fails to complete in given timeframe as %Rackspace.Error{code: 0, message: "req_timedout"} so you can do pattern match with case for instance. If that happens you could either retry with same parameters or let process crash ...

There is one more thing. In case of bad network connectivity, if you are starting application and try to execute any function the error will be probably %Rackspace.Error{code: 0, message: "nxdomain"} if auth could not pass due lack of DNS name resolution. All network related errors have code equal to 0 (zero)

Let me know if latest version works for you so I can close the issue.

Thanks!

@thomasdola
Copy link
Author

== Compilation error in file lib/rackspace/api/cloud_files/container.ex == ** (CompileError) lib/rackspace/api/cloud_files/container.ex:35: undefined function base_url/1 (stdlib) lists.erl:1338: :lists.foreach/2 (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

@mjaric
Copy link
Collaborator

mjaric commented Aug 24, 2017

Could you please tell me which elixir and erlang version you are using?

@thomasdola
Copy link
Author

elixir v1.5.1.1
erlang v20.0.1

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

No branches or pull requests

3 participants