{"record":{"id":"981c4a2086420a63","repo":"juicedata/juicefs","slug":"the-current-trash-will-be-emptied-and-future-remov","errorCode":null,"errorMessage":"The current trash will be emptied and future removed files will purged immediately.","messagePattern":"The current trash will be emptied and future removed files will purged immediately\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/config.go","lineNumber":473,"sourceCode":"\t\t\tif err = test(context.WithValue(context.Background(), object.TierKey{}, targetTierID), blob); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif quota {\n\t\t\tvar totalSpace, availSpace, iused, iavail uint64\n\t\t\t_ = m.StatFS(meta.Background(), meta.RootInode, &totalSpace, &availSpace, &iused, &iavail)\n\t\t\tusedSpace := totalSpace - availSpace\n\t\t\tif format.Capacity > 0 && usedSpace >= format.Capacity ||\n\t\t\t\tformat.Inodes > 0 && iused >= format.Inodes {\n\t\t\t\twarn(\"New quota is too small (used / quota): %d / %d bytes, %d / %d inodes.\",\n\t\t\t\t\tusedSpace, format.Capacity, iused, format.Inodes)\n\t\t\t\tif !yes && !userConfirmed() {\n\t\t\t\t\treturn fmt.Errorf(\"Aborted.\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif trash && format.TrashDays == 0 {\n\t\t\twarn(\"The current trash will be emptied and future removed files will purged immediately.\")\n\t\t\tif !yes && !userConfirmed() {\n\t\t\t\treturn fmt.Errorf(\"Aborted.\")\n\t\t\t}\n\t\t}\n\t\tif originDirStats && !format.DirStats {\n\t\t\tqs := make(map[string]*meta.Quota)\n\t\t\terr := m.HandleQuota(meta.Background(), meta.QuotaList, \"\", meta.DirQuotaType, qs, false, false, false)\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"list quotas\")\n\t\t\t}\n\t\t\tif len(qs) != 0 {\n\t\t\t\tpaths := make([]string, 0, len(qs))\n\t\t\t\tfor path := range qs {\n\t\t\t\t\tpaths = append(paths, path)\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"cannot disable dir stats when there are still %d dir quotas: %v\", len(qs), paths)\n\t\t\t}\n\t\t}","sourceCodeStart":455,"sourceCodeEnd":491,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/config.go#L455-L491","documentation":"When 'juicefs config' sets trash days to 0, the CLI warns that applying the change will empty the existing trash immediately and future deleted files will be purged at once instead of being retained. Deletion becomes irreversible, so the CLI asks for explicit confirmation unless --yes is given.","triggerScenarios":"Running 'juicefs config META --trash-days 0' on a volume that currently has a non-zero trash retention and files sitting in the trash directory.","commonSituations":"Operators disabling trash to reclaim space quickly; automations that set trash-days 0 without realizing pending deleted data is permanently destroyed.","solutions":["Recover needed files from the trash first ('juicefs gc' or copying out of /.trash) before setting --trash-days 0","Choose a small non-zero value (e.g. --trash-days 1) to keep a short retention window","If the purge is intended, re-run with --yes to confirm"],"exampleFix":"// before\njuicefs config sqlite3://test.db --trash-days 0\n// after (keep 1 day of retention)\njuicefs config sqlite3://test.db --trash-days 1","handlingStrategy":"validation","validationCode":"fmt, _ := meta.LoadFormat(metaURI)\nif fmt.TrashDays > 0 && targetTrashDays == 0 {\n\t// empty trash / recover files first\n}","typeGuard":null,"tryCatchPattern":"if strings.Contains(out, \"The current trash will be emptied\") {\n\t// confirm intentionally or abort\n}","preventionTips":["Recover files from /.trash before disabling trash","Use a short non-zero trash-days window instead of 0 when unsure","Never set --trash-days 0 in unattended scripts without --yes and a documented reason"],"tags":["cli","trash","data-loss"],"backgroundTag":"invalid-config-value","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}