Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services Fog、S3和iam实例配置文件:Excon禁止_Amazon Web Services_Fog - Fatal编程技术网

Amazon web services Fog、S3和iam实例配置文件:Excon禁止

Amazon web services Fog、S3和iam实例配置文件:Excon禁止,amazon-web-services,fog,Amazon Web Services,Fog,我试图列出带有Fog的S3存储桶中的内容,但经常出现错误: The request signature we calculated does not match the signature you provided. Check your key and signing method. 设置的详细信息 EC2实例 IAM角色“S3BucketAccess”: 169.254.169.254/latest/meta-data/iam/security-credentials/S3BucketAc

我试图列出带有Fog的S3存储桶中的内容,但经常出现错误:

The request signature we calculated does not match the signature you provided. Check your key and signing method.
设置的详细信息 EC2实例

IAM角色“S3BucketAccess”:

169.254.169.254/latest/meta-data/iam/security-credentials/S3BucketAccess

{
  "Code" : "Success",
  "LastUpdated" : "2013-06-28T11:54:08Z",
  "Type" : "AWS-HMAC",
  "AccessKeyId" : "XXXXXXXXXX",
  "SecretAccessKey" : "YYYYYYYYYY",
  "Token" : "ALongToken",
  "Expiration" : "2013-06-28T18:15:09Z"
}
Ruby代码:

require 'rubygems'
require 'fog'
connection = Fog::Storage::AWS.new({:use_iam_profile => true})
p connection.directories

获取带有上述错误代码的严重错误消息/堆栈跟踪。

您使用的是什么版本的fog?你能从错误中抓住并分享尸体吗?它通常有一个“预期的”与“收到的”签名,这对解决签名问题有很大帮助。谢谢

fog 1.14.0于2013年7月19日发布,其决议如下(1923年版是本次发行的结果)。更新解决了这个问题。

在fog项目上打开了一个bug——它的带有Excon 0.23.0的fog 1.12.1。
require 'rubygems'
require 'fog'
connection = Fog::Storage::AWS.new({:use_iam_profile => true})
p connection.directories