{"record":{"id":"263e9d4743fb047c","repo":"pentaho/pentaho-kettle","slug":"rest-exception-errorfindingfield","errorCode":"Rest.Exception.ErrorFindingField","errorMessage":"Rest.Exception.ErrorFindingField","messagePattern":"Rest\\.Exception\\.ErrorFindingField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/rest/core/src/main/java/org/pentaho/di/trans/steps/rest/Rest.java","lineNumber":484,"sourceCode":"\n  /**\n   * Calculate URL\n   *\n   * @throws KettleException\n   */\n  private void calcURL() throws KettleException {\n    if ( meta.isUrlInField() ) {\n      if ( Utils.isEmpty( meta.getUrlField() ) ) {\n        logError( BaseMessages.getString( PKG, \"Rest.Log.NoField\" ) );\n        throw new KettleException( BaseMessages.getString( PKG, \"Rest.Log.NoField\" ) );\n      }\n      // cache the position of the field\n      if ( data.indexOfUrlField < 0 ) {\n        String realUrlfieldName = environmentSubstitute( meta.getUrlField() );\n        data.indexOfUrlField = data.inputRowMeta.indexOfValue( realUrlfieldName );\n        if ( data.indexOfUrlField < 0 ) {\n          // The field is unreachable !\n          throw new KettleException(\n            BaseMessages.getString( PKG, \"Rest.Exception.ErrorFindingField\", realUrlfieldName ) );\n        }\n      }\n    } else {\n      // Static URL\n      data.realUrl = environmentSubstitute( meta.getUrl() );\n    }\n  }\n\n  /**\n   * Calculate method\n   *\n   * @throws KettleException\n   */\n  private void calcMethod() throws KettleException {\n    if ( meta.isDynamicMethod() ) {\n      String field = environmentSubstitute( meta.getMethodFieldName() );\n      if ( Utils.isEmpty( field ) ) {","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/rest/core/src/main/java/org/pentaho/di/trans/steps/rest/Rest.java#L466-L502","documentation":"Thrown in calcURL (from processRow) with message 'Error finding field [{0}] in incoming stream!': the configured URL field name does not exist in the incoming row metadata, so its index cannot be resolved (indexOfValue returned -1).","triggerScenarios":"meta.isUrlInField() true; after environmentSubstitute(meta.getUrlField()) the field name is not found in data.inputRowMeta during processRow.","commonSituations":"Upstream step was renamed or removed the URL column; case mismatch between the configured field name and the stream field (Kettle field names are case-sensitive); variable in the field name resolves to the wrong name at runtime.","solutions":["Check the incoming hop's field list (right-click step > Preview / View input fields) and set 'URL field name' to an exact existing field.","Fix case/spelling so it matches the stream field exactly.","Restore or rename the upstream field that used to carry the URL.","Verify any ${variable} used in the field name resolves to a real field name at runtime."],"exampleFix":"// before\nurl_field=\"Url\"   // stream actually has lowercase 'url'\n// after\nurl_field=\"url\"   // matches data.inputRowMeta.indexOfValue(\"url\") >= 0","handlingStrategy":"validation","validationCode":"// Ensure the configured URL field exists in the stream before the REST step\nRowMetaInterface in = transMeta.getPrevStepFields(restStepName);\nif (restMeta.isUrlInField() && in.indexOfValue(restMeta.getUrlField()) < 0) {\n  throw new IllegalStateException(\"URL field not in stream: \" + restMeta.getUrlField());\n}","typeGuard":null,"tryCatchPattern":"try { processRow(); } catch (KettleException e) {\n  if (e.getMessage().startsWith(\"Error finding field\")) { /* re-check stream fields */ }\n  throw e;\n}","preventionTips":["After renaming upstream fields, always re-check downstream steps that reference them.","Use 'Get fields' buttons in dialogs instead of typing field names manually.","Remember Kettle field names are case-sensitive.","Preview the hop immediately before the REST step when streams change."],"tags":["configuration","stream-fields","kettle","url"],"backgroundTag":"record-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"}