ORA-65342: source pluggable database has unrecovered transaction

Get this error when cloning a PDB

SQL > CREATE PLUGGABLE DATABASE demo2 FROM demo1;
CREATE PLUGGABLE DATABASE demo2 FROM demo1
*
ERROR at line 1:
ORA-65342: source pluggable database DEMO1 has unrecovered transaction

Find the transaction id

SQL> alter session set container = demo1;
SQL > select local_tran_id, global_tran_id, state from DBA_2PC_PENDING;

LOCAL_TRAN_ID          GLOBAL_TRAN_ID                           STATE
---------------------- ---------------------------------------- -----------
11.16.863152           48801.1A7A385C12868ACD2902               prepared

Commit the transaction

SQL > commit force '11.16.863152';

Commit complete.

After all pending transactions get committed, you should be able to clone PDB.