Skip to content

Debugging a PaaS environment stuck in Starting / Migrating / Updating

An environment that shows a spinner for forty minutes is not progressing slowly — it is wedged on a hook, a lock, or a backend constraint. Here's how to triage and recover without losing state.

You hit Restart on a node group expecting a 90-second roll. Forty minutes later the environment shows “Starting” with a spinner. The application doesn’t respond, no buttons in the panel are clickable, the events tab shows the restart event still in-progress, and the support article says “wait a few minutes.” It has not been a few minutes. The environment is stuck.

What’s happening

A PaaS environment in Starting, Migrating, Updating, Cloning, or similar transitional state is in a state machine waiting for a worker to report a completed step. The worker is one of: the platform’s orchestrator running a pre/post hook, the container runtime pulling an image, the storage layer attaching or copying a volume, or — most commonly — a script defined in the JPS manifest of an installed add-on that is hanging on a network call, a missing file, or a prompt that never gets answered.

What this looks like by symptom:

  • Stuck on Starting after a node restart: a container init script is blocked. Usually a service start command that’s waiting on a peer (DB waiting for clustering quorum, app waiting for a config file from a sidecar).
  • Stuck on Updating after a topology change: the platform attempted to scale or change cloudlets and one node failed to migrate. The orchestrator is waiting for a state report that won’t come.
  • Stuck on Migrating after a hardware move: a storage volume is being copied to a new physical host and the copy is throttled or stalled. Real migrations of large volumes can legitimately take time, but the status should be progressing — not flatlined.
  • Stuck on Cloning: a clone-time hook in an add-on’s JPS is failing and being retried.
  • Stuck on Installing: a marketplace install hook is hanging, often on curl or wget to an external repository that’s rate-limiting or unreachable.

The platform sometimes surfaces these as “Operation timed out” eventually (15-60 minutes depending on the operation). Sometimes it doesn’t surface anything and the spinner stays indefinitely.

How to verify

The first move is to read the actual events log, not the panel summary:

# Recent events on the environment
jelastic-cli environment Tracking GetEnvActions \
  --envName acme-prod \
  --starttime "$(date -u -d '2 hours ago' +%Y-%m-%dT%H:%M:%S)" \
  --endtime "$(date -u +%Y-%m-%dT%H:%M:%S)"

# Detail on the currently-running action
jelastic-cli environment Tracking GetCurrentActions \
  --envName acme-prod

The GetCurrentActions output names the worker, the action type, and the step number. That’s your first clue.

Now look at what the container is actually doing — if you can still get a shell on it:

# Try exec; this often still works even when the env shows transitional state
NODE_ID=$(jelastic-cli environment Control GetEnvInfo --envName acme-prod \
  | jq -r '.nodes[]|select(.nodeGroup=="cp")|.id' | head -1)

jelastic-cli environment Control ExecCmdById \
  --envName acme-prod --nodeId "${NODE_ID}" \
  --commandList '[{"command":"ps auxf | head -40 && echo --- && tail -100 /var/log/run.log 2>/dev/null && echo --- && tail -100 /var/log/jelastic/run.log 2>/dev/null"}]'

If you see a hung curl, a mysqldump against a remote host, or a wait on a port that’s not listening, you’ve found the wedge. If exec itself times out, the container is genuinely unreachable and you need platform-side intervention.

Check whether the wedge is on a lock the platform holds:

# Check whether the environment has an active lock
jelastic-cli environment Control GetEnvInfo --envName acme-prod \
  | jq '{status, locked:.isLocked, lockHolder:.lockHolder}'

A locked: true with a lockHolder referring to an action ID tells you the platform-level lock is what’s blocking everything else.

For a node migrating between hardware hosts, get the migration progress directly:

jelastic-cli environment Tracking GetMigrationProgress \
  --envName acme-prod

If bytesTransferred is increasing, the migration is just slow — let it finish. If it’s stalled and the elapsed time is approaching the operation’s timeout (commonly 60 min), prepare for the recovery path.

The fix

The recovery path depends on which kind of wedge it is. Three patterns cover most of them:

Pattern 1 — hung script inside a container

Identify the PID and kill it, then let the orchestrator re-run or timeout:

jelastic-cli environment Control ExecCmdById \
  --envName acme-prod --nodeId "${NODE_ID}" \
  --commandList '[{"command":"pkill -f \"curl https://stale-repo\" || true; pkill -f \"wait-for-it\" || true"}]'

# Then nudge the orchestrator
jelastic-cli environment Tracking RetryCurrentAction \
  --envName acme-prod

If RetryCurrentAction isn’t exposed by your hoster, the alternative is to wait for the operation’s timeout (the orchestrator will eventually move on, usually to a failed state), then restart the affected node group:

jelastic-cli environment Control RestartNodes \
  --envName acme-prod --nodeGroup cp

Pattern 2 — platform-level lock held by a dead action

This one usually requires the hoster’s intervention. Open a ticket through your hoster’s support desk with the output of GetEnvActions and GetCurrentActions so they can clear the stale lock from the platform side. While you wait, do not mash buttons in the panel — queueing additional actions on a locked env makes the recovery harder.

Pattern 3 — stuck migration of a large volume

If bytesTransferred is genuinely progressing and the volume is large, the right move is to wait. If it’s been flat for 15 minutes, abort the migration through the API:

jelastic-cli environment Tracking CancelMigration \
  --envName acme-prod

After the cancel succeeds the env returns to its previous status. Plan the migration again with a smaller window or at a quieter time.

A general-purpose triage script worth keeping in your runbook directory:

#!/usr/bin/env bash
set -euo pipefail

ENV="${1:?usage: $0 <envName>}"

echo "==> Env status"
jelastic-cli environment Control GetEnvInfo --envName "${ENV}" \
  | jq '{status, hardwareNodeGroup, isLocked, lockHolder}'

echo "==> Current action"
jelastic-cli environment Tracking GetCurrentActions --envName "${ENV}" | jq .

echo "==> Last 2h of events"
jelastic-cli environment Tracking GetEnvActions \
  --envName "${ENV}" \
  --starttime "$(date -u -d '2 hours ago' +%Y-%m-%dT%H:%M:%S)" \
  --endtime "$(date -u +%Y-%m-%dT%H:%M:%S)" \
  | jq '.array[]|{date, action:.action, result:.result, duration}'

echo "==> Per-node listener health"
for nid in $(jelastic-cli environment Control GetEnvInfo --envName "${ENV}" \
  | jq -r '.nodes[].id'); do
  echo "--- node ${nid} ---"
  jelastic-cli environment Control ExecCmdById \
    --envName "${ENV}" --nodeId "${nid}" \
    --commandList '[{"command":"ss -lntp 2>/dev/null | head -15"}]' 2>&1 | head -20
done

echo "==> Migration progress (if applicable)"
jelastic-cli environment Tracking GetMigrationProgress --envName "${ENV}" 2>&1 | head -10

After recovery, the post-mortem question is: what triggered the wedge, and is it a known platform issue or a regression in our own JPS / init scripts? Keep a short log of stuck-state incidents — three of the same wedge pattern in a quarter is a problem with your own bootstrap, not the platform.

Stack Harbor’s support desk takes stuck-environment tickets on managed Cloud PaaS and runs the triage above plus the hoster-side ticket if a platform lock has to be cleared, as part of monitoring and support. For an environment that gets wedged on a recurring basis, book a stabilization review.