{"action":"opened","issue":{"url":"https://api.github.com/repos/CargoSense/ex_aws/issues/111","repository_url":"https://api.github.com/repos/CargoSense/ex_aws","labels_url":"https://api.github.com/repos/CargoSense/ex_aws/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/CargoSense/ex_aws/issues/111/comments","events_url":"https://api.github.com/repos/CargoSense/ex_aws/issues/111/events","html_url":"https://github.com/CargoSense/ex_aws/issues/111","id":132368050,"number":111,"title":"S3 Timeouts","user":{"login":"dmitriid","id":32768,"avatar_url":"https://avatars.githubusercontent.com/u/32768?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitriid","html_url":"https://github.com/dmitriid","followers_url":"https://api.github.com/users/dmitriid/followers","following_url":"https://api.github.com/users/dmitriid/following{/other_user}","gists_url":"https://api.github.com/users/dmitriid/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriid/subscriptions","organizations_url":"https://api.github.com/users/dmitriid/orgs","repos_url":"https://api.github.com/users/dmitriid/repos","events_url":"https://api.github.com/users/dmitriid/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-09T09:22:43Z","updated_at":"2016-02-09T09:22:43Z","closed_at":null,"body":"I'm getting timeouts when trying to upload to S3. Most likely something wrong with how I do things :)\r\n\r\nThe credentials are for the user which has ` AmazonS3FullAccess` and `AdministratorAccess`. The bucket is located in `US Standard`.\r\n\r\n```elixir\r\n#config/config.exs\r\n\r\nuse Mix.Config\r\n\r\nconfig :slax, :ex_aws,\r\n   access_key_id: [{:system, \"acess\"}, :instance_role],\r\n   secret_access_key: [{:system, \"secret\"}, :instance_role],\r\n   region: \"us-west-1\" ## timeouts with or without it, doesn't matter\r\n```\r\n\r\n```elixir\r\ndefmodule Slax do\r\n  use ExAws.S3.Client, otp_app: :slax\r\n\r\n  def go(path) do\r\n    contents = File.read(path)\r\n\r\n    name = \"#{ZBase32.encode(Path.basename(path))}#{Path.extname(path)}\"\r\n\r\n    {:ok, stat} = File.stat(path)\r\n    size = stat.size |> Integer.to_string\r\n\r\n    put_object(\"media.dmitriid.com\", name, contents, [{:content_type, \"image/png\"}, {:content_length, size}])\r\n\r\n  end\r\nend\r\n```\r\n\r\n```\r\nex(1)> Slax.go(\"/.../a.png\")\r\n** (exit) exited in: GenServer.call(ExAws.Config.AuthCache, {:refresh_config, %Slax{config: %{access_key_id: [{:system, \"access\"}, :instance_role], host: %{\"ap-northeast-1\" => \"s3-ap-northeast-1.amazonaws.com\", \"ap-southeast-1\" => \"s3-ap-southeast-1.amazonaws.com\", \"ap-southeast-2\" => \"s3-ap-southeast-2.amazonaws.com\", \"eu-central-1\" => \"s3-eu-central-1.amazonaws.com\", \"eu-west-1\" => \"s3-eu-west-1.amazonaws.com\", \"sa-east-1\" => \"s3-sa-east-1.amazonaws.com\", \"us-east-1\" => \"s3.amazonaws.com\", \"us-west-1\" => \"s3-us-west-1.amazonaws.com\", \"us-west-2\" => \"s3-us-west-2.amazonaws.com\"}, http_client: ExAws.Request.HTTPoison, json_codec: Poison, region: \"us-west-1\", scheme: \"https://\", secret_access_key: [{:system, \"secret\"}, :instance_role]}, service: :s3}}, 5000)\r\n    ** (EXIT) time out\r\n    (elixir) lib/gen_server.ex:564: GenServer.call/3\r\n    (ex_aws) lib/ex_aws/config.ex:59: ExAws.Config.retrieve_runtime_value/2\r\n    (elixir) lib/stream.ex:454: anonymous fn/4 in Stream.map/2\r\n    (elixir) lib/enum.ex:2744: Enumerable.List.reduce/3\r\n    (elixir) lib/stream.ex:1247: Enumerable.Stream.do_each/4\r\n    (elixir) lib/enum.ex:790: Enum.find/3\r\n    (ex_aws) lib/ex_aws/config.ex:45: anonymous fn/3 in ExAws.Config.retrieve_runtime_config/1\r\n    (stdlib) lists.erl:1262: :lists.foldl/3\r\niex(1)>\r\n10:11:57.412 [error] GenServer ExAws.Config.AuthCache terminating\r\n** (CaseClauseError) no case clause matching: {:error, %{__exception__: true, id: nil, reason: :connect_timeout}}\r\n    (ex_aws) lib/ex_aws/instance_meta.ex:5: ExAws.InstanceMeta.request/2\r\n    (ex_aws) lib/ex_aws/instance_meta.ex:15: ExAws.InstanceMeta.security_credentials/1\r\n    (ex_aws) lib/ex_aws/config/auth_cache.ex:37: ExAws.Config.AuthCache.refresh_config/2\r\n    (ex_aws) lib/ex_aws/config/auth_cache.ex:27: ExAws.Config.AuthCache.handle_call/3\r\n    (stdlib) gen_server.erl:629: :gen_server.try_handle_call/4\r\n    (stdlib) gen_server.erl:661: :gen_server.handle_msg/5\r\n    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3\r\nLast message: {:refresh_config, %Slax{config: %{access_key_id: [{:system, \"access\"}, :instance_role], host: %{\"ap-northeast-1\" => \"s3-ap-northeast-1.amazonaws.com\", \"ap-southeast-1\" => \"s3-ap-southeast-1.amazonaws.com\", \"ap-southeast-2\" => \"s3-ap-southeast-2.amazonaws.com\", \"eu-central-1\" => \"s3-eu-central-1.amazonaws.com\", \"eu-west-1\" => \"s3-eu-west-1.amazonaws.com\", \"sa-east-1\" => \"s3-sa-east-1.amazonaws.com\", \"us-east-1\" => \"s3.amazonaws.com\", \"us-west-1\" => \"s3-us-west-1.amazonaws.com\", \"us-west-2\" => \"s3-us-west-2.amazonaws.com\"}, http_client: ExAws.Request.HTTPoison, json_codec: Poison, region: \"us-west-1\", scheme: \"https://\", secret_access_key: [{:system, \"secret\"}, :instance_role]}, service: :s3}}\r\nState: ExAws.Config.AuthCache\r\n```"}}