Scan or migration commands remain in IN_PROGRESS state

When a scan or migration command remains in the IN_PROGRESS state and a cancellation request fails to update the state, update the command rows directly in the embedded H2 database on the Master host.

Symptom: A scan or migration command remains in IN_PROGRESS indefinitely. Cancelling through the UI or API returns a success message but the state does not change.

Cause: A known issue prevents the cancel operation from persisting the state change to the database.

For database locations and moving to an external database, see CMA database backends.

  1. Plan which commands to reset.
  2. On an embedded H2 parcel deployment, SSH to the Master host and run the update.
    ssh root@<master-host>
    
    # On the Master host:
    H2_JAR=$(ls /opt/cloudera/parcels/cma/lib/h2-*.jar)
    DB_URL="jdbc:h2:/var/lib/cma/data/db/cma-server;IFEXISTS=TRUE;AUTO_SERVER=TRUE"
    java -cp $H2_JAR org.h2.tools.Shell -url "$DB_URL" -user admin -password s3cret \
      -sql "UPDATE CLUSTER_COMMAND_EXECUTION SET STATE = 'FAILED' WHERE STATE = 'IN_PROGRESS';"
    

    To update only specific commands, use WHERE ID IN (9, 10, 11) instead of the WHERE STATE = 'IN_PROGRESS' clause.