简体   繁体   English

EntityAlreadyExists:名称为chatbot-andrea-executor的角色已经存在

[英]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. 因此,删除角色就是答案。

  1. go to IAM management console 转到IAM管理控制台
  2. Delete the role 删除角色

在此处输入图片说明

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.

相关问题 Parse.com on Signup用户名已存在,代码142 - Parse.com on Signup User name already exists, code 142 “请求的名称已经以其他类型存在” HTTP 409响应错误 - “The requested name already exists as a different type” HTTP 409 response error 如何检查名称是否已存在于 Firebase 实时数据库(Firebase 和 JS)中 - How to check if name already exists in Firebase Realtime Database (Firebase & JS) Webpack-全局库名称已存在时如何重用? - Webpack - How to reuse global library name when it already exists? Azure 存储避免上传文件,如果名称已经存在 - Azure storage avoid uploading file if name already exists 根据变量名称将变量设置为已存在的变量 - set variable to a variable that already exists based on name of variable 如果 PSD 文件中已存在具有特定名称的文件夹,是否可以添加条件? - Is it possible to add condition if folder with particular name exists already in PSD file? 检查选项是否已经存在 - Check if option exists already Tailwind - Autoprefixer 已经存在 - Tailwind - Autoprefixer already exists 我想验证我的数据库“名称和组”中的两列是否存在显示已存在,如果不存在则插入到数据库中 - I want to validate two columns from my database “name and group” if it exists display already exists and if it doesn't exist insert into the database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM