-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Packer Build Fails During Package Updates on EC2 (Successful on Local Machine) #13141
Comments
Hi @nuwan96, This might be a tricky one if intermittent, and we've already had reports of package managers terminating before they're completely done for some reason, and so far we've not been able to determine what was the cause of this behaviour. Chances are In order to help us understand the problem, would you be able to share a (ideally minimal) template that we can run tests with? If there are any, please include the scripts used for building the image. Thanks! |
Note: not transferring to the AWS plugin for now as it could be linked to SSH instead, so depending on the cause will transfer later as appropriate. |
I'm seeing a similar issue using the aws provisioner. I have several CI runner is on the Alma Linux 9 image and running packer version Here's the output from See below:
Again, I don't see this behavior when building from a local host, but it's consistently cutting off at this same point in the docker runner. Worth noting that the shell provisioner uses these settings, as do the other working shell provisioners that successfully run dnf commands afterwards:
|
Figured out a dumb workaround, for what it's worth: I'm simply rerunning the same script afterwards, and it seems to work. (it has no effect if it works the first time) |
I'm facing an issue where my Packer build process on an EC2 instance fails intermittently during specific dnf package update steps. This occurs even before all defined packages are updated. The issue does not occur when running Packer on my local machine.
Setup:
Packer Instance: An EC2 instance is used to run the Packer build process. This instance can be replaced with my local machine, where the build works without issues.
Build Instance: A separate EC2 instance is spun up to run the actual Packer image creation process. The dnf updates occur on this instance.
>
Important Note: The build process works successfully when executed on my local machine (Linux or Windows or MAC). The issue only arises when running packer Build command on an EC2 instance.
Problem:
The Packer build process on EC2 appears to skip ahead to the next step in my provisioner script without completing all the dnf package updates. This behavior is inconsistent and happens before all the specified packages in my script are installed or updated.
Error Messages:
Expected Behavior:
I expect Packer to complete all dnf package updates specified in my provisioner script before moving on to subsequent steps. The build should not skip ahead prematurely.
Additional Information:
Packer Version: 1.9.0
OS/AMI: Alama Linuz 9 , Amazon Linux
Additional Notes:
This issue seems similar to a previously reported problem (
#3920). However, the proposed solutions in that issue haven't fully resolved the problem in my case.
The text was updated successfully, but these errors were encountered: