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

Amazon SSM agent is using all of my i-nodes #94

Closed
andrewme2 opened this issue Apr 3, 2018 · 8 comments
Closed

Amazon SSM agent is using all of my i-nodes #94

andrewme2 opened this issue Apr 3, 2018 · 8 comments

Comments

@andrewme2
Copy link

The SSM agent (v2.2.93 and v2.2.120) does not seem to be cleaning up files in the orchestration directory. The issue is reproducible on many EC2 instances that I have.

I have several EC2 instances where i-node usage is 90%+ and one where it is 100%. Once 100% is reached, the system effectively locks up and the ssm log files show many "no space left on device" errors.

I tracked the issue down to the SSM agent not cleaning up files in this directory:

 /var/lib/amazon/ssm/<instance-ID>/document/orchestration

For example, one of my EC2 instances has files in the orchestration directory going back to Dec. 5.

A similar issue was fixed in 2.2.24.0:

 https://github.com/aws/amazon-ssm-agent/issues/72
@wael-amz
Copy link
Contributor

wael-amz commented Apr 3, 2018

We are investigating the issue.

@vjt
Copy link

vjt commented Apr 18, 2018

Hi @andrewme2,

I am also experiencing this issue. As a workaround, I am using this cron job in root's crontab:

0 0 * * * find /var/lib/amazon/ssm/i-*/document/orchestration -mindepth 2 -maxdepth 2 -type d -mtime +3 -print0 | xargs -0 rm -rf

This will be executed every day at midnight and delete all orchestration documents older than 3 days.

@andrewme2
Copy link
Author

Thanks @vjt ! That's a good workaround until this bug is fixed.

@kapilt
Copy link

kapilt commented May 24, 2018

has this been resolved in a release?

@ldm810
Copy link

ldm810 commented Jun 11, 2018

@wael-amz Is there a workaround or updates on this issue?

@wael-amz
Copy link
Contributor

The issue has been addressed in the latest release 2.2.800.0

@andrewme2
Copy link
Author

Hi @wael-amz , I'm trying to verify that this bug is fixed. I upgraded to 2.2.800.0. How long do I need to wait before the SSM agent will clean up old files? I do not know how often the agent runs its clean-up routine (every hour, once-per-day, etc?). After running for ~2 hours, I still have directories in the orchestration directory from May:

root@ip-X-X-X-X:~# ls -ltr /var/lib/amazon/ssm//document/orchestration | head
total 774160
drwx------ 3 root root 4096 May 1 17:59 9b1a8ca8-REDACTED
drw------- 3 root root 4096 May 1 17:59 8c7ca5d1-REDACTED
drw------- 3 root root 4096 May 1 18:02 a7a2756a-REDACTED
drwx------ 3 root root 4096 May 1 18:03 6dd8855e-REDACTED
drwx------ 3 root root 4096 May 1 18:07 28445cc3-REDACTED
drwx------ 3 root root 4096 May 1 18:07 dca845eb-REDACTED
drw------- 3 root root 4096 May 1 18:10 e2bd2589-REDACTED
drwx------ 3 root root 4096 May 1 18:10 a4e4b5e3-REDACTED
drw------- 3 root root 4096 May 1 18:11 cd02fb83-REDACTED

@wael-amz
Copy link
Contributor

The cleanup logic will be triggered every time you run a command and it is not time based.

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

No branches or pull requests

5 participants