[英]EntityAlreadyExists: Role with name chatbot-andrea-executor already exists
I am creating a Nodebot with claudiajs. 我正在用claudiajs创建一个Nodebot。
const botBuilder = require('claudia-bot-builder')
const excuse = require('huh')
module.exports = botBuilder((req) => {
return `Thanks for sending ${req.text}. Your message is very important to us, but ${excuse.get()}`
})
but when I am deploying to aws cloud. 但是当我部署到AWS Cloud时。
claudia create --region us-east-1 --api-module app
I am getting this error: 我收到此错误:
{ EntityAlreadyExists: Role with name chatbot-andrea-executor already exists.
at Request.extractError (/.nvm/versions/node/v6.10.3/lib/node_modules/claudia/node_modules/aws-sdk/lib/protocol/query.js:47:29)
at Request.callListeners (/.nvm/versions/node/v6.10.3/lib/node_modules/claudia/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at Request.emit (/.nvm/versions/node/v6.10.3/lib/node_modules/claudia/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
at Request.emit (/.nvm/versions/node/v6.10.3/lib/node_modules/claudia/node_modules/aws-sdk/lib/request.js:678:14)
at Request.transition (/.nvm/versions/node/v6.10.3/lib/node_modules/claudia/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/.nvm/versions/node/v6.10.3/lib/node_modules/claudia/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /.nvm/versions/node/v6.10.3/lib/node_modules/claudia/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/.nvm/versions/node/v6.10.3/lib/node_modules/claudia/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/.nvm/versions/node/v6.10.3/lib/node_modules/claudia/node_modules/aws-sdk/lib/request.js:680:12)
at Request.callListeners (/.nvm/versions/node/v6.10.3/lib/node_modules/claudia/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
message: 'Role with name chatbot-andrea-executor already exists.',
code: 'EntityAlreadyExists',
time: 2017-05-19T19:03:01.956Z,
requestId: '-requestId (I changed it)-',
statusCode: 409,
retryable: false,
retryDelay: 4.143280988568199 }
As it is very clever, there is a role in aws that has the same name. 因为它非常聪明,所以aws中有一个角色具有相同的名称。 So, you can try to change the name of the role in your code but how we are using a prebuilt Nodebot solution we have not too much choices. 因此,您可以尝试在代码中更改角色的名称,但是我们如何使用预构建的Nodebot解决方案没有太多选择。 So, delete the role is the answer. 因此,删除角色就是答案。
You can find more info about this name collision, here . 您可以在此处找到有关此名称冲突的更多信息。
For me, the issue was the app was already deployed to aws lambda and I already have a facebook bot. 对我来说,问题在于该应用程序已经部署到了AWS Lambda,而且我已经有了一个Facebook机器人。
I wanted to create a telegram bot and that's why the issue happened. 我想创建一个电报机器人,这就是问题发生的原因。
Then, I used update
rather than create
like: 然后,我使用了update
而不是像这样create
:
claudia update --region us-central-1 --api-module bot --configure-telegram-bot
and it worked for me, 它对我有用
I just find that even (if you need to) you can set the role in the deployment command: 我只是发现,即使(如果需要)您也可以在部署命令中设置角色:
claudia create --region us-east-1 --role chatbot-andrea-executor --api-module app
You have to replace the name on collision after --role 's flag. 您必须在--role标志后替换冲突时的名称。 Also you are more curios about here is a good starting point about custom deployments. 另外,您对这里的好奇心也更多, 这是有关自定义部署的一个很好的起点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.