pentaho/pentaho-kettle · error · IllegalArgumentException

Server URL is required

Error message

Server URL is required

What it means

normalizeBaseUrl throws this IllegalArgumentException when the server URL passed to settingsUrl or buildProvidersUrl is null, empty, or whitespace-only. It is an upfront guard so URL construction never proceeds with a blank base.

Solutions

  1. Ensure the repository settings contain a non-blank server URL before calling the service
  2. Validate/trim the URL in the UI before invoking the SSO lookup
  3. Skip SSO detection when no server URL is configured (treat as non-SSO repository)
  4. Fail fast with a user-facing 'enter server URL' message instead of the internal exception

Example fix

// before
String url = ssoProviderService.buildProvidersUrl( settings.getServerUrl() );
// after
if ( settings.getServerUrl() == null || settings.getServerUrl().isBlank() ) {
  return Collections.emptyList(); // SSO not applicable without a server URL
}
String url = ssoProviderService.buildProvidersUrl( settings.getServerUrl() );
Defensive patterns

Strategy: validation

Validate before calling

if ( serverUrl == null || serverUrl.trim().isEmpty() ) {
  throw new IllegalArgumentException( "Server URL must be configured before SSO lookup" );
}

Try / catch

try {
  providers = ssoProviderService.fetchProviders( serverUrl );
} catch ( IllegalArgumentException e ) {
  log.debug( "No server URL configured — skipping SSO detection" );
  providers = Collections.emptyList();
}

Prevention

When it happens

Trigger: Calling buildProvidersUrl(serverUrl) or settingsUrl(...) with null, "", or a blank string as the server URL.

Common situations: Repository connection dialog where the user has not yet entered a server URL; SSO check triggered before the repository settings are loaded; programmatically constructed settings object missing the serverUrl field.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/fca4a91fbf19bcbb. Report an issue: GitHub.

Appendix: source

Thrown at plugins/repositories/core/src/main/java/org/pentaho/di/ui/repo/util/SsoProviderService.java:124

        }
      } catch ( Exception e ) {
        return false;
      }
      return false;
    } finally {
      if ( connection != null ) {
        connection.disconnect();
      }
    }
  }

  public String buildProvidersUrl( String serverUrl ) {
    return normalizeBaseUrl( serverUrl ) + "/plugin/login/api/v0/oauth-providers";
  }

  private String normalizeBaseUrl( String serverUrl ) {
    if ( isBlank( serverUrl ) ) {
      throw new IllegalArgumentException( "Server URL is required" );
    }

    String trimmed = serverUrl.trim();
    return trimmed.endsWith( "/" ) ? trimmed.substring( 0, trimmed.length() - 1 ) : trimmed;
  }

  private boolean getBoolean( Object value ) {
    if ( value instanceof Boolean booleanValue ) {
      return booleanValue;
    }
    if ( value instanceof String stringValue ) {
      return Boolean.parseBoolean( stringValue );
    }
    return false;
  }

  private String stringValue( Object value ) {
    return value == null ? null : value.toString();

View on GitHub (pinned to f3058517a1)