{"record":{"id":"df56b91b09fdaa5a","repo":"kubernetes/kubernetes","slug":"failed-to-init-image-service-error-w","errorCode":null,"errorMessage":"Failed to init image service, error: %w","messagePattern":"Failed to init image service, error: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kubemark/app/hollow_node.go","lineNumber":264,"sourceCode":"\t\t\treturn fmt.Errorf(\"Failed to start fake runtime, error: %w\", err)\n\t\t}\n\t\tdefer fakeRemoteRuntime.Stop()\n\t\truntimeService, err := remote.NewRemoteRuntimeServiceBuilder().\n\t\t\tWithEndpoint(endpoint).\n\t\t\tWithConnectionTimeout(15 * time.Second).\n\t\t\tBuild(ctx)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to init runtime service, error: %w\", err)\n\t\t}\n\n\t\tvar imageService internalapi.ImageManagerService = fakeRemoteRuntime.ImageService\n\t\tif config.UseHostImageService {\n\t\t\timageService, err = remote.NewRemoteImageServiceBuilder().\n\t\t\t\tWithEndpoint(c.ImageServiceEndpoint).\n\t\t\t\tWithConnectionTimeout(15 * time.Second).\n\t\t\t\tBuild(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Failed to init image service, error: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\thollowKubelet := kubemark.NewHollowKubelet(\n\t\t\tf, c,\n\t\t\tclient,\n\t\t\theartbeatClient,\n\t\t\tcadvisorInterface,\n\t\t\timageService,\n\t\t\truntimeService,\n\t\t\tcontainerManager,\n\t\t)\n\t\thollowKubelet.Run(ctx)\n\t}\n\n\tif config.Morph == \"proxy\" {\n\t\tclientConfig.UserAgent = \"hollow-proxy\"\n","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/kubernetes/kubernetes/blob/b882c60b4023bdf09264c2d5d30a2cadebc240fb/cmd/kubemark/app/hollow_node.go#L246-L282","documentation":"Returned from run() (hollow_node.go:264) when remote.NewRemoteImageServiceBuilder().WithEndpoint(c.ImageServiceEndpoint).WithConnectionTimeout(15*time.Second).Build(ctx) fails. This branch runs only when --use-host-image-service=true, which is the DEFAULT (line 107), so most hollow-kubelet deployments exercise it. Build dials the host's real CRI image service endpoint with a 15s timeout.","triggerScenarios":"c.ImageServiceEndpoint points at a host CRI socket (e.g. /var/run/containerd/containerd.sock) that is missing, unreadable, or whose server is not responding within 15s; the socket path is wrong for the container runtime installed on the host.","commonSituations":"Running hollow-kubelet on a host without containerd/CRI-O; wrong --image-service-endpoint for the host runtime; the host runtime is stopped/crashed; permissions on the host socket exclude the kubemark UID; SELinux/AppArmor denying the socket.","solutions":["Confirm the host CRI socket exists and the kubemark UID can access it: `ls -l <socket>` and `crictl --runtime-endpoint <socket> info`.","Pass the correct endpoint via the image-service flag, or set --use-host-image-service=false to use the fake image service instead.","Verify the host container runtime (containerd/CRI-O) is running.","Relax permissions/SELinux so kubemark can dial the socket."],"exampleFix":"// before - default uses host image service which may not exist on the host\n// (run with defaults, fails at 264)\n\n// after - opt out of the host image service for a pure benchmark hollow node\n./kubemark --morph kubelet --use-host-image-service=false","handlingStrategy":"fallback","validationCode":"func validateHostImageEndpoint(endpoint string) error {\n    if endpoint == \"\" {\n        return errors.New(\"host image service endpoint is empty but --use-host-image-service=true\")\n    }\n    if !strings.HasPrefix(endpoint, \"unix://\") {\n        // cri-client accepts a bare path too, but be explicit\n    }\n    if _, err := os.Stat(strings.TrimPrefix(endpoint, \"unix://\")); err != nil {\n        return fmt.Errorf(\"host image socket %q not accessible: %w\", endpoint, err)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"imageService, err = remote.NewRemoteImageServiceBuilder().\n    WithEndpoint(c.ImageServiceEndpoint).\n    WithConnectionTimeout(15 * time.Second).\n    Build(ctx)\nif err != nil {\n    return fmt.Errorf(\"dial host image service %q (15s): %w\", c.ImageServiceEndpoint, err)\n}","preventionTips":["For pure benchmark hollow nodes, set --use-host-image-service=false to skip the host dependency.","Confirm the host CRI socket path matches the installed runtime (containerd vs CRI-O).","Ensure the kubemark UID can read the host CRI socket; relax SELinux/AppArmor as needed."],"tags":["kubemark","cri","image-service","kubernetes","grpc","timeouts","containerd"],"analyzedSha":"b882c60b4023bdf09264c2d5d30a2cadebc240fb","analyzedAt":"2026-08-07T04:07:48.144Z","schemaVersion":2},"datasetVersion":"2026-08-07T07:17:06.508Z"}