{"record":{"id":"d80df1f538d86099","repo":"hashicorp/nomad","slug":"init-of-plugin-s-failed-w","errorCode":null,"errorMessage":"init of plugin %s failed: %w","messagePattern":"init of plugin (.+?) failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/pluginmanager/drivermanager/instance.go","lineNumber":234,"sourceCode":"\n\t\t// If we still have an error there is a real problem\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to start plugin: %v\", err)\n\t\t}\n\t}\n\n\t// Convert to a driver plugin\n\tdriver, ok := pluginInstance.Plugin().(drivers.DriverPlugin)\n\tif !ok {\n\t\tpluginInstance.Kill()\n\t\treturn nil, fmt.Errorf(\"plugin loaded does not implement the driver interface\")\n\t}\n\n\t// Initialize the plugin if it supports it.\n\tif initer, ok := driver.(drivers.DriverIniter); ok {\n\t\tif err := initer.Init(i.ctx); err != nil {\n\t\t\tpluginInstance.Kill()\n\t\t\treturn nil, fmt.Errorf(\"init of plugin %s failed: %w\", i.id, err)\n\t\t}\n\t}\n\n\t// Store the plugin and driver\n\ti.plugin = pluginInstance\n\ti.driver = driver\n\n\t// Store the reattach config\n\tif c, ok := pluginInstance.ReattachConfig(); ok {\n\t\tif err := i.storeReattach(c); err != nil {\n\t\t\ti.logger.Error(\"error storing driver plugin reattach config\", \"error\", err)\n\t\t}\n\t}\n\n\treturn driver, nil\n}\n\n// cleanup shutsdown the plugin","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/pluginmanager/drivermanager/instance.go#L216-L252","documentation":"If the dispensed driver implements drivers.DriverIniter, dispense calls initer.Init(i.ctx) to initialize the driver. On failure the plugin instance is killed and this error wraps the init error, associating it with the plugin id.","triggerScenarios":"initer.Init(i.ctx) returns a non-nil error in instance.dispense — driver-specific initialization (e.g. Docker client setup, libgpu detection, containerd connection) fails within the plugin process.","commonSituations":"Docker driver can't reach /var/run/docker.sock (permissions/socket missing); containerd driver socket unavailable; QEMU/libvirt environment missing; driver config in client config invalid causing init validation failure.","solutions":["Inspect the wrapped init error and the plugin's logs for the failing subsystem","Fix the driver's environment (docker socket permissions/group membership, containerd socket, required binaries) on the node","Correct the plugin's client config block if init validates configuration","After fixing, let Nomad redispense the plugin (restart client or wait for the singleton relaunch)"],"exampleFix":"// before (host)\n$ ls -l /var/run/docker.sock  # 0660 root:root, nomad user not in docker group\n// after (host)\nusermod -aG docker nomad && systemctl restart nomad","handlingStrategy":"validation","validationCode":"// e.g. docker driver precheck on the node\nif _, err := os.Stat(\"/var/run/docker.sock\"); err != nil {\n    return fmt.Errorf(\"docker socket unavailable: %w\", err)\n}\nif err := unix.Access(\"/var/run/docker.sock\", unix.R_OK|unix.W_OK); err != nil {\n    return fmt.Errorf(\"docker socket not accessible to nomad user: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"drv, err := instance.Dispense()\nif err != nil {\n    var initErr error\n    if strings.HasPrefix(err.Error(), \"init of plugin \") {\n        initErr = err // inspect wrapped init cause; fix node env before retry\n    }\n    return initErr\n}","preventionTips":["Pre-provision driver dependencies (docker/containerd sockets, groups, binaries) on every node","Validate driver plugin config stanzas in client config before deployment","Fingerprint nodes and schedule tasks only where driver init prerequisites exist","Watch driver init errors in client logs after node maintenance"],"tags":["nomad","plugin","driver","initialization","environment"],"backgroundTag":"plugin-initialization-failed","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}