在收到端点 URL 的有效响应之前,连接被关闭

0

【以下的问题经过翻译处理】 我正在按照IoT Greengrass教程进行操作 - https://docs.aws.amazon.com/greengrass/v2/developerguide/defer-component-updates-tutorial.html。 我在“gdk component publish”的步骤上遇到的问题。我无法从我的开发计算机将helloworld组件发布到云服务。

问题


[2023-03-01 20:38:54] INFO - Getting project configuration from gdk-config.json [2023-03-01 20:38:54] INFO - Found component recipe file 'recipe.json' in the project directory. [2023-03-01 20:38:54] INFO - Found credentials in shared credentials file: ~/.aws/credentials [2023-03-01 20:39:10] ERROR - Failed to calculate the version of component 'com.example.BatteryAwareHelloWorld' based on the configuration. [2023-03-01 20:39:10] ERROR - Failed to publish new version of the component 'com.example.BatteryAwareHelloWorld'

=============================== ERROR =============================== Could not publish the component due to the following error. Failed to publish new version of component with the given configuration. Failed to calculate the next version of the component during publish. Error while getting the component versions of 'com.example.BatteryAwareHelloWorld' in '<<region>>' from the account '<<aws account>>' during publish. Connection was closed before we received a valid response from endpoint URL: "https://greengrass.us-east-1.amazonaws.com/greengrass/v2/components/arn%3Aaws%3Agreengrass%3A<<region>>%3A<<aws account>>%3Acomponents%3Acom.example.BatteryAwareHelloWorld/versions".

我在这里观察到的奇怪行为是,“gdk component publish”命令有时会跳过此步骤和在S3存储桶中创建artifacts。10次中只成功一次。我一直收到上面的错误。 互联网上的所有建议都说要检查 VPN 连接、防火墙设置、网络连接等,我的疑问是,为什么它在我的设置相同的情况下会成功一两次。 有人可以建议吗?

profile picture
专家
已提问 5 个月前51 查看次数
1 回答
0

【以下的回答经过翻译处理】 你好,

一般来说,此错误 - “Connection was closed before we received a valid response from endpoint URL: ...” 可能由几个原因导致,例如:

  1. 网络连接问题
  2. 防火墙拦截
  3. 数据包过滤
  4. 你调用的远程 API 的响应时间过长或是无法访问。
  5. VPC 中的互联网访问问题等

总的来说 - 这种问题通常是由于客户端方面的网络问题引起的。


现在深入探讨这个问题,你可以运行以下命令:

  1. time telnet greengrass.us-east-1.amazonaws.com 443

*这个命令将告诉你,在 greengrass 发送查询响应时,你的服务器保持连接打开的时间是多少。

+ 如果您的系统上没有安装“time”和“telnet”,假定系统是 Amazon Linux 镜像,则可以使用以下命令进行安装,。

	- yum install time -y
	- yum install telnet -y

2. route print

*路由打印命令将为我们获取实例上的路由表,以便我们了解实例上是否有任何阻止子网的内容。

  1. 您还可以在端点上执行 nslookup 或 dig,以检查是否存在任何 DNS 问题。

  2. 最后,如果您仍然遇到问题,如 Greg 所述,您可以运行 debug 参数 [3] 来检查日志。

例如,如果我遇到 sts 端点问题,我可以像这样运行 --debug 参数:

aws sts get-caller-identity --endpoint-url https://sts.eu-west-1.amazonaws.com  --debug

参考资料:

[1] https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/nslookup

[2] https://digwebinterface.com/

[3] <https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-troubleshooting

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则