-
Notifications
You must be signed in to change notification settings - Fork 457
Packer build failed due to permission error #230
Description
Hi,
I am trying to implement the vault cluster using the repo.
As first step, I tried to create AMIs using packer, however I kept getting "permission error" in running vault-install script.
I tried many things only to fail. So, as a last resort, I leave a message.
Can somebody help me with this issue?
Please refer to the log snippets below:
Thank you for your help in advance.
########
2021/01/13 13:51:26 packer.exe plugin: [DEBUG] starting remote command: chmod 0755 /tmp/script_7151.sh
2021/01/13 13:51:26 packer.exe plugin: [INFO] RPC endpoint: Communicator ended with: 0
2021/01/13 13:51:26 [INFO] RPC client: Communicator ended with: 0
2021/01/13 13:51:26 [INFO] RPC endpoint: Communicator ended with: 0
2021/01/13 13:51:26 packer.exe plugin: [INFO] RPC client: Communicator ended with: 0
2021/01/13 13:51:26 packer.exe plugin: [DEBUG] Opening new ssh session
2021/01/13 13:51:26 packer.exe plugin: [DEBUG] starting remote command: sudo -S env PACKER_BUILDER_TYPE='amazon-ebs' PACKER_BUILD_NAME='amazon-linux-2-ami' /tmp/script_7151.sh
2021/01/13 13:51:26 packer.exe plugin: [ERROR] Remote command exited with '1': sudo -S env PACKER_BUILDER_TYPE='amazon-ebs' PACKER_BUILD_NAME='amazon-linux-2-ami' /tmp/script_7151.sh
2021/01/13 13:51:26 packer.exe plugin: [INFO] RPC endpoint: Communicator ended with: 1
2021/01/13 13:51:26 [INFO] 109 bytes written for 'stderr'
2021/01/13 13:51:26 [INFO] 0 bytes written for 'stdout'
2021/01/13 13:51:26 [INFO] RPC client: Communicator ended with: 1
2021/01/13 13:51:26 [INFO] RPC endpoint: Communicator ended with: 1
2021/01/13 13:51:26 ui error: ==> amazon-linux-2-ami: /tmp/script_7151.sh: line 2: /tmp/terraform-aws-vault/modules/install-vault/install-vault: Permission denied
2021/01/13 13:51:26 packer.exe plugin: [INFO] 0 bytes written for 'stdout'
2021/01/13 13:51:26 packer.exe plugin: [INFO] 109 bytes written for 'stderr'
2021/01/13 13:51:26 packer.exe plugin: [INFO] RPC client: Communicator ended with: 1
2021/01/13 13:51:26 [INFO] (telemetry) ending shell
2021/01/13 13:51:26 ui: ==> amazon-linux-2-ami: Provisioning step had errors: Running the cleanup provisioner, if present...
2021/01/13 13:51:26 ui: ==> amazon-linux-2-ami: Terminating the source AWS instance...
2021/01/13 13:52:12 ui: ==> amazon-linux-2-ami: Cleaning up any extra volumes...
2021/01/13 13:52:12 ui: ==> amazon-linux-2-ami: No volumes to clean up, skipping
2021/01/13 13:52:12 ui: ==> amazon-linux-2-ami: Deleting temporary security group...
2021/01/13 13:52:12 ui: ==> amazon-linux-2-ami: Deleting temporary keypair...
2021/01/13 13:52:13 [INFO] (telemetry) ending amazon-ebs
2021/01/13 13:52:13 ui error: Build 'amazon-linux-2-ami' errored after 2 minutes 10 seconds: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
2021/01/13 13:52:13 ui:
==> Wait completed after 2 minutes 10 seconds
2021/01/13 13:52:13 machine readable: error-count []string{"1"}
2021/01/13 13:52:13 ui error:
==> Some builds didn't complete successfully and had errors:
2021/01/13 13:52:13 machine readable: amazon-linux-2-ami,error []string{"Script exited with non-zero exit status: 1.Allowed exit codes are: [0]"}
2021/01/13 13:52:13 ui error: --> amazon-linux-2-ami: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
2021/01/13 13:52:13 ui:
==> Builds finished but no artifacts were created.
##############