Build 'amazon-ebs' errored after 3 minutes 14 seconds: Script exited with non-zero exit status: 35.Allowed exit codes are: [0]
Closed this issue · 3 comments
What happened:
I tried to create a custom EKS optimize ami based on Ubuntu in AWS China region: cn-north-1, the "make build" command run more than 40 minutes then failed with below error:
Build 'amazon-ebs' errored after 40 minutes 39 seconds: Script exited with non-zero exit status: 35.Allowed exit codes are: [0]
What you expected to happen:
Build a custom EKS optimize ami based on Ubuntu in AWS China region
How to reproduce it (as minimally and precisely as possible):
I updated the file "amazon-eks-node-ubuntu1804.json":
change the value of "source_ami_owner" to "837727238323"
Then I use below command to build: (VPC_ID and SUBNET_ID are the id info of my aws account)
make build PACKER_FILE=amazon-eks-node-ubuntu1804.json eks_version=1.18.9 eks_build_date=2020-11-02 AWS_REGION=cn-north-1 VPC_ID=vpc-xxxxxxx SUBNET_ID=subnet-xxxxxxx
Anything else we need to know?:
Environment:
- OS: ubuntu
- OS Version: ubuntu1804
- EKS Version: 1.18.9
- Packer Version: Packer v1.7.0
Try to build again, this time the build failed at 3 min 14 second:
...
amazon-ebs: 0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
amazon-ebs: Need to get 411 kB of archives.
amazon-ebs: After this operation, 1370 kB of additional disk space will be used.
amazon-ebs: Get:1 http://cn-north-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libauparse0 amd64 1:2.8.2-1ubuntu1.1 [48.8 kB]
amazon-ebs: Get:2 http://cn-north-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 unzip amd64 6.0-21ubuntu1.1 [168 kB]
amazon-ebs: Get:3 http://cn-north-1.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 auditd amd64 1:2.8.2-1ubuntu1.1 [194 kB]
amazon-ebs: Fetched 411 kB in 2s (269 kB/s)
amazon-ebs: Selecting previously unselected package libauparse0:amd64.
amazon-ebs: (Reading database ... 57093 files and directories currently installed.)
amazon-ebs: Preparing to unpack .../libauparse0_1%3a2.8.2-1ubuntu1.1_amd64.deb ...
amazon-ebs: Unpacking libauparse0:amd64 (1:2.8.2-1ubuntu1.1) ...
amazon-ebs: Selecting previously unselected package unzip.
amazon-ebs: Preparing to unpack .../unzip_6.0-21ubuntu1.1_amd64.deb ...
amazon-ebs: Unpacking unzip (6.0-21ubuntu1.1) ...
amazon-ebs: Selecting previously unselected package auditd.
amazon-ebs: Preparing to unpack .../auditd_1%3a2.8.2-1ubuntu1.1_amd64.deb ...
amazon-ebs: Unpacking auditd (1:2.8.2-1ubuntu1.1) ...
amazon-ebs: Setting up libauparse0:amd64 (1:2.8.2-1ubuntu1.1) ...
amazon-ebs: Setting up unzip (6.0-21ubuntu1.1) ...
amazon-ebs: Setting up auditd (1:2.8.2-1ubuntu1.1) ...
amazon-ebs: Created symlink /etc/systemd/system/multi-user.target.wants/auditd.service → /lib/systemd/system/auditd.service.
amazon-ebs: Processing triggers for systemd (237-3ubuntu10.44) ...
amazon-ebs: Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
amazon-ebs: Processing triggers for mime-support (3.60ubuntu1) ...
amazon-ebs: Processing triggers for ureadahead (0.100.0-21) ...
amazon-ebs: Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
amazon-ebs: + install_jq
amazon-ebs: + curl -sL -o /usr/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
==> amazon-ebs: Provisioning step had errors: Running the cleanup provisioner, if present...
==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: Cleaning up any extra volumes...
==> amazon-ebs: No volumes to clean up, skipping
==> amazon-ebs: Deleting temporary security group...
==> amazon-ebs: Deleting temporary keypair...
Build 'amazon-ebs' errored after 3 minutes 14 seconds: Script exited with non-zero exit status: 35.Allowed exit codes are: [0]
==> Wait completed after 3 minutes 14 seconds
==> Some builds didn't complete successfully and had errors:
--> amazon-ebs: Script exited with non-zero exit status: 35.Allowed exit codes are: [0]
==> Builds finished but no artifacts were created.
make: *** [build] Error 1
Well, because of GFW, you have to customize a few items for AWS China:
The 2 are required so you can download binaries from CN region.
binary_bucket_name=amazon-eks
binary_bucket_region=cn-north-1
For others, you might have to customize the script a bit, e.g.
- Use a CN docker engine mirror to install docker-ce
- Customize
eks.sh
to download cni plugin from local s3 or somewhere - Customize
functions.sh
to install or download packages by apt or local mirror.
Hope it helps.