{"record":{"id":"8a220544b2eadcb8","repo":"apache/hadoop","slug":"resource-type-is-s-but-srcpaths-were-s","errorCode":null,"errorMessage":"Resource type is %s but srcPaths were: %s","messagePattern":"Resource type is (.+?) but srcPaths were: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/Client.java","lineNumber":778,"sourceCode":"    if (srcScheme == null\n        || srcScheme.equals(FileSystem.getLocal(getConf()).getScheme())\n        || srcScheme.equals(\"jar\")) {\n      // Need to upload this resource to remote storage\n      List<File> srcFiles = srcURIs.stream().map(URI::getSchemeSpecificPart)\n          .map(File::new).collect(Collectors.toList());\n      Path dstPathBase = getRemoteStoragePath(getConf(), appId);\n      boolean shouldArchive = srcFiles.size() > 1\n          || srcFiles.get(0).isDirectory()\n          || (resource.getType() == LocalResourceType.ARCHIVE\n              && Arrays.stream(ARCHIVE_FILE_TYPES).noneMatch(\n                  suffix -> srcFiles.get(0).getName().endsWith(suffix)));\n      if (shouldArchive) {\n        if (\"jar\".equals(srcScheme)) {\n          throw new IllegalArgumentException(String.format(\"Resources in JARs \"\n                  + \"can't be zipped; resource %s is ARCHIVE and src is: %s\",\n              resource.getResourcePath(), srcPathString));\n        } else if (resource.getType() != LocalResourceType.ARCHIVE) {\n          throw new IllegalArgumentException(\n              String.format(\"Resource type is %s but srcPaths were: %s\",\n                  resource.getType(), srcPathString));\n        }\n        dstPath = new Path(dstPathBase, resource.getResourcePath())\n            .suffix(\".zip\");\n      } else {\n        dstPath = new Path(dstPathBase, srcFiles.get(0).getName());\n      }\n      FileSystem remoteFS = dstPath.getFileSystem(getConf());\n      LOG.info(\"Uploading resource \" + resource + \" from \" + srcPathString\n          + \" to \" + dstPath);\n      try (OutputStream outputStream = remoteFS.create(dstPath, true)) {\n        if (\"jar\".equals(srcScheme)) {\n          try (InputStream inputStream = new URL(srcPaths[0]).openStream()) {\n            IOUtils.copyBytes(inputStream, outputStream, getConf());\n          }\n        } else if (shouldArchive) {\n          List<File> filesToZip;","sourceCodeStart":760,"sourceCodeEnd":796,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-dynamometer/hadoop-dynamometer-infra/src/main/java/org/apache/hadoop/tools/dynamometer/Client.java#L760-L796","documentation":"Error \"Resource type is %s but srcPaths were: %s\" thrown in apache/hadoop.","triggerScenarios":"The resource type (FILE/ARCHIVE/PATTERN) declared for a dynamometer resource does not match the resolved source paths, e.g. an ARCHIVE type with no resolvable source file.","commonSituations":"See trigger scenarios.","solutions":["Match the resource type to the source paths: an ARCHIVE must reference a single archive file, not multiple or mismatched paths."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}