aws / aws/ec2-image-builder-roadmap
Component Execution fails when multiple processes try to install packages concurrently
- Dominant language
- No language data
- Stars
- 35
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
I'm trying to install and execute several ansible playbooks to my AMI using EC2ImageBuilder.
`
2022-08-02T16:26:59.428+05:30CopyStep Download | Step Download
-- | --
| 2022-08-02T16:26:59.432+05:30CopyExecuteBash: STARTED EXECUTION | ExecuteBash: STARTED EXECUTION
| 2022-08-02T16:26:59.434+05:30CopyStdout: Downloading 'https://s3.us-east-1.amazonaws.com/amazoncloudwatch-agent-us-east-1/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb' to '/tmp/amazon-cloudwatch-agent.deb' | Stdout: Downloading 'https://s3.us-east-1.amazonaws.com/amazoncloudwatch-agent-us-east-1/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb' to '/tmp/amazon-cloudwatch-agent.deb'
| 2022-08-02T16:27:00.095+05:30CopyCmdExecution: Command execution has been completed | CmdExecution: Command execution has been completed
| 2022-08-02T16:27:00.095+05:30CopyCmdExecution: Command execution was completed successfully | CmdExecution: Command execution was completed successfully
| 2022-08-02T16:27:00.095+05:30CopyCmdExecution: Stderr: | CmdExecution: Stderr:
| 2022-08-02T16:27:00.095+05:30CopyCmdExecution: ExitCode 0 | CmdExecution: ExitCode 0
| 2022-08-02T16:27:00.095+05:30CopyExecuteBash: FINISHED EXECUTION | ExecuteBash: FINISHED EXECUTION
| 2022-08-02T16:27:00.100+05:30CopyStep Install | Step Install
| 2022-08-02T16:27:00.101+05:30CopyExecuteBash: STARTED EXECUTION | ExecuteBash: STARTED EXECUTION
| 2022-08-02T16:27:00.192+05:30CopyCmdExecution: Command execution has been completed | CmdExecution: Command execution has been completed
| 2022-08-02T16:27:00.192+05:30CopyCmdExecution: [ ERROR ] Command execution has resulted in an error | CmdExecution: [ ERROR ] Command execution has resulted in an error
| 2022-08-02T16:27:00.192+05:30CopyCmdExecution: Stderr: dpkg: error: dpkg frontend lock is locked by another process | CmdExecution: Stderr: dpkg: error: dpkg frontend lock is locked by another process
| 2022-08-02T16:27:00.192+05:30CopyCmdExecution: ExitCode 2 | CmdExecution: ExitCode 2
`
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
I believe the Download Cloudwatch agent step concurrently executed with the S3 Download phase (which is a very rare event)
And this led to the dpkg frontend lock as the download process acquires a sudo/lock till it is completed
These steps should execute in isolation so as to eliminate the occurrence of such execution errors.
As the control is with TOE, implementing such process/component/task level isolation is bit difficult.
**Are you currently working around this issue?**
No, the issue is very rare. Re-executing/Rebuilding the pipeline would probably solve this issue
**Additional context**
Anything else we should know?
**Attachments**
If you think you might have additional information that you'd like to include via an attachment, please do - we'll take a look. (Remember to remove any personally-identifiable information.)
Contributor guide
Research direction
The report names EC2 Image Builder TOE execution, the Download and Install steps, S3 downloads, and the Ubuntu dpkg frontend lock, but no repository files or tests. Start by understanding how these steps can run concurrently and how dpkg locking is triggered; done means concurrent package installations no longer fail with the reported lock error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ansible, aws, ubuntu
- Domain
- cloud, devops, infrastructure
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100