pentaho/pentaho-kettle · critical · RuntimeException

Central Log Store is not initialized!!!

Error message

Central Log Store is not initialized!!!

What it means

KettleLogStore.getInstance() returns the central log store singleton, but only after KettleLogStore.init() has been called. If the static store is still null, the store was never initialized and a RuntimeException is thrown. All log-buffer accessors (getLastBufferLineNr, getAppender, etc.) route through this, so any logging API use before init fails.

Solutions

  1. Call KettleLogStore.init() (or KettleEnvironment.init(), which does it) once at application startup before using any logging APIs.
  2. In tests, add initialization in @BeforeClass / setup.
  3. Guard late/lazy paths so no logging call executes before init finishes.
  4. Check that an earlier init failure (exception swallowed elsewhere) didn't leave the store uninitialized.

Example fix

// before
int nr = KettleLogStore.getLastBufferLineNr(); // store not initialized
// after
KettleLogStore.init();
int nr = KettleLogStore.getLastBufferLineNr();
Defensive patterns

Strategy: validation

Validate before calling

if (KettleLogStore.getInstance() == null) { /* would throw */ }
// Pre-check instead: ensure init happened at startup
KettleEnvironment.init(); // performs KettleLogStore.init() internally

Type guard

static boolean isLogStoreReady() {
  try { KettleLogStore.getInstance(); return true; }
  catch (RuntimeException e) { return false; }
}

Try / catch

try {
  int nr = KettleLogStore.getLastBufferLineNr();
} catch (RuntimeException e) {
  KettleLogStore.init();
  int nr = KettleLogStore.getLastBufferLineNr();
}

Prevention

When it happens

Trigger: Calling KettleLogStore.getLastBufferLineNr/getLogBufferFromTo/getAppender/bufferAppender or getInstance() itself without first calling KettleLogStore.init() in the current JVM — typical in embedded usage, unit tests, or standalone tools that skip KettleEnvironment.init().

Common situations: Embedding Kettle APIs in a custom app without initializing the environment; running a JUnit test that touches the log buffer; calling logging APIs from a shutdown hook or separate thread before initialization completes.

Related errors


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

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/logging/KettleLogStore.java:172

   *          the maximum size of the log buffer
   * @param maxLogTimeoutMinutes
   *          The maximum time that a log line times out in minutes
   */
  private static synchronized void init0( int maxSize, int maxLogTimeoutMinutes, boolean redirectStdOut,
    boolean redirectStdErr ) {
    if ( store != null ) {
      // CentralLogStore already initialized. Just update the values.
      store.appender.setMaxNrLines( maxSize );
      store.replaceLogCleaner( maxLogTimeoutMinutes );
    } else {
      store = new KettleLogStore( maxSize, maxLogTimeoutMinutes, redirectStdOut, redirectStdErr );
    }
    initialized.set( true );
  }

  public static KettleLogStore getInstance() {
    if ( store == null ) {
      throw new RuntimeException( "Central Log Store is not initialized!!!" );
    }
    return store;
  }

  /**
   * @return the number (sequence, 1..N) of the last log line. If no records are present in the buffer, 0 is returned.
   */
  public static int getLastBufferLineNr() {
    return getInstance().appender.getLastBufferLineNr();
  }

  /**
   *
   * Get all the log lines pertaining to the specified parent log channel id (including all children)
   *
   * @param parentLogChannelId
   *          the parent log channel ID to grab
   * @param includeGeneral

View on GitHub (pinned to f3058517a1)