当我尝试在我的rails网站上传文件(带载波/雾)时,我收到403错误。一切都在本地工作,并且我在不同的网站上使用相同的aws桶。
不确定如何解决此问题...以下是我的完整日志:
2016-04-16T23:46:14.648046+00:00 app[web.1]: (3.8ms) ROLLBACK
2016-04-16T23:46:14.648461+00:00 app[web.1]: Completed 500 Internal Server Error in 250ms
2016-04-16T23:46:14.650859+00:00 app[web.1]:
2016-04-16T23:46:14.650868+00:00 app[web.1]: Excon::Errors::Forbidden (Expected(200) <=> Actual(403 Forbidden)
2016-04-16T23:46:14.650869+00:00 app[web.1]: excon.error.response
2016-04-16T23:46:14.650873+00:00 app[web.1]: :cookies => [
2016-04-16T23:46:14.650874+00:00 app[web.1]: "Connection" => "close"
2016-04-16T23:46:14.650872+00:00 app[web.1]: :body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>AllAccessDisabled</Code><Message>All access to this object has been disabled</Message><RequestId>E72C3A0BE72715F6</RequestId><HostId>sLnw1x3KEV4ugpi3pHCh2DwoP0eIl/mX18D3789QDSWriYM7vg6DFFUfug9ylyuGExvhaIlXUIo=</HostId></Error>"
2016-04-16T23:46:14.650873+00:00 app[web.1]: ]
2016-04-16T23:46:14.650874+00:00 app[web.1]: :headers => {
2016-04-16T23:46:14.650876+00:00 app[web.1]: "Date" => "Sat, 16 Apr 2016 23:46:13 GMT"
2016-04-16T23:46:14.650875+00:00 app[web.1]: "Content-Type" => "application/xml"
2016-04-16T23:46:14.650878+00:00 app[web.1]: "x-amz-id-2" => "sLnw1x3KEV4ugpi3pHCh2DwoP0eIl/mX18D3789QDSWriYM7vg6DFFUfug9ylyuGExvhaIlXUIo="
2016-04-16T23:46:14.650878+00:00 app[web.1]: "x-amz-request-id" => "E72C3A0BE72715F6"
2016-04-16T23:46:14.650877+00:00 app[web.1]: "Server" => "AmazonS3"
2016-04-16T23:46:14.650879+00:00 app[web.1]: }
2016-04-16T23:46:14.650880+00:00 app[web.1]: :local_address => "172.17.72.90"
2016-04-16T23:46:14.650880+00:00 app[web.1]: :host => "s3.amazonaws.com"
2016-04-16T23:46:14.650881+00:00 app[web.1]: :local_port => 56731
2016-04-16T23:46:14.650882+00:00 app[web.1]: :path => "/uploads/song/track/5/snare_card_2.wav"
2016-04-16T23:46:14.650882+00:00 app[web.1]: :port => 443
2016-04-16T23:46:14.650883+00:00 app[web.1]: :remote_ip => "54.231.14.104"
2016-04-16T23:46:14.650883+00:00 app[web.1]: :reason_phrase => "Forbidden"
2016-04-16T23:46:14.650884+00:00 app[web.1]: :status => 403
2016-04-16T23:46:14.650885+00:00 app[web.1]: :status_line => "HTTP/1.1 403 Forbidden\r\n"
2016-04-16T23:46:14.650885+00:00 app[web.1]: ):
有什么想法吗?
答案 0 :(得分:0)
答案 1 :(得分:0)
我弄清楚了这个灾难错误信息是如何产生的。当我为s3存储桶设置我的heroku配置时,我称之为S3_BUCKET_KEY,它与我的aws初始化程序“S3_BUCKET”中的变量不匹配,所以没有任何效果。
我采取了解决问题的步骤:
在命令行上 -
heroku config:set S3_BUCKET="bucket_name"