{"record":{"id":"6709d0c660f36099","repo":"containerd/containerd","slug":"dm-verity-formatting-is-only-supported-on-linux-sy","errorCode":null,"errorMessage":"dm-verity formatting is only supported on Linux systems","messagePattern":"dm-verity formatting is only supported on Linux systems","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/diff/erofs/dmverity_other.go","lineNumber":27,"sourceCode":"\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage erofs\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\nfunc (s *erofsDiff) formatDmverityLayer(_ context.Context, _ string) error {\n\treturn fmt.Errorf(\"dm-verity formatting is only supported on Linux systems\")\n}\n","sourceCodeStart":9,"sourceCodeEnd":29,"githubUrl":"https://github.com/containerd/containerd/blob/4246446a2bf7d03837b0244118d858799393bd80/plugins/diff/erofs/dmverity_other.go#L9-L29","documentation":"This error is returned by the non-Linux (stub) implementation of erofsDiff.formatDmverityLayer. dm-verity tree formatting requires Linux device-mapper support, so on builds for other platforms the method unconditionally fails with this message. It indicates the requested operation cannot be performed on the current OS.","triggerScenarios":"Calling formatDmverityLayer (e.g. while generating a dm-verity root hash for an erofs layer diff) on a non-Linux build, since the build-tagged dmverity_other.go file replaces the Linux implementation with this stub.","commonSituations":"Running containerd with the erofs diff plugin and dm-verity enabled on macOS or Windows, or cross-compiling/copying a non-Linux binary onto a host and expecting dm-verity output.","solutions":["Run the workload on a Linux host where dm-verity is supported","Remove or disable dm-verity options (e.g. disable EnableDmverity in the erofs differ config) on non-Linux platforms","Check build tags to ensure the Linux dmverity implementation is compiled in"],"exampleFix":"// before (non-Linux build)\nerr := d.formatDmverityLayer(ctx, target)\n// after\ndmSupported := runtime.GOOS == \"linux\"\nif dmSupported {\n    err = d.formatDmverityLayer(ctx, target)\n}","handlingStrategy":"fallback","validationCode":"if runtime.GOOS != \"linux\" {\n    return fmt.Errorf(\"dm-verity requires Linux; got %s\", runtime.GOOS)\n}","typeGuard":"func dmVeritySupported() bool { return runtime.GOOS == \"linux\" }","tryCatchPattern":"if err := d.formatDmverityLayer(ctx, target); err != nil {\n    if strings.Contains(err.Error(), \"only supported on Linux\") {\n        // fall back to non-dmverity path\n        return regularDiff(ctx, target)\n    }\n    return err\n}","preventionTips":["Gate dm-verity features behind runtime.GOOS == \"linux\" checks","Disable EnableDmverity in non-Linux deployments","Document platform requirements for the erofs differ"],"tags":["linux","dm-verity","platform-support","erofs"],"backgroundTag":"unsupported-platform","analyzedSha":"4246446a2bf7d03837b0244118d858799393bd80","analyzedAt":"2026-09-02T00:14:43.053Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}