{"record":{"id":"41b94cea3b3cf902","repo":"juicedata/juicefs","slug":"not-supported-41b94c","errorCode":null,"errorMessage":"not supported","messagePattern":"not supported","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/chunk/mem_cache.go","lineNumber":210,"sourceCode":"\t\t\t\tbreak\n\t\t\t}\n\t\t\tif v.atime.Before(cutoff) {\n\t\t\t\tdeleted++\n\t\t\t\tfreed += int64(cap(v.page.Data))\n\t\t\t\tc.metrics.cacheEvicts.Add(1)\n\t\t\t\tc.delete(k, v.page)\n\t\t\t}\n\t\t}\n\t\tc.Unlock()\n\t\tif deleted > 0 {\n\t\t\tlogger.Debugf(\"Expired cache blocks: %d blocks (%s), remaining: %d blocks (%s)\", deleted, humanize.IBytes(uint64(freed)), len(c.pages), humanize.IBytes(uint64(c.used)))\n\t\t}\n\t\ttime.Sleep(interval / 1000 * time.Duration((cnt+1-deleted)*1000/(cnt+1)))\n\t}\n}\n\nfunc (c *memcache) stage(key string, data []byte, tierID uint8) (string, error) {\n\treturn \"\", errors.New(\"not supported\")\n}\nfunc (c *memcache) uploaded(key string, size int)    {}\nfunc (c *memcache) isEmpty() bool                    { return false }\nfunc (c *memcache) getMetrics() *cacheManagerMetrics { return c.metrics }\n","sourceCodeStart":192,"sourceCodeEnd":215,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/chunk/mem_cache.go#L192-L215","documentation":"memcache.stage is a stub: the in-memory cache manager does not support staging blocks for writeback, so it always returns this error. Any code path that tries to stage uploaded/pending blocks into a memory-only cache will get \"not supported\".","triggerScenarios":"Calling stage() on a memcache instance, i.e. running with --cache-dir set to memory (or cache manager resolved to memcache) while a code path requests block staging (writeback flow).","commonSituations":"Mounting with --cache-dir memory together with --writeback, where staging to disk is impossible; tests that exercise stage against the memory cache.","solutions":["Use a disk-based --cache-dir (real path) when writeback/staging is required; memory cache cannot stage.","Drop --writeback when using memory cache so blocks are uploaded synchronously instead of staged.","If staging was intended for the memory cache, use disk cache or restructure to upload directly."],"exampleFix":"// before\njuicefs mount --cache-dir memory --writeback sqlite3://test.db /mnt/jfs\n// after\njuicefs mount --cache-dir /var/jfsCache --writeback sqlite3://test.db /mnt/jfs","handlingStrategy":"validation","validationCode":"func stagingSupported(cacheDir string) bool {\n\treturn cacheDir != \"memory\"\n}","typeGuard":null,"tryCatchPattern":"if _, err := cache.Stage(key, data); err != nil {\n\tif err.Error() == \"not supported\" {\n\t\treturn uploadDirect(key, data)\n\t}\n\treturn err\n}","preventionTips":["Never combine --cache-dir memory with --writeback","Use a disk cache dir when staging is required","Check cache manager type before calling Stage"],"tags":["cache","unsupported-operation","memory"],"backgroundTag":"unsupported-operation","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}