{"record":{"id":"be4d0298643f6a4b","repo":"pentaho/pentaho-kettle","slug":"zipfilemeta-exception-unexpectederrorreadingstepinfo","errorCode":null,"errorMessage":"ZipFileMeta.Exception.UnexpectedErrorReadingStepInfo","messagePattern":"ZipFileMeta\\.Exception\\.UnexpectedErrorReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFileMeta.java","lineNumber":256,"sourceCode":"      throw new KettleXMLException( BaseMessages.getString( PKG, \"ZipFileMeta.Exception.UnableToReadStepInfo\" ), e );\n    }\n  }\n\n  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {\n    try {\n      sourcefilenamefield = rep.getStepAttributeString( id_step, \"sourcefilenamefield\" );\n      targetfilenamefield = rep.getStepAttributeString( id_step, \"targetfilenamefield\" );\n      baseFolderField = rep.getStepAttributeString( id_step, \"baseFolderField\" );\n      operationType =\n        getOperationTypeByCode( Const.NVL( rep.getStepAttributeString( id_step, \"operation_type\" ), \"\" ) );\n      addresultfilenames = rep.getStepAttributeBoolean( id_step, \"addresultfilenames\" );\n      overwritezipentry = rep.getStepAttributeBoolean( id_step, \"overwritezipentry\" );\n      createparentfolder = rep.getStepAttributeBoolean( id_step, \"createparentfolder\" );\n      keepsourcefolder = rep.getStepAttributeBoolean( id_step, \"keepsourcefolder\" );\n      movetofolderfield = rep.getStepAttributeString( id_step, \"movetofolderfield\" );\n\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"ZipFileMeta.Exception.UnexpectedErrorReadingStepInfo\" ), e );\n    }\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, \"sourcefilenamefield\", sourcefilenamefield );\n      rep.saveStepAttribute( id_transformation, id_step, \"targetfilenamefield\", targetfilenamefield );\n      rep.saveStepAttribute( id_transformation, id_step, \"baseFolderField\", baseFolderField );\n      rep.saveStepAttribute( id_transformation, id_step, \"operation_type\", getOperationTypeCode( operationType ) );\n      rep.saveStepAttribute( id_transformation, id_step, \"addresultfilenames\", addresultfilenames );\n      rep.saveStepAttribute( id_transformation, id_step, \"overwritezipentry\", overwritezipentry );\n      rep.saveStepAttribute( id_transformation, id_step, \"createparentfolder\", createparentfolder );\n      rep.saveStepAttribute( id_transformation, id_step, \"keepsourcefolder\", keepsourcefolder );\n      rep.saveStepAttribute( id_transformation, id_step, \"movetofolderfield\", movetofolderfield );\n\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"ZipFileMeta.Exception.UnableToSaveStepInfo\" )","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/zipfile/ZipFileMeta.java#L238-L274","documentation":"ZipFileMeta.readRep wraps any Exception thrown while loading the step's settings from the repository (database) into this KettleException. It means step attributes could not be read for the given id_step, so the transformation cannot be loaded from that repository.","triggerScenarios":"readRep throws when rep.getStepAttributeString/Boolean calls fail — repository database connection dropped mid-read, R_PERMISSIONS/schema mismatch, or corrupted r_step_attribute rows for the step.","commonSituations":"Repository database upgraded with an incompatible schema; stale repository connection after a DB restart; a partially-saved transformation leaving missing attribute rows; permission loss on repository tables.","solutions":["Check the chained cause 'e' — typically a JDBC exception naming the repository DB problem.","Test the repository connection (Tools > Repository > Connect) and reconnect.","Verify repository schema version matches your PDI version; re-run the repository upgrade scripts if needed.","Delete and re-create the ZipFile step in the transformation, then re-save it to rewrite its attributes."],"exampleFix":"// before: stale repository connection throws inside readRep\ntransMeta = KettleEnvironment.loadTransMeta(rep, id_transformation);\n// after: reconnect the repository first\nrep.disconnect();\nrep.connect(\"admin\", \"password\");\ntransMeta = KettleEnvironment.loadTransMeta(rep, id_transformation);","handlingStrategy":"retry","validationCode":"// verify repository is reachable before loading\nif (!rep.isConnected()) rep.connect(user, pass);\n// optionally: SELECT COUNT(*) FROM r_step_attribute WHERE id_step = ?","typeGuard":null,"tryCatchPattern":"try {\n    transMeta = loadTransMeta(rep, id_transformation);\n} catch (KettleException e) {\n    if (e.getMessage().contains(\"UnexpectedErrorReadingStepInfo\")) {\n        rep.disconnect(); rep.connect(user, pass); // reconnect and retry once\n    } else { throw e; }\n}","preventionTips":["Keep repository DB schema in sync with your PDI version (run upgrade scripts).","Use connection pooling with health checks for repository databases.","Verify repository user read permissions on r_step_attribute."],"tags":["repository","database","metadata","kettle"],"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"}