IBM i message

CPF2204: User profile not found

CPF2204 means a command or API was given a user profile name that doesn't exist on this system. The text reads "User profile <name> not found."

Other names for this code

Also written as MSGCPF2204, CPF2204 user profile not found, user profile not found AS400, iSeries CPF2204, IBM i user profile not found.

What it means

Many IBM i commands and APIs take a user profile name as input. Commands such as DSPUSRPRF and CHGUSRPRF are the obvious ones. The Get Profile Handle API (QSYGETPH), which programs and servers use to check a user ID and password or to switch to another profile, also lists CPF2204 among its errors. When the name given doesn't match any profile on the system, the request ends with CPF2204, usually as an escape message.

The message is plain. The profile isn't there. The work is in finding out why the name was wrong or why the profile is missing. In a CL program it's often a hard-coded name that exists on one system and not another.

On IBM i 7.5 the security APIs changed. When both a user ID and a password are supplied, they now return CPF22E2 for an unknown user ID too, instead of CPF2204, so a caller can't use the difference to find valid user IDs. Commands that only take a profile name still send CPF2204.

Common causes

  • The profile name was mistyped.
  • A CL program, job scheduler entry or script names a profile that exists on another system or partition but not this one.
  • The profile was deleted, for example when someone left, but programs and schedules still refer to it.
  • The name was passed in lowercase, in quotes such as 'jsmith' or in a CL variable. Neither is converted to upper case, and profile names are stored in upper case.
  • Profiles weren't restored yet on a new or recovery system.

How to find the problem

  1. Open the job log with DSPJOBLOG and find CPF2204. The message before it, or the command it follows, tells you which program and statement named the profile.
  2. List the profiles that exist with WRKUSRPRF USRPRF(*ALL), or run SELECT AUTHORIZATION_NAME FROM QSYS2.USER_INFO in SQL.
  3. Check the source of the failing CL program or the job scheduler entry for the hard-coded name.
  4. If the profile used to exist, check whether it was deleted on purpose before you recreate it.

How to fix it

  • Correct the profile name in the command, program or schedule.
  • If the profile should exist, create it with CRTUSRPRF, or restore it with RSTUSRPRF and then run RSTAUT to restore its private authorities.
  • In CL, don't quote profile names in lowercase, and convert names read from files or other systems to upper case before you use them.
  • In programs that may run where the profile is missing, monitor for it with MONMSG MSGID(CPF2204) EXEC(...).

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(CPF2204) MSGF(QSYS/QCPFMSG)

Also inspect the full job log and second-level message text, including substitution values.

Report a correction to WND Software.

Questions

What is the difference between CPF2204 and CPF1120?

CPF1120 is the sign-on display's message for a user ID it couldn't accept. CPF2204 comes from commands and APIs that were handed a profile name that doesn't exist.

Why does my program get CPF22E2 instead of CPF2204 for a missing user?

On IBM i 7.5 the security APIs return CPF22E2 for both a wrong password and an unknown user ID when both are supplied. This hides which user IDs are valid.

Can I check whether a profile exists without an error?

Yes. CHKOBJ OBJ(QSYS/name) OBJTYPE(*USRPRF) with MONMSG CPF9801 tells a CL program whether the profile exists.