简体   繁体   English

使用erlcloud列出S3存储桶时出现超时错误

[英]Timeout error when listing S3 buckets using erlcloud

I'm trying to use the erlcloud library for S3 uploads in my app. 我正在尝试在我的应用程序中使用erlcloud库进行S3上传。 As a test, I'm trying to get it to list buckets via an iex console: 作为测试,我试图通过iex控制台来列出存储桶:

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 . 我已经检查过inetssslerlcoud都已启动了,我知道凭证工作正常,因为我已经用类似的方式测试了它们与irb的Ruby库。

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. 假设使用了双引号,可能是由字符串和char-list之间的类型不匹配引起的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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