{"record":{"id":"f74557caec527eea","repo":"hashicorp/nomad","slug":"snapshot-q-already-exists-but-is-incompatible-wit","errorCode":null,"errorMessage":"snapshot %q already exists but is incompatible with volume ID %q: %v","messagePattern":"snapshot %q already exists but is incompatible with volume ID %q: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/csi/client.go","lineNumber":646,"sourceCode":"\tif err := c.ensureConnected(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\n\terr := req.Validate()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcreq := req.ToCSIRepresentation()\n\tresp, err := c.controllerClient.CreateSnapshot(ctx, creq, opts...)\n\n\t// these standard gRPC error codes are overloaded with CSI-specific\n\t// meanings, so translate them into user-understandable terms\n\t// https://github.com/container-storage-interface/spec/blob/master/spec.md#createsnapshot-errors\n\tif err != nil {\n\t\tcode := status.Code(err)\n\t\tswitch code {\n\t\tcase codes.AlreadyExists:\n\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\"snapshot %q already exists but is incompatible with volume ID %q: %v\",\n\t\t\t\treq.Name, req.VolumeID, err)\n\t\tcase codes.Aborted:\n\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\"snapshot %q is already pending: %v\",\n\t\t\t\treq.Name, err)\n\t\tcase codes.ResourceExhausted:\n\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\"storage provider does not have enough space for this snapshot: %v\", err)\n\t\tcase codes.Internal:\n\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\"controller plugin returned an internal error, check the plugin allocation logs for more information: %v\", err)\n\t\t}\n\t\treturn nil, err\n\t}\n\n\tsnap := resp.GetSnapshot()\n\treturn &ControllerCreateSnapshotResponse{","sourceCodeStart":628,"sourceCodeEnd":664,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/plugins/csi/client.go#L628-L664","documentation":"ControllerCreateSnapshot translates gRPC status codes from the CSI plugin's CreateSnapshot RPC into user-readable errors. codes.AlreadyExists per the CSI spec means a snapshot with the requested name already exists, but it was created from a different source volume than req.VolumeID, making it incompatible. Nomad surfaces this so the caller knows the name collision is with a snapshot of a different volume.","triggerScenarios":"Calling ControllerCreateSnapshot with req.Name matching an existing snapshot on the storage backend whose source volume ID differs from req.VolumeID; the plugin returns gRPC AlreadyExists and this message is built at client.go:646.","commonSituations":"Reusing a snapshot name from a previous job/volume; two Nomad jobs create snapshots with the same name against the same storage array; stale snapshot left over after volume re-provisioning; case/ID drift between Nomad volume IDs and backend volume handles.","solutions":["Choose a new unique snapshot name (req.Name) for the CreateSnapshot call.","Delete the pre-existing incompatible snapshot first via ControllerDeleteSnapshot with its snapshot ID.","Verify the req.VolumeID is the intended source volume; you may be pointing at the wrong CSI volume.","List existing snapshots (ControllerListSnapshots) to find the colliding name and its source volume."],"exampleFix":"// before\n_, err := c.ControllerCreateSnapshot(ctx, &ControllerCreateSnapshotRequest{\n  SnapshotID: \"daily-backup\",\n  VolumeID:   volB.ID,\n})\n// after: unique, volume-scoped name\n_, err := c.ControllerCreateSnapshot(ctx, &ControllerCreateSnapshotRequest{\n  SnapshotID: fmt.Sprintf(\"%s-daily-backup\", volB.ID),\n  VolumeID:   volB.ID,\n})","handlingStrategy":"validation","validationCode":"func snapshotNameAvailable(ctx context.Context, c *client, name, volumeID string) error {\n  resp, err := c.ControllerListSnapshots(ctx, &ControllerListSnapshotsRequest{})\n  if err != nil { return err }\n  for _, s := range resp.Snapshots {\n    if s.ID == name || s.SourceVolumeID != volumeID && strings.Contains(s.ID, name) {\n      return fmt.Errorf(\"snapshot name %q already exists for different volume\", name)\n    }\n  }\n  return nil\n}","typeGuard":null,"tryCatchPattern":"_, err := c.ControllerCreateSnapshot(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"already exists but is incompatible\") {\n  return fmt.Errorf(\"pick a new snapshot name for volume %s: %w\", req.VolumeID, err)\n}","preventionTips":["Generate snapshot names deterministically from volume ID + timestamp to guarantee uniqueness.","Check existing snapshots before creating with a fixed name.","Delete stale snapshots from old volumes as part of volume decommissioning."],"tags":["csi","snapshot","grpc","nomad","storage"],"backgroundTag":"snapshot-name-conflict","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"}