pentaho/pentaho-kettle · error · KettleException
Browser session authentication requested but no JSESSIONID…
Error message
Browser session authentication requested but no JSESSIONID found
What it means
When the connection is configured to authenticate using the browser-captured session cookie, connect() looks up JSESSIONID from the SpoonSessionManager. If the lookup yields null/empty, resolveSessionId throws this KettleException because browser-session authentication cannot proceed without the cookie.
Solutions
- Log into the Pentaho web UI first so a fresh JSESSIONID is captured in the Spoon session
- Switch the repository connection to explicit username/password authentication instead of session-cookie auth
- Clear/refresh the captured session data and retry (re-launch Spoon with the browser flow)
- If scripting headless, do not use browser-session auth — provide credentials directly
Example fix
// before
repoMeta.setBrowserBasedAuthentication(true); // but no JSESSIONID present
// after
String sid = SpoonSessionManager.get(...).getJsessionId();
if (sid != null && !sid.trim().isEmpty()) {
repoMeta.setBrowserBasedAuthentication(true);
} else {
repoMeta.setBrowserBasedAuthentication(false); // fall back to credentials
} Defensive patterns
Strategy: validation
Validate before calling
String sid = (String) SpoonSessionManager.getInstance().get("jsessionid"); // adjust to actual API
if (sid == null || sid.trim().isEmpty()) {
throw new KettleException("No JSESSIONID captured; log into the Pentaho web UI first or use credential auth");
} Try / catch
try {
repository.connect(repoMeta);
} catch (KettleException e) {
if (e.getMessage() != null && e.getMessage().contains("JSESSIONID")) {
// fall back to username/password authentication
} else throw e;
} Prevention
- Prefer explicit username/password auth in headless/CI environments
- Confirm an active browser session exists before choosing session-cookie auth
- Handle expired sessions by re-authenticating and refreshing the cookie
When it happens
Trigger: Authentication mode set to browser/session-cookie while resolveSessionId finds no JSESSIONID in the SpoonSessionManager (missing, null, or whitespace-only), or the session retrieval itself logged an error.
Common situations: Running Spoon via a non-browser launch path so no JSESSIONID was captured; browser session expired before connect; misconfigured repository dialog selecting session auth when a username/password was intended.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- Attempting to create PDI Repository with no Active…
- Mail.Exception.CouldnotFindAuthenticationPassField
- Mail.Exception.CouldnotFindAuthenticationUserField
- PurRepository.FailedLogin.Message
- Session-based authentication is enabled but no valid…
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/cfd946b1e70f2052.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepositoryConnector.java:182
* @throws KettleException if no valid JSESSIONID can be found
*/
private void resolveSessionId() throws KettleException {
String jsessionId = null;
try {
AuthenticationContext authContext =
SpoonSessionManager.getInstance()
.getAuthenticationContext( repositoryMeta.getRepositoryLocation().getUrl() );
if ( authContext != null && authContext.isAuthenticated() ) {
jsessionId = authContext.getJSessionId();
}
} catch ( Exception e ) {
log.logError( "Error retrieving JSESSIONID from SpoonSessionManager", e );
}
if ( jsessionId != null && !jsessionId.trim().isEmpty() ) {
log.logBasic( "Using browser-captured JSESSIONID for authentication" );
} else {
throw new KettleException( "Browser session authentication requested but no JSESSIONID found" );
}
}
/**
* Attempts an in-process connection via PentahoSystem when the BI Platform context is available.
*
* @return a completed {@link RepositoryConnectResult} if in-process connection succeeded, {@code null} otherwise
*/
private RepositoryConnectResult tryInProcessConnect( final String decryptedPassword,
final RepositoryConnectResult result ) {
if ( PentahoSystem.getApplicationContext() == null || PentahoSessionHolder.getSession() == null
|| !PentahoSessionHolder.getSession().isAuthenticated() || !inProcess() ) {
return null;
}
result.setUnifiedRepository( PentahoSystem.get( IUnifiedRepository.class ) );
if ( result.getUnifiedRepository() == null ) {
return null;View on GitHub (pinned to f3058517a1)