{"record":{"id":"6fee4d803672166f","repo":"hashicorp/nomad","slug":"unable-to-open-image-archive-v","errorCode":null,"errorMessage":"unable to open image archive: %v","messagePattern":"unable to open image archive: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/docker/driver.go","lineNumber":722,"sourceCode":"// resolveRegistryAuthentication attempts to retrieve auth credentials for the\n// repo, trying all authentication-backends possible.\nfunc (d *Driver) resolveRegistryAuthentication(driverConfig *TaskConfig, repo string) (*registry.AuthConfig, error) {\n\treturn firstValidAuth(repo, []authBackend{\n\t\tauthFromTaskConfig(driverConfig),\n\t\tauthFromDockerConfig(d.config.Auth.Config),\n\t\tauthFromHelper(d.config.Auth.Helper),\n\t})\n}\n\n// loadImage creates an image by loading it from the file system\nfunc (d *Driver) loadImage(task *drivers.TaskConfig, driverConfig *TaskConfig, dockerClient *client.Client) (id string, user string, err error) {\n\n\tarchive := filepath.Join(task.TaskDir().LocalDir, driverConfig.LoadImage)\n\td.logger.Debug(\"loading image from disk\", \"archive\", archive)\n\n\tf, err := os.Open(archive)\n\tif err != nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"unable to open image archive: %v\", err)\n\t}\n\n\tif _, err := dockerClient.ImageLoad(d.ctx, f, client.ImageLoadWithQuiet(true)); err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tf.Close()\n\n\tdockerImage, err := dockerClient.ImageInspect(d.ctx, driverConfig.Image)\n\tif err != nil {\n\t\treturn \"\", \"\", recoverableErrTimeouts(err)\n\t}\n\n\td.coordinator.IncrementImageReference(dockerImage.ID, driverConfig.Image, task.ID)\n\tvar imageUser string\n\tif dockerImage.Config != nil {\n\t\timageUser = dockerImage.Config.User\n\t}\n\treturn dockerImage.ID, imageUser, nil","sourceCodeStart":704,"sourceCodeEnd":740,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/docker/driver.go#L704-L740","documentation":"loadImage opens the archive file named by driverConfig.LoadImage from the task's LocalDir; this error wraps the os.Open failure. It means the image tarball could not be read from disk before it is handed to the Docker daemon via ImageLoad.","triggerScenarios":"The task config sets load_image = \"file.tar\" but the file does not exist in <task_dir>/local/, the artifact that should download it failed or was not declared, or the filename/path is misspelled.","commonSituations":"Missing artifact stanza to fetch the tarball, artifact downloaded to a different path than local/, wrong case-sensitive filename on Linux, or referencing load_image while the file was cleaned up between allocations.","solutions":["Add/verify an artifact stanza that downloads the image archive into the task (files land in the task's local/ dir).","Ensure load_image is just the filename (relative to local dir), e.g. load_image = \"image.tar\".","Check the Nomad client allocation directory for the file's actual presence and exact name.","Verify task user permissions allow reading the file."],"exampleFix":"// before\nconfig { load_image = \"app.tar\" }\n// after\nartifact {\n  source = \"https://example.com/app-image.tar\"\n}\nconfig { load_image = \"app-image.tar\" }","handlingStrategy":"validation","validationCode":"archive := filepath.Join(taskDir, \"local\", cfg.LoadImage)\nif _, err := os.Stat(archive); err != nil {\n\treturn fmt.Errorf(\"image archive %s not present; check artifact stanza: %w\", archive, err)\n}","typeGuard":null,"tryCatchPattern":"if _, err := os.Open(archive); err != nil {\n\tif os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"archive missing, ensure artifact ran: %s\", archive)\n\t}\n\treturn err\n}","preventionTips":["Always pair load_image with an artifact stanza downloading the tar","Use exact, case-correct filenames (Linux is case-sensitive)","Verify file presence in allocations/local/ during dry runs"],"tags":["docker","filesystem","image-archive"],"backgroundTag":"file-not-found","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"}