juicedata/juicefs · error

remove user group quota

Error message

remove user group quota

What it means

Returned from redisMeta.doInit when the upgrade path disables UserGroupQuota and the Redis transaction deleting the user/group quota keys fails. JuiceFS removes outdated user and group quota counters (userQuotaKey, groupQuotaKey and their usage keys) whenever the new format turns this feature off; failure aborts mount initialization.

Source

Thrown at pkg/meta/redis.go:367

			_, err := m.rdb.TxPipelined(ctx, func(pipe redis.Pipeliner) error {
				pipe.Del(ctx, m.dirUsedInodesKey(), m.dirUsedSpaceKey())
				m.genLog(ctx, pipe, time.Now(), "INIT_ENABLE_DIRSTATS()")
				return nil
			})
			if err != nil {
				return errors.Wrap(err, "remove dir stats")
			}
		}
		if !old.UserGroupQuota && format.UserGroupQuota {
			// remove user group quota as they are outdated
			_, err := m.rdb.TxPipelined(ctx, func(pipe redis.Pipeliner) error {
				pipe.Del(ctx, m.userQuotaKey(), m.userQuotaUsedSpaceKey(), m.userQuotaUsedInodesKey(),
					m.groupQuotaKey(), m.groupQuotaUsedSpaceKey(), m.groupQuotaUsedInodesKey())
				m.genLog(ctx, pipe, time.Now(), "INIT_ENABLE_USERGROUPQUOTA()")
				return nil
			})
			if err != nil {
				return errors.Wrap(err, "remove user group quota")
			}
		}
		if err = format.update(&old, force); err != nil {
			return errors.Wrap(err, "update format")
		}
	}

	data, err := json.MarshalIndent(format, "", "")
	if err != nil {
		return fmt.Errorf("json: %s", err)
	}
	ts := time.Now().Unix()
	attr := &Attr{
		Typ:    TypeDirectory,
		Atime:  ts,
		Mtime:  ts,
		Ctime:  ts,
		Nlink:  2,

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Retry the mount after confirming Redis is writable and reachable.
  2. Ensure all old clients have exited before toggling user-group-quota, then re-run the config/mount so key cleanup completes.
  3. Check Redis cluster mode: use the primary node and correct MOVED handling.
  4. If keys are stale but harmless, verify the format was persisted and quota accounting keys will be rebuilt.
Defensive patterns

Strategy: retry

Validate before calling

// Ensure all clients support user-group-quota toggling and Redis is writable:
if err := rdb.Ping(ctx).Err(); err != nil { return err }
// run `juicefs config --user-group-quota false` only when old clients exited

Try / catch

if err := doInit(ctx, format); err != nil {
    if strings.Contains(err.Error(), "remove user group quota") {
        time.Sleep(backoff); return doInit(ctx, format)
    }
    return err
}

Prevention

When it happens

Trigger: Mounting after `juicefs config --user-group-quota false` (format switched from UserGroupQuota=true to false) when the TxPipelined DEL of the six user/group quota keys fails — Redis unreachable, read-only instance, or cluster routing error.

Common situations: Downgrading/disabling user-group quotas in a mixed-version cluster; Redis replica promoted incorrectly as read-only; maxmemory limiting writes during init.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/79515a3838088d6a. Report an issue: GitHub.