gpt4 book ai didi

aws ecs execute-command failed because was not enabled(aws-ecs execute命令失败,因为未启用)

转载 作者:bug小助手 更新时间:2023-10-22 15:10:40 33 4
gpt4 key购买 nike



I am running aws ecs execute-command --cluster UltimaF --task 838d773b17954bcfbbacf343fb4fea70 --container ultima --interactive --command "/bin/sh"

我正在运行aws-ecs execute命令--cluster UltimaF--task 838d773b17954bcfbbacf343fb4fea70--container ultia--interactive--command“/bin/sh”


Getting back: An error occurred (InvalidParameterException) when calling the ExecuteCommand operation: The execute command failed because execute command was not enabled when the task was run or the execute command agent isn’t running. Wait and try again or run a new task with execute command enabled and try again.

返回:调用ExecuteCommand操作时发生错误(InvalidParameterException):execute命令失败,因为在运行任务或执行命令代理未运行时未启用execute命令。请等待并重试,或者在启用执行命令的情况下运行新任务并重试。


I have ensured that:

我已确保:



  1. The task is running.

  2. aws ecs describe-tasks --cluster UltimaF --tasks 838d773b17954bcfbbacf343fb4fea70 returns "enableExecuteCommand": true

  3. Task role has the following permissions attached:

    • ssmmessages:CreateControlChannel

    • ssmmessages:CreateDataChannel

    • ssmmessages:OpenControlChannel

    • ssmmessages:OpenDataChannel




I am running on Windows, aws-cli/2.8.2

我在Windows上运行,aws cli/2.8.2


UPDATE:
after running ecs exec checker I have two yellow items and one red:

更新:在运行ecs exec checker之后,我有两个黄色项目和一个红色项目:


    ----------
Managed Agent Status
----------
1. STOPPED (Reason: null) for "ultima" - LastStartedAt: null
----------
Init Process Enabled (first-run-task-definition:12)
----------
1. Disabled - "ultima"

UPDATE two:

更新二:


This issue suggests
ecs:clustername_taskid_containerruntimeid but for me it returns an error: An error occurred (TargetNotConnected) when calling the StartSession operation: ecs:UltimaF_838d773b17954bcfbbacf343fb4fea70_838d773b17954bcfbbacf343fb4fea70-2587323273 is not connected.

此问题表明ecs:clustername_taskid_containerruntimeid,但对我来说,它返回了一个错误:调用StartSession操作时发生错误(TargetNotConnected):ecs:UltimaF_838d773b17954bcfbbacf343fb4fea70_838d773b17954bcfbacf343FB4fea70-2587323273未连接。


Question: How do I connect?

问题:我如何连接?


更多回答

Did you go through all the requirement here? docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/…

你完成了这里的所有要求了吗?docs.aws.amazon.com/vscode/toolkit最新/userguide/…

1) I am not using VS Code here. 2) the link you sent really just mentions Enable Command Execution. I did that.

1) 我在这里没有使用VS代码。2) 您发送的链接实际上只是提到启用命令执行。我做到了。

Sorry, I gave the wrong link: docs.aws.amazon.com/AmazonECS/latest/developerguide/… But both links mention other things like the required IAM role permissions on the ECS task.

对不起,我给错了链接:docs.aws.amazon.com/AmazonECS/latest/develurguide/…但两个链接都提到了其他事情,比如ECS任务上所需的IAM角色权限。

Thank you! The link does mention managed agent needs to be running but doesn't say anything about what to do if it is Stopped and why it is.

非常感谢。该链接确实提到托管代理需要运行,但没有说明如果它被停止了该怎么办以及为什么要运行。

Did you verify it has the correct IAM permissions needed to connect to the SSM service?

您是否验证了它具有连接到SSM服务所需的正确IAM权限?

优秀答案推荐

Make sure that in your task definition's structure/JSON "enableExecuteCommand" is set to true.

确保在任务定义的结构/JSON中,“enableExecuteCommand”设置为true。


aws ecs describe-tasks --cluster <CLUSTER> --tasks <TASK_ARN>

aws-ecs描述任务-集群 -任务



I faced this issue before and after running the execute-command it's still the same so I removed the task under service and the new container got access with no issue.

我在运行execute命令之前和之后都遇到了这个问题,它仍然是一样的,所以我删除了服务中的任务,新容器可以毫无问题地访问。


更多回答

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com