{"record":{"id":"815296c06c9d2a92","repo":"pentaho/pentaho-kettle","slug":"autodoc-exception-unabletodeterminelocation","errorCode":"AutoDoc.Exception.UnableToDetermineLocation","errorMessage":"AutoDoc.Exception.UnableToDetermineLocation","messagePattern":"AutoDoc\\.Exception\\.UnableToDetermineLocation","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/autodoc/AutoDoc.java","lineNumber":213,"sourceCode":"      if ( lastSlashIndex < 0 ) {\n        fileName = RepositoryDirectory.DIRECTORY_SEPARATOR + fileName;\n        lastSlashIndex = 0;\n      }\n\n      String directoryName = fileName.substring( 0, lastSlashIndex + 1 );\n      String objectName = fileName.substring( lastSlashIndex + 1 );\n\n      RepositoryDirectoryInterface directory = data.tree.findDirectory( directoryName );\n      if ( directory == null ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"AutoDoc.Exception.RepositoryDirectoryNotFound\", directoryName ) );\n      }\n\n      location = new ReportSubjectLocation( null, directory, objectName, objectType );\n    }\n\n    if ( location == null ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"AutoDoc.Exception.UnableToDetermineLocation\", fileName, fileType ) );\n    }\n\n    if ( meta.getOutputType() != OutputType.METADATA ) {\n      // Add the file location to the list for later processing in one output report\n      //\n      data.filenames.add( location );\n    } else {\n      // Load the metadata from the transformation / job...\n      // Output it in one row for each input row\n      //\n      Object[] outputRow = RowDataUtil.resizeArray( row, data.outputRowMeta.size() );\n      int outputIndex = getInputRowMeta().size();\n\n      List<AreaOwner> imageAreaList = null;\n\n      switch ( location.getObjectType() ) {\n        case TRANSFORMATION:","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/autodoc/AutoDoc.java#L195-L231","documentation":"AutoDoc.processRow throws KettleException 'AutoDoc.Exception.UnableToDetermineLocation' when, after both the filesystem and repository branches, the ReportSubjectLocation is still null. This happens when the step is neither connected to a repository nor able to resolve the fileName/fileType pair locally. It is a catch-all guard before rendering.","triggerScenarios":"getTrans().getRepository() is null (no repository) and the local-file resolution path did not produce a location (e.g. file doesn't exist on disk), leaving location null for the given fileName and fileType.","commonSituations":"Transformation runs standalone (file-based) but the filename field contains repository-style paths; file deleted from disk after listing; mixed rows where some are repository objects and some are local files.","solutions":["Connect the transformation to a repository if the filenames are repository paths.","If running file-based, ensure the fileName values are valid, existing local file paths.","Log/inspect the failing fileName and fileType values in the input rows.","Split the stream so repository objects and local files are handled by appropriately configured AutoDoc steps."],"exampleFix":"// before: repository-style path with no repository connection\nfileName = \"/home/admin/myTrans\"; // running standalone\n// after: use a real local file path\nfileName = \"/opt/kettle/jobs/myTrans.ktr\";","handlingStrategy":"validation","validationCode":"boolean repoMode = rep != null;\nboolean localExists = !repoMode && new File(fileName).exists();\nif (!repoMode && !localExists) {\n  throw new IllegalStateException(\"Cannot resolve location: no repository and file missing: \" + fileName);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match mode to data: repository paths need a repository connection; local files need valid paths.","Validate filename field values (repository-style vs filesystem) upstream.","Log fileName/fileType per row to spot bad rows before render."],"tags":["kettle","location-resolution","configuration","runtime"],"backgroundTag":"resource-not-found","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"}