{"record":{"id":"0f98ecbc334f4881","repo":"pentaho/pentaho-kettle","slug":"failed-to-create-the-content-location","errorCode":null,"errorMessage":"Failed to create the content-location","messagePattern":"Failed to create the content-location","errorType":"exception","errorClass":"ContentCreationException","httpStatus":null,"severity":"error","filePath":"plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/urlrepository/FileObjectContentLocation.java","lineNumber":195,"sourceCode":"   * @param name the name of the new entity.\n   * @return the newly created entity, never null.\n   * @throws ContentCreationException if the item could not be created.\n   */\n  public ContentLocation createLocation( final String name ) throws ContentCreationException {\n    if ( RepositoryUtilities.isInvalidPathName( name ) ) {\n      throw new IllegalArgumentException( \"The name given is not valid.\" );\n    }\n    try {\n      final FileObject file = getBackend();\n      final FileObject child = file.resolveFile( name );\n      if ( child.exists() ) {\n        throw new ContentCreationException( \"File already exists.\" );\n      }\n      child.createFile();\n      try {\n        return new FileObjectContentLocation( this, child );\n      } catch ( ContentIOException e ) {\n        throw new ContentCreationException( \"Failed to create the content-location\", e );\n      }\n    } catch ( FileSystemException e ) {\n      throw new RuntimeException( e );\n    }\n  }\n\n  /**\n   * Checks, whether an content entity with the given name exists in this content location. This method will report\n   * invalid filenames as non-existent.\n   *\n   * @param name the name of the new entity.\n   * @return true, if an entity exists with this name, false otherwise.\n   */\n  public boolean exists( final String name ) {\n    if ( RepositoryUtilities.isInvalidPathName( name ) ) {\n      return false;\n    }\n    try {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/urlrepository/FileObjectContentLocation.java#L177-L213","documentation":"In createLocation, after child.createFile() succeeds, constructing the new FileObjectContentLocation wrapper may itself throw ContentIOException; this is rethrown as ContentCreationException 'Failed to create the content-location' with the original exception chained.","triggerScenarios":"new FileObjectContentLocation(this, child) throwing ContentIOException — typically because the freshly created child does not behave as a folder in the backing VFS (e.g. provider created it as a plain file).","commonSituations":"Filesystem providers that don't distinguish folders from files (createFile produced a file, not a folder), so wrapping fails; unusual VFS schemes or corrupted temp output directories.","solutions":["Inspect the chained ContentIOException cause for the actual wrap failure.","Verify the VFS scheme/provider used supports folder semantics (prefer file/local providers for output dirs).","Delete the just-created child and retry, or use a different output location.","Avoid createLocation on providers known to treat everything as files; use createItem for leaf outputs instead."],"exampleFix":"// before\nContentLocation sub = location.createLocation(\"exports\");\n// after\ntry {\n  sub = location.createLocation(\"exports\");\n} catch (ContentCreationException e) {\n  // child may have been created as a plain file; remove and retry\n  location.getEntry(\"exports\").delete();\n  sub = location.createLocation(\"exports\");\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  sub = location.createLocation(name);\n} catch (ContentCreationException e) {\n  Throwable cause = e.getCause(); // ContentIOException from wrapper construction\n  // cleanup partially created child and retry or abort with clear message\n}","preventionTips":["Use VFS providers with proper folder semantics for output directories.","Inspect chained causes when location creation fails.","Test location creation against the target filesystem scheme early in development."],"tags":["vfs","content-repository","folder"],"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"}