pinpoint-apm/pinpoint · error · IllegalArgumentException

Could not load User information.

Error message

Could not load User information.

What it means

BasicLoginService.createNewCookie creates a JWT cookie for a user and throws IllegalArgumentException with 'Could not load User information.' when pinpointMemoryUserDetailsService.loadUserByUsername returns null. This guards against issuing a token for a user the service cannot resolve.

Source

Thrown at basic-login/src/main/java/com/navercorp/pinpoint/login/basic/service/BasicLoginService.java:99

                        logger.warn("This token already expired.");
                    }
                } catch (ExpiredJwtException e) {
                    logger.warn("This token already expired. message:{}", e.getMessage(), e);
                } catch (JwtException e) {
                    logger.warn("Invalid JWT token. message:{}", e.getMessage());
                } catch (UsernameNotFoundException e) {
                    logger.warn("Could not find user for JWT token. message:{}", e.getMessage());
                }
            }
        }

        return null;
    }

    public Cookie createNewCookie(String userId) {
        UserDetails userDetails = pinpointMemoryUserDetailsService.loadUserByUsername(userId);
        if (userDetails == null) {
            throw new IllegalArgumentException("Could not load User information.");
        }

        String token = jwtService.createToken(userDetails);
        Cookie cookie = new Cookie(BasicLoginConstants.PINPOINT_JWT_COOKIE_NAME, token);
        cookie.setPath("/");
        cookie.setHttpOnly(jwtCookieHttpOnly);
        cookie.setSecure(jwtCookieSecure);
        if (jwtCookieSameSite != null && !jwtCookieSameSite.isBlank()) {
            cookie.setAttribute("SameSite", jwtCookieSameSite);
        }

        long maxAge = TimeUnit.MILLISECONDS.toSeconds(jwtService.getExpirationTimeMillis());
        cookie.setMaxAge((int) maxAge);
        return cookie;
    }

    public UserDetailsService getUserDetailsService() {
        return pinpointMemoryUserDetailsService;

View on GitHub (pinned to 744c3d3075)

Solutions

  1. Ensure the userId exists in the user store (re-register the user via user management)
  2. Check that userDetailsMap is populated at startup (user list file/config loaded correctly)
  3. Handle the IllegalArgumentException upstream and clear the stale auth cookie

Example fix

// before
Cookie c = basicLoginService.createNewCookie(userId); // throws if unknown
// after
UserDetails d = service.findUser(userId);
if (d == null) { return null; } // or redirect to login
Cookie c = basicLoginService.createNewCookie(userId);
Defensive patterns

Strategy: try-catch

Validate before calling

if (basicLoginService.findUser(userId) == null) { return null; // skip cookie creation }

Try / catch

try { return createNewCookie(userId); } catch (IllegalArgumentException e) { log.warn("cannot create cookie, unknown user"); return null; }

Prevention

When it happens

Trigger: createNewCookie(userId) called (directly or via cookie()/getUserDetailsShouldIgnoreJwtForUnknownUser()) with a userId absent from the in-memory user details map, when loadUserByUsername returns null instead of throwing.

Common situations: Cookie presented for a user deleted or renamed in user management; login against an in-memory user store that was never populated with that userId; stale cookies after user data reset.

Understand the failure class

Background: "User not found", "Invalid user", and "does not exist": what missing-user lookup errors mean across Rocket.Chat, LiteLLM, Phabricator, rustfs, and pnpm — this error's family across 10 libraries.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/3fe4e684da6581d0. Report an issue: GitHub.