charliekelly
"enetunreach" error message when making HTTP requests while testing
When making HTTP requests inside a test using HTTPotion such as HTTPotion.get("https://google.com") I get the following error message as response: {:error, %{code: 500, message: "enetunreach"}} I have tried the same request using Postman and it works OK.
Marked As Solved
NobbZ
This still does not answer the question if you live behind a proxy. You do not necessarily need to know about it. Some providers, especially those using mobile networks, are very good at hiding proxies. Also some corporate networks do some hidden proxiing.
But this is basically it… From what we are able to see it is a network issue and has to be debugged as such. Try sniffing using wireshark or tcpdump and compare sent requests. perhaps you see some significant difference?
Also Liked
NobbZ
HTTPotion.get/2 shouldn’t even return an :error tuple, according to its spec…
It returns a HTTPotion.http_result/0.
So could you please show the full code that produces this result?
edit Skimming httpotions code I also can’t find a codepath that would generate a tuple of any kind… All requests end with calling into this function:
https://github.com/myfreeweb/httpotion/blob/master/lib/httpotion.ex#L287-L312
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








