juicedata/juicefs · error

create table acl: %s

Error message

create table acl: %s

What it means

syncAllTables (pkg/meta/sql.go:603) creates/auto-migrates the `acl` table via xorm Sync2; failure is wrapped as "create table acl: %s". The acl table stores POSIX ACL entries for files/directories. Failure aborts metadata engine initialization; since it is late in the sequence, earlier tables already exist and only the acl DDL failed.

Source

Thrown at pkg/meta/sql.go:604

		return fmt.Errorf("create table node, symlink, xattr: %s", err)
	}
	if err := m.syncTable(new(chunk), new(sliceRef), new(delslices)); err != nil {
		return fmt.Errorf("create table chunk, chunk_ref, delslices: %s", err)
	}
	if err := m.syncTable(new(session2), new(sustained), new(delfile)); err != nil {
		return fmt.Errorf("create table session2, sustaind, delfile: %s", err)
	}
	if err := m.syncTable(new(flock), new(plock), new(dirQuota), new(userGroupQuota)); err != nil {
		return fmt.Errorf("create table flock, plock, dirQuota, userGroupQuota: %s", err)
	}
	if err := m.syncTable(new(dirStats)); err != nil {
		return fmt.Errorf("create table dirStats: %s", err)
	}
	if err := m.syncTable(new(detachedNode)); err != nil {
		return fmt.Errorf("create table detachedNode: %s", err)
	}
	if err := m.syncTable(new(acl)); err != nil {
		return fmt.Errorf("create table acl: %s", err)
	}
	if err := m.syncTable(new(delegationToken)); err != nil {
		return fmt.Errorf("create table delegationToken: %s", err)
	}
	if err := m.syncTable(new(changeLog)); err != nil {
		return fmt.Errorf("create table changeLog: %s", err)
	}
	return nil
}

func (m *dbMeta) doInit(format *Format, force bool) error {
	if err := m.syncAllTables(); err != nil {
		return err
	}
	var s = setting{Name: "format"}
	var ok bool
	err := m.simpleTxn(Background(), func(ses *xorm.Session) (err error) {
		ok, err = ses.Get(&s)

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Inspect the wrapped driver error for the exact DB-side reason and address it.
  2. Grant the DB user CREATE/ALTER rights so the new acl table can be added to existing volumes.
  3. Free DB storage or raise quota if the schema hit limits during init.
  4. After backup, drop an incompatible pre-existing acl table and re-run init.
  5. Re-run the command; Sync2 is idempotent and will only create the missing acl table.
Defensive patterns

Strategy: validation

Validate before calling

// Preflight before enabling ACL on existing volumes:
//   SHOW GRANTS FOR CURRENT_USER();  -- CREATE needed to add the acl table
// MySQL: SHOW TABLES LIKE 'jfs_acl';  -- if present from another tool, compare schema first

Try / catch

if err := initMeta(); err != nil {
    if strings.Contains(err.Error(), "create table acl") {
        return fmt.Errorf("acl table DDL failed; grant CREATE/ALTER or resolve conflicting table: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: Metadata engine initialization when Sync2 on the acl bean fails: privileges, storage exhaustion reached late in init, connection drop, or an existing acl table with incompatible columns (e.g. created by a different tool).

Common situations: ACL support enabled in newer JuiceFS versions requires creating this table on legacy volumes whose DB user has since been downgraded; schema table-count limits; collation/charset conflicts on existing acl tables.

Related errors


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