{"record":{"id":"6e02c3d0117a3d48","repo":"apache/hadoop","slug":"s10","errorCode":"S10","errorMessage":"Service [{0}] requires service [{1}]","messagePattern":"Service \\[(.+?)\\] requires service \\[(.+?)\\]","errorType":"error_code","errorClass":"ServerException","httpStatus":null,"severity":"critical","filePath":"hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java","lineNumber":600,"sourceCode":"      this.services.put(service.getInterface(), service);\n    }\n    for (Service service : services) {\n      service.postInit();\n    }\n  }\n\n  /**\n   * Checks if all service dependencies of a service are available.\n   *\n   * @param service service to check if all its dependencies are available.\n   *\n   * @throws ServerException thrown if a service dependency is missing.\n   */\n  protected void checkServiceDependencies(Service service) throws ServerException {\n    if (service.getServiceDependencies() != null) {\n      for (Class dependency : service.getServiceDependencies()) {\n        if (services.get(dependency) == null) {\n          throw new ServerException(ServerException.ERROR.S10, service.getClass(), dependency);\n        }\n      }\n    }\n  }\n\n  /**\n   * Destroys the server services.\n   */\n  protected void destroyServices() {\n    List<Service> list = new ArrayList<Service>(services.values());\n    Collections.reverse(list);\n    for (Service service : list) {\n      try {\n        log.debug(\"Destroying service [{}]\", service.getInterface());\n        service.destroy();\n      } catch (Throwable ex) {\n        log.error(\"Could not destroy service [{}], {}\",\n                  new Object[]{service.getInterface(), ex.getMessage(), ex});","sourceCodeStart":582,"sourceCodeEnd":618,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java#L582-L618","documentation":"During initialization HttpFS Server calls checkServiceDependencies() for every loaded service: each Service's getServiceDependencies() must resolve to a service already in the server's services map. Error S10 is thrown when a dependency is missing, and startup aborts. For example FileSystemAccessService declares dependencies on Instrumentation and Scheduler, so it cannot run without InstrumentationService and SchedulerService.","triggerScenarios":"Server init after loading services; a service in httpfs.services returns a non-null getServiceDependencies() containing an interface that no loaded service implements - e.g. enabling FileSystemAccessService while InstrumentationService or SchedulerService was dropped from httpfs.services, or a custom service declaring a dependency that is not listed.","commonSituations":"Trimming the default httpfs.services list to 'lighten' the server and accidentally removing a transitive dependency; adding a custom service without also adding the services it depends on; reordering or dedup rules removing an implementation that was believed unused.","solutions":["Look at the message: parameter 1 is the failing service, parameter 2 the missing dependency interface","Add the service implementation for the missing dependency to the 'httpfs.services' property (e.g. InstrumentationService, SchedulerService)","If the dependent service is not needed, remove it from httpfs.services instead","Restart httpfs and confirm all dependencies resolve in the startup log"],"exampleFix":"<!-- before: FileSystemAccessService present but its dependencies removed -->\n<property><name>httpfs.services</name>\n  <value>org.apache.hadoop.lib.service.hadoop.FileSystemAccessService</value></property>\n\n<!-- after -->\n<property><name>httpfs.services</name>\n  <value>org.apache.hadoop.lib.service.instrumentation.InstrumentationService,\n         org.apache.hadoop.lib.service.scheduler.SchedulerService,\n         org.apache.hadoop.lib.service.hadoop.FileSystemAccessService</value></property>","handlingStrategy":"validation","validationCode":"import org.apache.hadoop.lib.server.Service;\n\n// Verify every declared dependency interface is satisfied by the services list\nList<Service> loaded = instantiateAll(config.getStrings(\"httpfs.services\", new String[0]));\nSet<Class<?>> provided = loaded.stream().map(Service::getInterface).collect(Collectors.toSet());\nfor (Service s : loaded) {\n  if (s.getServiceDependencies() != null) {\n    for (Class<?> dep : s.getServiceDependencies()) {\n      if (!provided.contains(dep)) throw new IllegalStateException(s.getClass() + \" missing \" + dep);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  server.init();\n} catch (ServerException ex) {\n  if (ex.getError() == ServerException.ERROR.S10) {\n    // message: 'Service [<svc>] requires service [<missing-interface>]'\n    log.error(\"dependency check failed: {}\", ex.getMessage(), ex);\n  }\n  throw ex;\n}","preventionTips":["Start from the default httpfs.services list and only remove entries after checking getServiceDependencies() of the rest","For custom services, declare getServiceDependencies() and document the required companion services","Add a startup smoke test in CI that boots the Server with your production services list"],"tags":["httpfs","service-dependencies","configuration","startup"],"backgroundTag":"missing-service-dependency","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}