{"record":{"id":"6213a68ba14fe0ca","repo":"pentaho/pentaho-kettle","slug":"unable-to-save-messages-properties-file","errorCode":null,"errorMessage":"Unable to save messages properties file '","messagePattern":"Unable to save messages properties file '","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"ui/src/main/java/org/pentaho/di/ui/i18n/MessagesStore.java","lineNumber":145,"sourceCode":"      if ( !file.exists() ) {\n        File parent = file.getParentFile();\n        if ( !parent.exists() ) {\n          parent.mkdirs(); // create the messages/ folder\n        }\n      }\n      Properties properties = new Properties();\n      for ( String key : messagesMap.keySet() ) {\n        properties.put( key, messagesMap.get( key ) );\n      }\n      FileOutputStream fileOutputStream = new FileOutputStream( file );\n      String comment =\n        \"File generated by Pentaho Translator for package '\"\n          + messagesPackage + \"' in locale '\" + locale + \"'\" + Const.CR + Const.CR;\n      properties.store( fileOutputStream, comment );\n      fileOutputStream.close();\n      setChanged( false );\n    } catch ( IOException e ) {\n      throw new KettleException( \"Unable to save messages properties file '\" + filename + \"'\", e );\n    }\n  }\n\n  /**\n   * Find a suitable filename for the specified locale and messages package. It tries to find the file in the specified\n   * directories in the order that they are specified.\n   *\n   * @param alternativeSourceFolders\n   *\n   * @param directories\n   *          the source directories to try and map the messages files against.\n   * @return the filename that was found.\n   */\n  public String getLoadFilename( List<String> alternativeSourceFolders ) throws FileNotFoundException {\n    String path = calcFolderName( sourceFolder );\n\n    // First try the source folder of the Java file\n    //","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/ui/src/main/java/org/pentaho/di/ui/i18n/MessagesStore.java#L127-L163","documentation":"MessagesStore.write(String filename) wraps any IOException encountered while writing the properties file (creating the output stream, storing properties, closing) into a KettleException with the target filename. This is a low-level I/O failure, not a logic error: disk, path, or permission problems.","triggerScenarios":"The target directory does not exist, the process lacks write permission, the file is locked by another process, or the disk is full when properties.store() writes the file.","commonSituations":"Saving translations into a read-only source tree (e.g. inside a jar'ed module or version-controlled folder checked out read-only); saving to a path on a disconnected drive; concurrent Translator sessions holding the file.","solutions":["Verify the parent directory of filename exists and is writable; create it if needed.","Check file/directory permissions and that no other process locks the file.","Check free disk space.","Run the Translator with a working directory / source folder that is writable."],"exampleFix":"// before\nstore.write( \"/opt/pentaho/design-tools/translator/src/org/pentaho/di/messages/messages_fr.properties\" );\n\n// after\nFile out = new File( targetPath );\nFile parent = out.getParentFile();\nif ( !parent.exists() ) parent.mkdirs();\nif ( !parent.canWrite() ) throw new IllegalStateException( \"Not writable: \" + parent );\nstore.write( out.getAbsolutePath() );","handlingStrategy":"try-catch","validationCode":"File out = new File( filename );\nFile parent = out.getParentFile();\nif ( parent == null || !parent.isDirectory() || !parent.canWrite() ) {\n  throw new IllegalStateException( \"Target dir missing or not writable: \" + parent );\n}","typeGuard":null,"tryCatchPattern":"try {\n  store.write( filename );\n} catch ( KettleException e ) {\n  log.error( \"Could not write \" + filename + \": check permissions, disk space, locks\", e );\n}","preventionTips":["Write into a writable working copy, not a read-only source/jar tree","Check parent dir existence and canWrite() before saving","Avoid two Translator instances saving the same file simultaneously"],"tags":["i18n","file-write","io","permissions"],"backgroundTag":"file-write-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"}