{"record":{"id":"72c3488c8353c79c","repo":"pentaho/pentaho-kettle","slug":"failed-to-re-invoke-operation-after-successful-login","errorCode":null,"errorMessage":"Failed to re-invoke operation after successful login","messagePattern":"Failed to re-invoke operation after successful login","errorType":"exception","errorClass":"LoginSuccessReinvokeException","httpStatus":null,"severity":"error","filePath":"plugins/repositories/core/src/main/java/org/pentaho/di/ui/repo/timeout/SessionTimeoutHandler.java","lineNumber":166,"sourceCode":"        return new ReinvokeResult( handleLoginSuccess( objectToHandle, method, args ) );\n      } else {\n        handleLoginCanceled();\n      }\n    }\n    return null;\n  }\n\n  /**\n   * Called after the user successfully logs in. Initializes repository providers and\n   * re-invokes the original method.\n   */\n  private Object handleLoginSuccess( Object objectToHandle, Method method, Object[] args )\n      throws LoginSuccessReinvokeException {\n    initializeRepositoryProvidersAfterReconnection( getSpoon() );\n    try {\n      return method.invoke( objectToHandle, args );\n    } catch ( InvocationTargetException ex ) {\n      throw new LoginSuccessReinvokeException( \"Failed to re-invoke operation after successful login\",\n          ex.getCause() );\n    } catch ( IllegalAccessException | IllegalArgumentException ex ) {\n      throw new LoginSuccessReinvokeException( \"Unable to invoke operation after successful login\", ex );\n    }\n  }\n\n  static class LoginSuccessReinvokeException extends KettleException {\n    private static final long serialVersionUID = 1L;\n\n    LoginSuccessReinvokeException( String message, Throwable cause ) {\n      super( message, cause );\n    }\n  }\n\n  /**\n   * Wrapper that distinguishes \"reinvocation happened and returned a value (possibly null)\"\n   * from \"no reinvocation was performed\".  Using a plain {@code Object} return would conflate\n   * a legitimate {@code null} return value with \"nothing happened\".","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/repositories/core/src/main/java/org/pentaho/di/ui/repo/timeout/SessionTimeoutHandler.java#L148-L184","documentation":"SessionTimeoutHandler.handleLoginSuccess, after a successful re-login triggered by a session timeout, re-invokes the original operation reflectively. If that re-invocation throws InvocationTargetException, it wraps the cause in LoginSuccessReinvokeException('Failed to re-invoke operation after successful login'). Login worked, but executing the original work after re-login failed.","triggerScenarios":"User re-logs in after a timeout; the deferred method invocation throws any exception (server-side failure, missing file, permission change in the new session).","commonSituations":"The newly logged-in user lacks permission the old session had; repository state changed while disconnected; the retried operation hits a server error.","solutions":["Inspect getCause() for the underlying failure from the re-invoked operation","Confirm the re-login used an account with the same permissions as before","Re-navigate/refresh the repository browser and redo the action manually","Check server logs for the underlying exception raised during the retry"],"exampleFix":"// before\nhandler.performLoginAndReinvoke(...); // opaque failure\n// after\ntry {\n  handler.performLoginAndReinvoke(...);\n} catch ( LoginSuccessReinvokeException e ) {\n  log.error( \"Operation failed after re-login:\", e.getCause() );\n}","handlingStrategy":"retry","validationCode":"// confirm equivalent permissions after re-login\nif ( !repository.hasAccess( path, RepositoryPermission.PERMISSION_MANAGE_ACCESS ) ) {\n  throw new SecurityException( \"Re-logged user lacks prior permissions\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  handler.performLoginAndReinvoke( objectToHandle, method, args );\n} catch ( LoginSuccessReinvokeException e ) {\n  log.error( \"Post-login re-invocation failed:\", e.getCause() );\n  // offer manual retry in UI\n}","preventionTips":["Re-login with the same account that owned the original session","Make deferred operations idempotent and re-validate preconditions before the retry","Read getCause() for the real server-side failure","Refresh repository browser state after re-login before retrying UI actions"],"tags":["reflection","login","retry","session"],"backgroundTag":"retry-failed-after-reconnect","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}