"ORA-28365: wallet is not open" - While Running "RMAN DUPLICATE"

The Problem

RMAN DUPLICATE fails with:

ORA-00283: recovery session canceled due to errors
ORA-28365: wallet is not open

The Solution

The wallet permissions were such that the user running RMAN could not access the wallet. In this example, the wallet was owned by oracle:oinstall.

-rw------- 1 oracle oinstall 3632 Jan 13 12:28 ewallet.p12
-rw------- 1 oracle oinstall 3709 Jan 14 09:03 cwallet.sso

However, a user in a different group (dba) was running RMAN. On another system where the problem did not present, not only was the file ownership different, but the permissions were already set to allow users in other groups to read the wallet:

-rw-r--r-- 1 oracle dba 1573 Mar 28 14:45 ewallet.p12
-rw------- 1 oracle dba 1651 Mar 28 14:48 cwallet.sso

Change the permissions on the wallet files so users other than oracle:oinstall can access these:

$ chmod go+r ewallet.p12
$ chmod go+r cwallet.sso

Then retry the RMAN activity which is failing during recovery with “ORA-28365: wallet is not open”. If the issue persists, check the permissions on the wallet directory as well.