Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 封隔器构建挂起到最后一个命令_Amazon Web Services_Amazon Ec2_Amazon Ami_Packer - Fatal编程技术网

Amazon web services 封隔器构建挂起到最后一个命令

Amazon web services 封隔器构建挂起到最后一个命令,amazon-web-services,amazon-ec2,amazon-ami,packer,Amazon Web Services,Amazon Ec2,Amazon Ami,Packer,我的打包机版本似乎成功地运行了所有命令,但一直挂在最后一个命令上。这是调试模式下打包器输出的结束。我不知道如何度过这一关。似乎在删除临时脚本时遇到了问题 ==> amazon-ebs: + systemctl stop httpd amazon-ebs: apache-tomcat-8.5.53/bin/version.sh ==> amazon-ebs: + systemctl start tomcat ==> amazon-ebs: + systemctl enab

我的打包机版本似乎成功地运行了所有命令,但一直挂在最后一个命令上。这是调试模式下打包器输出的结束。我不知道如何度过这一关。似乎在删除临时脚本时遇到了问题

==> amazon-ebs: + systemctl stop httpd
    amazon-ebs: apache-tomcat-8.5.53/bin/version.sh
==> amazon-ebs: + systemctl start tomcat
==> amazon-ebs: + systemctl enable tomcat
==> amazon-ebs: Created symlink from /etc/systemd/system/multi-user.target.wants/tomcat.service to /etc/systemd/system/tomcat.service.
==> amazon-ebs: + firewall-offline-cmd --add-port=8080/tcp
    amazon-ebs: success
==> amazon-ebs: + systemctl unmask --now firewalld
==> amazon-ebs: Removed symlink /etc/systemd/system/firewalld.service.
==> amazon-ebs: + systemctl enable firewalld
==> amazon-ebs: Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
==> amazon-ebs: Created symlink from /etc/systemd/system/multi-user.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
==> amazon-ebs: + systemctl start firewalld
==> amazon-ebs: + echo 'boostrap finished'
    amazon-ebs: boostrap finished
==> amazon-ebs: + sleep 30
2020/04/01 20:55:22 packer-builder-amazon-ebs plugin: [INFO] RPC endpoint: Communicator ended with: 0
2020/04/01 20:55:22 [INFO] 69661 bytes written for 'stdout'
2020/04/01 20:55:22 [INFO] 276662 bytes written for 'stderr'
2020/04/01 20:55:22 [INFO] RPC client: Communicator ended with: 0
2020/04/01 20:55:22 [INFO] RPC endpoint: Communicator ended with: 0
2020/04/01 20:55:22 packer-provisioner-shell plugin: [INFO] 69661 bytes written for 'stdout'
2020/04/01 20:55:22 packer-provisioner-shell plugin: [INFO] 276662 bytes written for 'stderr'
2020/04/01 20:55:22 packer-provisioner-shell plugin: [INFO] RPC client: Communicator ended with: 0
2020/04/01 20:55:22 packer-builder-amazon-ebs plugin: [DEBUG] Opening new ssh session
2020/04/01 20:55:22 packer-builder-amazon-ebs plugin: [DEBUG] starting remote command: rm -f /tmp/script_3825.sh
2020/04/01 20:55:22 packer-builder-amazon-ebs plugin: [ERROR] Remote command exited with '1': rm -f /tmp/script_3825.sh
2020/04/01 20:55:22 packer-builder-amazon-ebs plugin: [INFO] RPC endpoint: Communicator ended with: 1
我正在使用以下供应器:

  {
    "type": "shell",
    "script": "bootstrap/bootstrap.sh",
    "execute_command": "echo 'packer' | sudo -S env {{ .Vars }} {{ .Path }}"
  }
最后一个错误是:

2020/04/01 21:00:54 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2020/04/01 21:00:54 machine readable: amazon-ebs,error []string{"Error removing temporary script at /tmp/script_3825.sh!"}
==> Builds finished but no artifacts were created.
2020/04/01 21:00:54 [INFO] (telemetry) Finalizing.
Build 'amazon-ebs' errored: Error removing temporary script at /tmp/script_3825.sh!

您的引导脚本似乎阻止了新的ssh连接,因此packer无法清理它上载的临时脚本

如果这是您可以跳过清理的意图