{"record":{"id":"ea31d6d103bebd32","repo":"pentaho/pentaho-kettle","slug":"stepmeta-exception-stepcouldnotbeloaded","errorCode":"StepMeta.Exception.StepCouldNotBeLoaded","errorMessage":"Step with id {0} could not be loaded from the repository!","messagePattern":"Step with id (.+?) could not be loaded from the repository!","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryStepDelegate.java","lineNumber":200,"sourceCode":"        String rowDistributionCode = repository.getStepAttributeString( stepId, 0, \"row_distribution_code\" );\n        RowDistributionInterface rowDistribution =\n          PluginRegistry.getInstance().loadClass(\n            RowDistributionPluginType.class, rowDistributionCode, RowDistributionInterface.class );\n        stepMeta.setRowDistribution( rowDistribution );\n\n        // Load the attribute groups map\n        //\n        stepMeta.setAttributesMap( loadStepAttributesMap( stepId ) );\n\n        // Done!\n        //\n        return stepMeta;\n      } else {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"StepMeta.Exception.StepInfoCouldNotBeFound\", String.valueOf( stepId ) ) );\n      }\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"StepMeta.Exception.StepCouldNotBeLoaded\", String\n        .valueOf( stepMeta.getObjectId() ) ), dbe );\n    }\n  }\n\n  /**\n   * Compatible loading of metadata for v4 style plugins using deprecated methods.\n   *\n   * @param stepMetaInterface\n   * @param repository\n   * @param objectId\n   * @param databases\n   * @throws KettleException\n   */\n  @SuppressWarnings( \"deprecation\" )\n  private void readRepCompatibleStepMeta( StepMetaInterface stepMetaInterface,\n    KettleDatabaseRepository repository, ObjectId objectId, List<DatabaseMeta> databases ) throws KettleException {\n    stepMetaInterface.readRep( repository, objectId, databases, null );\n  }","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryStepDelegate.java#L182-L218","documentation":"In loadStepMeta(), if the initial step lookup succeeded but reading its metadata threw a KettleDatabaseException, the delegate wraps it in a KettleException with the message 'Step with id {0} could not be loaded from the repository!', preserving the database exception as the cause. It means the step row exists but its metadata could not be read from the database.","triggerScenarios":"repository.stepDelegate.loadStepMeta(stepId) is executing its loadStepAttributesMap / database reads when the underlying KettleDatabaseException occurs — e.g. connection dropped mid-load, corrupted R_STEP row, SQL error on R_STEP_ATTRIBUTE query, or lock/timeout on the repository tables.","commonSituations":"Repository DB connection timeout while loading large transformations; corrupted rows after an aborted migration; insufficient SELECT privileges on attribute tables; database failover during a load.","solutions":["Inspect the cause (getCause()) — it is a KettleDatabaseException with the real SQL/JDBC error; fix that root problem first.","Verify database connectivity and retry the load; transient network/timeout failures often succeed on retry.","Check grants on R_STEP / R_STEP_ATTRIBUTE for the repository user.","If the row is corrupted, delete and re-save the step/transformation from a working copy."],"exampleFix":"// before\nStepMeta step = repository.stepDelegate.loadStepMeta(stepId);\n// after\ntry {\n  StepMeta step = repository.stepDelegate.loadStepMeta(stepId);\n} catch (KettleException e) {\n  throw new KettleException(\"Loading step \" + stepId + \" failed: \" + e.getCause().getMessage(), e);\n}","handlingStrategy":"retry","validationCode":"// verify connectivity first\nif (!repository.isConnected()) repository.connect(repoMeta.getUser(), repoMeta.getPassword());","typeGuard":null,"tryCatchPattern":"try {\n  return repository.stepDelegate.loadStepMeta(stepId);\n} catch (KettleException e) {\n  Throwable cause = e.getCause();\n  if (cause instanceof KettleDatabaseException) { /* inspect SQL error / retry */ }\n  throw e;\n}","preventionTips":["Keep repository connections alive with connection pooling/health checks","Check DB grants on R_STEP and attribute tables","Inspect getCause() for the true JDBC error before acting"],"tags":["database","repository","pentaho-kettle","database-read"],"backgroundTag":"database-query-failed","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"}