{"record":{"id":"1f522d1c6fe73897","repo":"apolloconfig/apollo","slug":"current-user-not-found-1f522d","errorCode":null,"errorMessage":"Current user not found","messagePattern":"Current user not found","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ReleaseController.java","lineNumber":260,"sourceCode":"  }\n\n  private void checkEmergencyPublishAllowedForUser(String env, boolean emergencyPublish) {\n    String authType = UserIdentityContextHolder.getAuthType();\n    if (emergencyPublish\n        && (UserIdentityConstants.USER.equals(authType)\n            || UserIdentityConstants.USER_TOKEN.equals(authType))\n        && !portalConfig.isEmergencyPublishAllowed(Env.valueOf(env))) {\n      throw new BadRequestException(\"Env: %s is not supported emergency publish now\", env);\n    }\n  }\n\n  private String resolveOperator(String queryOperator, String payloadOperator) {\n    String authType = UserIdentityContextHolder.getAuthType();\n    if (UserIdentityConstants.USER.equals(authType)\n        || UserIdentityConstants.USER_TOKEN.equals(authType)) {\n      UserInfo loginUser = userInfoHolder.getUser();\n      if (loginUser == null || StringUtils.isBlank(loginUser.getUserId())) {\n        throw new BadRequestException(\"Current user not found\");\n      }\n      return loginUser.getUserId();\n    }\n\n    if (UserIdentityConstants.CONSUMER.equals(authType)) {\n      String operator = StringUtils.isBlank(queryOperator) ? payloadOperator : queryOperator;\n      RequestPrecondition.checkArguments(!StringUtils.isContainEmpty(operator),\n          \"operator should not be null or empty\");\n      if (userService.findByUserId(operator) == null) {\n        throw BadRequestException.userNotExists(operator);\n      }\n      return operator;\n    }\n\n    throw new BadRequestException(\"Unsupported auth type: %s\", authType);\n  }\n\n  private boolean shouldHideConfigToPortalUser(String appId, String env, String clusterName,","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/apolloconfig/apollo/blob/d95fc18d112589efc09ddcbe1507047584d55251/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ReleaseController.java#L242-L278","documentation":"Thrown by resolveOperator when the request's auth type is USER or USER_TOKEN but no logged-in user can be resolved from the identity context (null user or blank userId).","triggerScenarios":"Thrown when the operator of the request cannot be resolved: neither a valid consumer token nor a logged-in portal user is present on the release request.","commonSituations":"Missing Authorization token header; expired or revoked consumer token; unauthenticated portal session.","solutions":["Log in to the Apollo portal before calling this endpoint so a user session exists.","If using a consumer token, pass a non-empty operator parameter (query or payload) identifying an existing Apollo user.","If using a user token, ensure the token is valid and associated with an existing user."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d95fc18d112589efc09ddcbe1507047584d55251","analyzedAt":"2026-08-14T04:00:05.477Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}