EC2 instance stuck in stopping state

AWS EC2 Stuck in 'Stopping' State: 3 Fixes That Work

EC2 stuck in 'stopping' for hours? Force-stop is the direct fix, but if that fails, you may need to detach volumes or raise a support ticket. Here's the playbook.

Quick answer

Try Force Stop from the EC2 console — it's the fastest fix for a stuck 'stopping' state.

Why your instance is stuck in 'stopping'

EC2 instances get stuck in 'stopping' when the underlying hypervisor can't gracefully shut down the guest OS. This usually happens because a process inside the instance is ignoring shutdown signals, or because a bug in the AWS virtualization layer is blocking the stop request. It's rare, but when it happens, it's infuriating — your instance hangs for hours, and you can't start it, stop it, or even terminate it cleanly.

The most common trigger I've seen in production: an instance running a heavy database workload (like MySQL or PostgreSQL) with a massive buffer pool that takes forever to flush on shutdown. AWS gives the guest OS about 2-3 minutes before it kills the instance, but if the OS itself hangs, the stop request just sits there. I've also seen this after a kernel panic or when the instance's systemd is stuck on a failed mount.

Fix 1: Force Stop (the 90% solution)

  1. Open the EC2 console and go to Instances.
  2. Select your stuck instance.
  3. Click Instance stateStop instance.
  4. Check the box that says Force stop (you might need to click a dropdown to see it).
  5. Confirm the action.

Forcing the stop is like yanking the power cord — it doesn't give the OS a chance to shut down gracefully. This overrides the stuck state and should transition your instance to 'stopped' within a minute. If it doesn't, move on to Fix 2.

Fix 2: Stop via AWS CLI (bypasses the console)

The console sometimes just won't refresh the state properly. The CLI gives you a cleaner view and lets you force-stop directly.

aws ec2 stop-instances --instance-ids i-1234567890abcdef0 --force

If that returns an error about the instance being in 'stopping' already, try this instead:

aws ec2 stop-instances --instance-ids i-1234567890abcdef0 --force --no-dry-run

If the CLI hangs or times out, you might need to specify a different endpoint or check your IAM permissions. But if the CLI returns a success response and the console still shows 'stopping', give it 10 minutes — the state change can lag.

Fix 3: Detach volumes and terminate (nuclear option)

If force-stop does nothing and the CLI won't budge, you can detach the EBS volumes from the stuck instance and then terminate it. This is destructive — you'll lose the instance, but you can reattach the volumes to a new instance to recover your data.

  1. Go to Volumes in the EC2 console.
  2. Find the volumes attached to your stuck instance (look at the 'Attachment info' column).
  3. Select a volume and click ActionsDetach volume.
  4. Click Force detach if prompted.
  5. Repeat for all volumes.
  6. Go back to Instances, select your stuck instance, and click Terminate instance.

Without the volumes, the instance has nothing to write to, so the stop request should complete. Once terminated, you can create a new instance and attach the detached volumes as secondary disks to get your data back.

If all else fails: AWS support is your friend

Sometimes the underlying host is just broken. AWS support can force-stop an instance from their side — something you can't do from the console. Open a support ticket, include your instance ID and the exact time it got stuck, and mention that you've already tried force-stop and CLI. They usually respond within a few hours, but for production issues, you can bump up the severity to 'business-critical' if you have that support plan.

Prevention tip: don't let this happen again

Most 'stopping' hangs are caused by the guest OS refusing to shut down. Set up a proper shutdown script that forces critical processes to exit cleanly. On Linux, add a script to /etc/systemd/system/ that waits for your database to flush, but with a timeout. Something like:

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStop=/bin/sh -c 'timeout 60 mysqladmin shutdown || pkill -9 mysqld'
TimeoutStopSec=90

Also, enable termination protection and set up CloudWatch alarms on instance status checks. That way, if an instance hangs, you get alerted early instead of discovering it hours later.

The bottom line: force-stop first, CLI second, detach volumes third. And if you're on a tight budget, remember that a stuck 'stopping' instance still bills you until it's actually stopped — so don't wait too long to deal with it.

Related Errors in Server & Cloud
VSS_E_WRITER_ERROR Fix a Corrupted VM Snapshot — What Actually Works HTTP 503 HTTP 503 Service Unavailable: Fixes for IIS and Nginx Why Your Site Is Slow on Mobile (and How to Fix It) 0X00000420 Service already running? Here's the real fix for 0X00000420

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.