简体   繁体   中英

Timeout error when listing S3 buckets using erlcloud

I'm trying to use the erlcloud library for S3 uploads in my app. As a test, I'm trying to get it to list buckets via an iex console:

iex(4)> s3 = :erlcloud_s3.new("KEY_ID", "SECRET_KEY")
...
iex(5)> :erlcloud_s3.list_buckets(s3)
** (ErlangError) erlang error: {:aws_error, {:socket_error, :timeout}}
    (erlcloud) src/erlcloud_s3.erl:909: :erlcloud_s3.s3_request/8
    (erlcloud) src/erlcloud_s3.erl:893: :erlcloud_s3.s3_xml_request/8
    (erlcloud) src/erlcloud_s3.erl:238: :erlcloud_s3.list_buckets/1

I've checked that inets , ssl , and erlcoud are all started, and I know the credentials work fine, because I've tested them in a similar fashion with a Ruby library in irb .

I've tried configuring it with a longer timeout, but no matter how high I set it I still get this error.

Any ideas? Or approaches I could take to debug this?

I could simulate the same error, and could resolve it by replacing double-quote with single-quote.

> iex(4)> s3 = :erlcloud_s3.new('KEY_ID', 'SECRET_KEY')
> iex(5)> :erlcloud_s3.list_buckets(s3)

Assuming the double-quote was used, it may be caused by a type mismatch between string and char-list.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM