{"record":{"id":"60994fb230220ee9","repo":"hashicorp/nomad","slug":"driver-does-not-support-exec","errorCode":null,"errorMessage":"driver does not support exec","messagePattern":"driver does not support exec","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/drivers/server.go","lineNumber":334,"sourceCode":"func (b *driverPluginServer) ExecTaskStreaming(server proto.Driver_ExecTaskStreamingServer) error {\n\tmsg, err := server.Recv()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to receive initial message: %v\", err)\n\t}\n\n\tif msg.Setup == nil {\n\t\treturn fmt.Errorf(\"first message should always be setup\")\n\t}\n\n\tif impl, ok := b.impl.(ExecTaskStreamingRawDriver); ok {\n\t\treturn impl.ExecTaskStreamingRaw(server.Context(),\n\t\t\tmsg.Setup.TaskId, msg.Setup.Command, msg.Setup.Tty,\n\t\t\tserver)\n\t}\n\n\td, ok := b.impl.(ExecTaskStreamingDriver)\n\tif !ok {\n\t\treturn fmt.Errorf(\"driver does not support exec\")\n\t}\n\n\texecOpts, errCh := StreamToExecOptions(server.Context(),\n\t\tmsg.Setup.Command, msg.Setup.Tty,\n\t\tserver)\n\n\tresult, err := d.ExecTaskStreaming(server.Context(),\n\t\tmsg.Setup.TaskId, execOpts)\n\n\texecOpts.Stdout.Close()\n\texecOpts.Stderr.Close()\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// wait for copy to be done\n\tselect {","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/plugins/drivers/server.go#L316-L352","documentation":"The driver plugin implementation behind the server only satisfies the base driver interface; it implements neither ExecTaskStreamingRawDriver nor ExecTaskStreamingDriver, so exec streaming is not available. The server returns this error instead of attempting an unsupported capability.","triggerScenarios":"Calling ExecTaskStreaming against a driver whose plugin implementation does not implement ExecTaskStreamingDriver (or the Raw variant), e.g. drivers without exec support.","commonSituations":"Using a driver that never implemented streaming exec (e.g. mock or restricted drivers); running an older plugin binary that predates the streaming exec interface while the host expects it; job/task driver configuration selecting a driver that lacks exec capability.","solutions":["Use a driver that supports streaming exec, or implement ExecTaskStreamingDriver (or ExecTaskStreamingRawDriver) in the plugin.","Upgrade the driver plugin binary to a version implementing the streaming exec interfaces.","Change the task's driver configuration to one that supports exec, or avoid exec operations (e.g. exec/alloc fs commands) on this driver."],"exampleFix":"// before\nfunc (d *MyDriver) TaskConfigSchema() (*hclspec.Spec, error) { ... } // no exec methods\n// after\nfunc (d *MyDriver) ExecTaskStreamingRaw(ctx context.Context, taskID string, command []string, tty bool, stream proto.Driver_ExecTaskStreamingServer) error {\n\treturn d.execRaw(ctx, taskID, command, tty, stream)\n}","handlingStrategy":"type-guard","validationCode":"// Before issuing exec, check driver capability\nif _, ok := drv.(drivers.ExecTaskStreamingDriver); !ok {\n\treturn errors.New(\"selected driver does not support streaming exec\")\n}","typeGuard":"func supportsExec(d interface{}) bool {\n\t_, raw := d.(drivers.ExecTaskStreamingRawDriver)\n\t_, std := d.(drivers.ExecTaskStreamingDriver)\n\treturn raw || std\n}","tryCatchPattern":"if err != nil && err.Error() == \"driver does not support exec\" {\n\t// fall back to a capable driver or surface a user-facing capability error\n}","preventionTips":["Check driver capability before scheduling tasks that need exec.","Keep plugin binaries up to date with the host version.","Document which drivers support exec in your deployment.","Route exec/alloc commands only to tasks on exec-capable drivers."],"tags":["plugin","driver","exec","capability"],"backgroundTag":"capability-not-supported","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"}