{"record":{"id":"5614b1de49b5593f","repo":"pentaho/pentaho-kettle","slug":"propertyoutput-log-filenameempty","errorCode":null,"errorMessage":"PropertyOutput.Log.FilenameEmpty","messagePattern":"PropertyOutput\\.Log\\.FilenameEmpty","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/propertyoutput/PropertyOutput.java","lineNumber":106,"sourceCode":"        String realFieldName = environmentSubstitute( meta.getFileNameField() );\n        if ( Utils.isEmpty( realFieldName ) ) {\n          logError( BaseMessages.getString( PKG, \"PropertyOutput.Log.FilenameInFieldEmpty\" ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"PropertyOutput.Log.FilenameInFieldEmpty\" ) );\n        }\n        data.indexOfFieldfilename = data.inputRowMeta.indexOfValue( realFieldName );\n        if ( data.indexOfFieldfilename < 0 ) {\n          // The field is unreachable !\n          logError( BaseMessages.getString( PKG, \"PropertyOutput.Log.ErrorFindingField\", meta.getValueField() ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"PropertyOutput.Log.ErrorFindingField\", meta\n            .getValueField() ) );\n        }\n      } else {\n        // Let's check for filename...\n        data.filename = buildFilename();\n        // Check if filename is empty..\n        if ( Utils.isEmpty( data.filename ) ) {\n          logError( BaseMessages.getString( PKG, \"PropertyOutput.Log.FilenameEmpty\" ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"PropertyOutput.Log.FilenameEmpty\" ) );\n        }\n        openNewFile();\n      }\n    } // end first\n\n    // Get value field\n    String propkey = data.inputRowMeta.getString( r, data.indexOfKeyField );\n    String propvalue = data.inputRowMeta.getString( r, data.indexOfValueField );\n\n    try {\n      if ( meta.isFileNameInField() ) {\n        data.filename = data.inputRowMeta.getString( r, data.indexOfFieldfilename );\n        if ( Utils.isEmpty( data.filename ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"PropertyOutputMeta.Log.FileNameEmty\" ) );\n        }\n        if ( !checkSameFile() ) {\n          // close previous file\n          closeFile();","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/propertyoutput/PropertyOutput.java#L88-L124","documentation":"PropertyOutput throws this KettleException during processRow when the resolved output filename is empty. The step computes the filename from the metadata settings (buildFilename) and refuses to proceed because it has nowhere to write properties. The message comes from the step's message bundle and is both logged and thrown, failing the transformation row processing.","triggerScenarios":"processRow (first input row) calls buildFilename(); if the result is empty (Utils.isEmpty), e.g. when the 'filename' field in the step metadata is blank/only whitespace and filename-in-field is not used, the exception is thrown before openNewFile().","commonSituations":"Step configured in Spoon with an empty filename and no filename field; filename built purely from a variable like ${OUT_FILE} that is undefined at runtime so it resolves to empty; copying a step between transformations and losing the filename setting.","solutions":["Open the Property Output step settings and set a non-empty filename in the File tab.","If the filename should come from a variable, verify the variable (e.g. ${OUT_FILE}) is defined via a Set Variables step or kettle.properties.","If the filename should be taken from an incoming row field, enable 'filename in field' and select the field, so this branch is skipped.","Wrap the transformation run in try-catch for KettleException and validate the step configuration programmatically before execution."],"exampleFix":"// before (transformation XML / metadata)\n<file><name></name></file>\n// after\n<file><name>/data/output/properties.properties</name></file>","handlingStrategy":"validation","validationCode":"String filename = stepMeta.getFileName(); // from PropertyOutputMeta\nif (filename == null || filename.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"Property Output step requires a non-empty filename\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    trans.execute(null);\n    trans.waitUntilFinished();\n} catch (KettleException e) {\n    if (e.getMessage().contains(\"FilenameEmpty\")) {\n        // prompt user to configure the output filename\n    }\n}","preventionTips":["Always set the filename (or filename-in-field) in the step dialog before saving.","Define variables used in filenames via kettle.properties or a Set Variables step that runs first.","Run transformation validation/metadata checks before production execution."],"tags":["pentaho-kettle","file-output","missing-filename","configuration"],"backgroundTag":"empty-required-field","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"}