aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap
[CFN HUP] - [BUG] - Environment Variables Exceeding Maximum Allowed Size for OS
- Dominant language
- No language data
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
### Name of the resource
Other
### Resource Name
CFN Hup
### Issue Description
While using CFN Hup, two environment variables are populated, `CFN_OLD_METADATA` and `CFN_NEW_METADATA`, which are expected to contain the entire path storing the metadata. However, an OS has a max allowed environment variable size.
If the value of the environment variable exceeds the limits of the OS, the command would fail.
### Expected Behavior
CFN Hup should automatically trim the environment variable to avoid OS related errors, or workaround this issue in a way to support CFN Hup functionality while respecting the OS limitations.
### Observed Behavior
CFN Hup currently does not automatically trim the environment variables, in which an error is observed:
```
OSError: [Errno 7] Argument list too long: 'su'
```
### Test Cases
NA
### Other Details
So far, this issue is only observed from the way cfn-hup invokes cfn-init after a stack update, implying this issue is within cfn-hup.
**To workaround this, a user encountering this issue would need to avoid cfn hup by directly calling cfn-init which would not have the environment variables set. This workaround is not ideal due to missing the functionalities provided by CFN Hup.**
Contributor guide
Research direction
Start by tracing how cfn-hup invokes cfn-init and passes CFN_OLD_METADATA and CFN_NEW_METADATA. Reproduce the oversized environment failure across the affected OS limits, then define a solution that preserves CFN Hup functionality without producing the OSError: [Errno 7] failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100