{"record":{"id":"85b34da089f845d7","repo":"pentaho/pentaho-kettle","slug":"repository-required-runtransservlet","errorCode":null,"errorMessage":"Repository required.","messagePattern":"Repository required\\.","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/www/RunTransServlet.java","lineNumber":270,"sourceCode":"        String logging = KettleLogStore.getAppender().getBuffer( trans.getLogChannelId(), false ).toString();\n        throw new KettleException( \"Error executing Transformation: \" + logging, executionException );\n      }\n    } catch ( Exception ex ) {\n      logError( \"Error occurred while executing transformation\", ex );\n      out.println( new WebResult( WebResult.STRING_ERROR, BaseMessages.getString(\n        PKG, \"RunTransServlet.Error.UnexpectedError\", Const.CR + Const.getStackTracker( ex ) ) ) );\n    }\n  }\n\n  //need for unit test\n  Trans createTrans( TransMeta transMeta, SimpleLoggingObject servletLoggingObject ) {\n    return new Trans( transMeta, servletLoggingObject );\n  }\n\n  private TransMeta loadTrans( Repository repository, String transformationName, VariableSpace parentVariableSpace ) throws KettleException {\n\n    if ( repository == null ) {\n      throw new KettleException( \"Repository required.\" );\n    } else {\n\n      synchronized ( repository ) {\n        // With a repository we need to load it from /foo/bar/Transformation\n        // We need to extract the folder name from the path in front of the\n        // name...\n        //\n        String directoryPath;\n        String name;\n        int lastSlash = transformationName.lastIndexOf( RepositoryDirectory.DIRECTORY_SEPARATOR );\n        if ( lastSlash < 0 ) {\n          directoryPath = \"/\";\n          name = transformationName;\n        } else {\n          directoryPath = transformationName.substring( 0, lastSlash );\n          name = transformationName.substring( lastSlash + 1 );\n        }\n        RepositoryDirectoryInterface directory =","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/www/RunTransServlet.java#L252-L288","documentation":"loadTrans in RunTransServlet throws KettleException(\"Repository required.\") when the Repository argument is null even though a transformationName was supplied, i.e. the caller asked to load a transformation from a repository without providing one. When no repository is configured the servlet can only load transformations from a file path; a repository path/name combination demands a connected repository.","triggerScenarios":"GET /kettle/runTrans/?trans=/path/in/repo without rep/user/pass parameters (or with only some), so the servlet builds a null Repository and passes it to loadTrans; or programmatically calling loadTrans(null, name, vars).","commonSituations":"Carte REST scripts that omit the rep/user/pass query parameters; renamed repository credentials after a migration; mixing file-based and repository-based transformation references in one automation script.","solutions":["Add rep=<repositoryName>, user=<user>, pass=<password> query parameters to the runTrans URL so the servlet connects to the repository.","If the transformation is a file, use the file form instead: trans=<full/path/file.ktr> with type=xml (no repository).","Verify the repository is defined in ~/.kettle/repositories.xml on the Carte host so it can be found and connected.","If embedding the servlet API, never call loadTrans with a null repository when transformationName is a repository path."],"exampleFix":"// before\nGET http://carte:8080/kettle/runTrans/?trans=/home/admin/etl/load.ktr&user=admin&pass=secret\n\n// after (repository name supplied so repository != null)\nGET http://carte:8080/kettle/runTrans/?trans=/home/admin/etl/load.ktr&rep=prodRepo&user=admin&pass=secret","handlingStrategy":"validation","validationCode":"boolean usesRepo = params.get(\"rep\") != null && params.get(\"user\") != null && params.get(\"pass\") != null;\nboolean usesFile = params.get(\"trans\").endsWith(\".ktr\") && !params.get(\"trans\").startsWith(\"/\") == false;\nif (!usesRepo && !fileSpecifiedWithoutRepo(params)) throw new IllegalArgumentException(\"provide rep/user/pass or a file path\");","typeGuard":null,"tryCatchPattern":"try {\n  String resp = callCarte(\"runTrans\", params);\n} catch (Exception e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Repository required\")) {\n    throw new ConfigurationException(\"Add rep/user/pass query parameters or use a file-based trans path\", e);\n  }\n  throw e;\n}","preventionTips":["Template Carte URLs with all repository parameters filled in.","Prefer explicit file-based execution for CI to avoid repository dependencies.","Verify the repository is registered in repositories.xml on the target host."],"tags":["carte","repository","missing-argument","rest-servlet"],"backgroundTag":"missing-required-argument","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"}