我正在尝试使用ghost-s3-storage设置Ghost博客。我之前没有遇到任何问题,但这次似乎无法得到它。我不认为这是桶权限。区域是否为空?
以下是我上传的错误:
2016-06-08T15:42:06.881035+00:00 app[web.1]: error in ghost-s3 { [AccessDenied: Access Denied]
2016-06-08T15:42:06.881077+00:00 app[web.1]: message: 'Access Denied',
2016-06-08T15:42:06.881081+00:00 app[web.1]: time: Wed Jun 08 2016 15:42:06 GMT+0000 (UTC),
2016-06-08T15:42:06.881079+00:00 app[web.1]: code: 'AccessDenied',
2016-06-08T15:42:06.881080+00:00 app[web.1]: region: null,
2016-06-08T15:42:06.881083+00:00 app[web.1]: extendedRequestId: '9pm89M2uPOWf2bhXIYjZ0osMsX+fuBAMszuaZIx/oUVA/wSDVDO3d07lSfbEXuqnQe6xohwDDg8=',
2016-06-08T15:42:06.881084+00:00 app[web.1]: cfId: undefined,
2016-06-08T15:42:06.881085+00:00 app[web.1]: statusCode: 403,
2016-06-08T15:42:06.881085+00:00 app[web.1]: retryable: false,
2016-06-08T15:42:06.881086+00:00 app[web.1]: retryDelay: 49.723599618300796 }
2016-06-08T15:42:06.886449+00:00 app[web.1]:
2016-06-08T15:42:06.886465+00:00 app[web.1]: AccessDenied: Access Denied
2016-06-08T15:42:06.886467+00:00 app[web.1]: at Request.callListeners (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
2016-06-08T15:42:06.886468+00:00 app[web.1]: at Request.emit (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
2016-06-08T15:42:06.886466+00:00 app[web.1]: at Request.extractError (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/services/s3.js:473:35)
2016-06-08T15:42:06.886463+00:00 app[web.1]: ERROR: Access Denied
2016-06-08T15:42:06.886464+00:00 app[web.1]:
2016-06-08T15:42:06.881082+00:00 app[web.1]: requestId: '81D1EEB75F964D1C',
2016-06-08T15:42:06.886468+00:00 app[web.1]: at Request.emit (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/request.js:615:14)
2016-06-08T15:42:06.886469+00:00 app[web.1]: at Request.transition (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/request.js:22:10)
2016-06-08T15:42:06.886471+00:00 app[web.1]: at /app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/state_machine.js:26:10
2016-06-08T15:42:06.886470+00:00 app[web.1]: at AcceptorStateMachine.runTo (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/state_machine.js:14:12)
2016-06-08T15:42:06.886471+00:00 app[web.1]: at Request. (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/request.js:38:9)
2016-06-08T15:42:06.886472+00:00 app[web.1]: at Request. (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/request.js:617:12)
2016-06-08T15:42:06.886473+00:00 app[web.1]: at Request.emit (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
2016-06-08T15:42:06.886476+00:00 app[web.1]: at /app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/state_machine.js:26:10
2016-06-08T15:42:06.886474+00:00 app[web.1]: at Request.emit (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/request.js:615:14)
2016-06-08T15:42:06.886475+00:00 app[web.1]: at Request.transition (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/request.js:22:10)
2016-06-08T15:42:06.886475+00:00 app[web.1]: at AcceptorStateMachine.runTo (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/state_machine.js:14:12)
2016-06-08T15:42:06.886477+00:00 app[web.1]: at Request. (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/request.js:38:9)
2016-06-08T15:42:06.886478+00:00 app[web.1]: at Request.callListeners (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
2016-06-08T15:42:06.886479+00:00 app[web.1]: at callNextListener (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:95:12)
2016-06-08T15:42:06.886473+00:00 app[web.1]: at Request.callListeners (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
2016-06-08T15:42:06.886478+00:00 app[web.1]: at Request. (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/request.js:617:12)
2016-06-08T15:42:06.886482+00:00 app[web.1]: at endReadableNT (_stream_readable.js:913:12)
2016-06-08T15:42:06.886480+00:00 app[web.1]: at IncomingMessage.onEnd (/app/node_modules/ghost-s3-storage/node_modules/aws-sdk/lib/event_listeners.js:209:11)
2016-06-08T15:42:06.886481+00:00 app[web.1]: at emitNone (events.js:72:20)
2016-06-08T15:42:06.886481+00:00 app[web.1]: at IncomingMessage.emit (events.js:166:7)
2016-06-08T15:42:06.887561+00:00 app[web.1]: 24.130.248.207 - - [08/Jun/2016:15:42:06 +0000] "POST /ghost/api/v0.1/uploads/ HTTP/1.1" 403 74 "https://secure-retreat-26998.herokuapp.com/ghost/editor/1/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"
2016-06-08T15:42:06.886483+00:00 app[web.1]: at nextTickCallbackWith2Args (node.js:442:9)
2016-06-08T15:42:06.886483+00:00 app[web.1]: at process._tickDomainCallback (node.js:397:17)
2016-06-08T15:42:06.886484+00:00 app[web.1]:
2016-06-08T15:42:06.869275+00:00 heroku[router]: at=info method=POST path="/ghost/api/v0.1/uploads/" host=myapp.herokuapp.com request_id=e99bb332-dc4f-40f4-943d-918c0d870df8 fwd="24.130.248.207" dyno=web.1 connect=0ms service=786ms status=403 bytes=407
这是我的config.js:
storage: {
active: 'ghost-s3',
'ghost-s3': {
accessKeyId: 'ID',
secretAccessKey: 'secret',
bucket: 'bucketname',
region: 'us-west-1',
assetHost: 'https://bucketname.s3-us-west-1.amazonaws.com/'
}
}
该区域显然在那里,为什么日志中它为空?
答案 0 :(得分:1)
您必须指定允许文件上传的用户政策,例如
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["s3:*"],
"Resource": ["arn:aws:s3:::bucketname/*"]
}]
}