pentaho/pentaho-kettle · error · IOException

Cannot open browser on OS:

Error message

Cannot open browser on OS: 

What it means

openSystemBrowser picks a per-OS command (rundll32 on Windows, open on mac, xdg-open on *nix) to launch the browser for OAuth authentication. If the OS string matches none of these branches it throws IOException('Cannot open browser on OS: ' + os), meaning the platform is unsupported for browser-based authentication.

Solutions

  1. Run on a supported platform (Windows, macOS, or Linux/Unix with xdg-open installed).
  2. Install/put 'xdg-open' on PATH for headless Unix variants, or set up an alternative browser launcher.
  3. If the OS truly is unsupported, use a non-browser authentication flow (token-based repository login) instead of authenticate().

Example fix

// before
service.authenticate(); // throws on unsupported OS
// after
String os = System.getProperty( "os.name" ).toLowerCase();
if ( !( os.contains( "win" ) || os.contains( "mac" ) || os.contains( "nix" ) || os.contains( "nux" ) ) ) {
  useTokenBasedLogin();
} else {
  service.authenticate();
}
Defensive patterns

Strategy: fallback

Validate before calling

String os = System.getProperty( "os.name" ).toLowerCase();
boolean browserSupported = os.contains( "win" ) || os.contains( "mac" )
  || os.contains( "nix" ) || os.contains( "nux" );
if ( !browserSupported ) {
  LOGGER.warning( "Unsupported OS for browser auth: " + os + "; using token login" );
}

Try / catch

try {
  authService.authenticate();
} catch ( IOException e ) {
  if ( e.getMessage() != null && e.getMessage().startsWith( "Cannot open browser on OS:" ) ) {
    promptForManualTokenEntry();
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: Calling authenticate() on an OS whose os.name contains none of 'win', 'mac', 'nix'/'nux' — e.g. unknown/forked JVM os.name values, exotic Unix variants, or OS/2-like platforms.

Common situations: Running Pentaho on unusual Unix flavors (e.g. AIX with os.name='AIX'? actually nux may match), containers without a desktop where even the matched command fails silently, or JVMs reporting a non-standard os.name.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at ui/src/main/java/org/pentaho/di/ui/repo/service/BrowserAuthenticationService.java:355

        desktop.browse( URI.create( url ) );
        log.logBasic( "Opened system browser: " + url );
        return;
      }
    }

    // OS-specific fallback using ProcessBuilder with separated arguments
    // to avoid command-injection risks and handle URLs with spaces correctly.
    String os = System.getProperty( "os.name" ).toLowerCase();
    ProcessBuilder pb;

    if ( os.contains( "win" ) ) {
      pb = createProcessBuilder( "rundll32", "url.dll,FileProtocolHandler", url );
    } else if ( os.contains( "mac" ) ) {
      pb = createProcessBuilder( "open", url );
    } else if ( os.contains( "nix" ) || os.contains( "nux" ) ) {
      pb = createProcessBuilder( "xdg-open", url );
    } else {
      throw new IOException( "Cannot open browser on OS: " + os );
    }

    pb.redirectErrorStream( true );
    pb.start();
  }

  /**
   * Creates a {@link ProcessBuilder} with the given command arguments.
   * Package-visible to allow overriding in tests.
   */
  ProcessBuilder createProcessBuilder( String... command ) {
    return new ProcessBuilder( command );
  }

  /**
   * URL encoding utility.
   */
  static String encodeURIComponent( String value ) {

View on GitHub (pinned to f3058517a1)