{"record":{"id":"b0b70c611e6d2806","repo":"fluent/fluentd","slug":"not-found-service-name-service-name-service","errorCode":null,"errorMessage":"Not found service: name=#{service.name} #{service.host}:#{service.port}","messagePattern":"Not found service: name=#(.+?) #(.+?):#(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/fluent/plugin_helper/service_discovery/manager.rb","lineNumber":133,"sourceCode":"        private\n\n        def handle_message(msg)\n          service = msg.service\n\n          case msg.type\n          when Fluent::Plugin::ServiceDiscovery::SERVICE_IN\n            if (n = build_service(service))\n              @log.info(\"Service in: name=#{service.name} #{service.host}:#{service.port}\")\n              @services[service.discovery_id] = n\n            else\n              raise \"failed to build service in name=#{service.name} #{service.host}:#{service.port}\"\n            end\n          when Fluent::Plugin::ServiceDiscovery::SERVICE_OUT\n            s = @services.delete(service.discovery_id)\n            if s\n              @log.info(\"Service out: name=#{service.name} #{service.host}:#{service.port}\")\n            else\n              @log.warn(\"Not found service: name=#{service.name} #{service.host}:#{service.port}\")\n            end\n          else\n            @log.error(\"BUG: unknow message type: #{msg.type}\")\n          end\n        end\n\n        def build_service(n)\n          @custom_build_method ? @custom_build_method.call(n) : n\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":115,"sourceCodeEnd":147,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin_helper/service_discovery/manager.rb#L115-L147","documentation":"ServiceDiscovery::Manager#handle_message processes SERVICE_OUT by deleting @services[service.discovery_id]. When the id is not present — the service was never added (no prior SERVICE_IN reached the manager) or was already removed (duplicate/out-of-order OUT event) — the removal is a no-op and this warning names the unknown service. Discovery state stays consistent; the event is simply unactionable.","triggerScenarios":"A discovery source emits SERVICE_OUT for a service the manager never saw SERVICE_IN for (missed initial event, static config where start was skipped, service removed before its IN was processed); duplicate OUT events; discovery refresh racing service churn.","commonSituations":"DNS/file-based discovery where a target disappears between refreshes; Kubernetes pod churn delivering out-of-order events; transient mismatch right after Fluentd (re)start.","solutions":["If sporadic during deployment churn, treat as informational — the manager's state remains correct.","Verify the discovery source emits balanced IN/OUT events per discovery_id and does not duplicate OUTs.","Ensure the discovery manager is actually started and processing (no 'There is no discovery_manager' warning) so IN events are not missed.","Upgrade Fluentd if warnings are persistent, as ordering handling has been improved across releases."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Track known discovery ids and only act on OUT for services previously seen\nknown_ids = Set.new\ndef on_event(evt, known_ids)\n  case evt.type\n  when :service_in then known_ids.add(evt.discovery_id)\n  when :service_out\n    return unless known_ids.delete?(evt.discovery_id) # ignore unknown OUT\n  end\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Emit discovery events from a single ordered source per service (balanced IN/OUT per discovery_id).","Expect harmless warnings during startup or pod churn; alert only on persistent repetition.","Ensure the discovery manager starts (no missing discovery_manager warning) so IN events are never missed."],"tags":["service-discovery","event-ordering","deregistration"],"backgroundTag":"orphaned-service-deregistration","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}