Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ec2 image builder updateos document insufficient arguments to yum #6502

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

salemgolemugoo
Copy link

Description of changes

While building a custom AMI with pcluster utility for RHEL8 got this error in the EC2 Builder Log:

2024-10-28T16:12:25.489+01:00 Stdout: Freed space: 53 M
2024-10-28T16:12:25.554+01:00 Stdout: Is this ok [y/N]:
2024-10-28T16:12:25.554+01:00 CmdExecution: Command execution has been completed
2024-10-28T16:12:25.554+01:00 CmdExecution: [ ERROR ] Command execution has resulted in an error
2024-10-28T16:12:25.554+01:00 CmdExecution: Stderr: OS='rhel8' PLATFORM='RHEL' DISABLE_KERNEL_UPDATE='false' if [[ ${PLATFORM} == RHEL ]]; then yum -y update if [[ ${OS} == "rhel8" ]] || [[ ${OS} == "rocky8" ]] || [[ ${OS} == "rhel9" ]] || [[ ${OS} == "rocky9" ]] || [[ ${OS} == "alinux2023" ]] ; then # package-cleanup has changed in RHEL8 and it works differently https://access.redhat.com/solutions/1227 yum remove $(yum repoquery --installonly --latest-limit=-2 -q) else package-cleanup -y --oldkernels --count=1 fi elif [[ ${PLATFORM} == DEBIAN ]]; then DEBIAN_FRONTEND=noninteractive apt-get -y update if [[ ${DISABLE_KERNEL_UPDATE} == true ]]; then DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade else DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --with-new-pkgs upgrade fi apt-get --purge autoremove -y fi Operation aborted.
2024-10-28T16:12:25.554+01:00 CmdExecution: ExitCode 1
2024-10-28T16:12:25.555+01:00 ExecuteBash: FINISHED EXECUTION
2024-10-28T16:12:26.591+01:00 Executor: FINISHED EXECUTION OF ALL DOCUMENTS
2024-10-28T16:12:26.594+01:00 TOE has completed execution with failure - Execution failed!
2024-10-28T16:12:40.437+01:00 Waiting for command to complete (command id: e61c5a18-e926-4df6-8bf6-9f40a992a4b5). Attempt number: 34.
2024-10-28T16:12:40.746+01:00 Command failed (command id: e61c5a18-e926-4df6-8bf6-9f40a992a4b5, state: Failed)
2024-10-28T16:12:42.621+01:00 Action failed for step ApplyBuildComponents. Failing step
2024-10-28T16:12:43.085+01:00 Step ApplyBuildComponents failed

The issue is related to this command yum remove $(yum repoquery --installonly --latest-limit=-2 -q). It just waits for user input indefinitely.

Tests

Executed fixed script on the build instance. Checked the status echo $?

@salemgolemugoo salemgolemugoo requested review from a team as code owners October 28, 2024 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant