CPF22E2: Password not correct for user profile
CPF22E2 means a program or server checked a user ID and password through IBM i's security APIs, such as QSYGETPH, and the password didn't match. On IBM i 7.5 the APIs also return it when the user ID doesn't exist.
Other names for this code
Also written as MSGCPF22E2, CPF22E2 password not correct, password not correct for user profile API, QSYGETPH CPF22E2, iSeries CPF22E2, IBM i CPF22E2.
What it means
CPF1107 is what a person sees on the sign-on display. CPF22E2 is the matching message from the programming side. The Get Profile Handle API (QSYGETPH) and related security APIs verify a user ID and password before a program or server job switches to that user. When the password is wrong, the API ends with CPF22E2.
Each failure raises the profile's count of password attempts that weren't valid, just like a failed sign-on. When the count reaches QMAXSIGN, the system acts on QMAXSGNACN and may disable the profile. A successful check resets the count to zero.
On IBM i 7.5 IBM made the APIs return CPF22E2 for an unknown user ID as well, when both a user ID and password are supplied. Earlier releases returned CPF2204 or CPF9801 for a missing profile. So on current systems CPF22E2 means "this user ID and password don't work together", not always "wrong password".
Common causes
- A user typed the wrong password into a PC client, web application or other program that signs on through the APIs.
- A saved password in a data source, script, file transfer job or application configuration is out of date after a password change.
- Passwords are case-sensitive at QPWDLVL 2 or 3, and the client sends a different case.
- On IBM i 7.5, the user ID itself is wrong or the profile doesn't exist on this system.
- A program builds the password parameter incorrectly, for example with the wrong length or CCSID.
How to find the problem
- If your own program called the API, look in its job log with
DSPJOBLOG. The message names the profile. - Run
DSPUSRPRF USRPRF(name)and check Sign-on attempts not valid. A rising count with no interactive failures points to a client retrying. - If *AUTFAIL auditing is on, QAUDJRN PW entries show each failure and the job or address it came from.
- Watch QSYSOPR and QSYSMSG for CPF1393, which means the failures disabled the profile.
How to fix it
- Correct the password in the client or configuration that is failing. Then test once before re-enabling anything.
- If the user has forgotten the password, reset it with
CHGUSRPRF USRPRF(name) PASSWORD(temp) PWDEXP(*YES)and have them sign on interactively to set a new one. - If the profile was disabled by the failures, enable it with
CHGUSRPRF USRPRF(name) STATUS(*ENABLED)after fixing the client. - In your own code, check the password length and CCSID parameters you pass to QSYGETPH, and handle CPF22E2 as a normal failure rather than a crash.
IBM documentation
IBM Display Message Descriptions (DSPMSGD). Use the documentation for your installed release.
This link opens the relevant IBM reference library or lookup instructions. Match the complete code and your installed product release; it is not a code-specific review.
Read the installed message description:
DSPMSGD MSGID(CPF22E2) MSGF(QSYS/QCPFMSG)
Also inspect the full job log and second-level message text, including substitution values.
Related codes
Questions
What is the difference between CPF22E2 and CPF1107?
Both mean the password didn't match. CPF1107 comes from the 5250 sign-on display, while CPF22E2 comes from the security APIs that programs and servers use to check passwords.
Can CPF22E2 disable a profile?
Yes. Each failure adds to the profile's count of attempts that weren't valid. When it reaches QMAXSIGN and QMAXSGNACN is set to disable users, the profile is disabled.
Why do I get CPF22E2 for a user that doesn't exist?
On IBM i 7.5 the APIs deliberately return CPF22E2 for both cases when a user ID and password are given. That keeps callers from discovering which user IDs are valid.