weaviate/weaviate · error

could not export dynamic users: %w

Error message

could not export dynamic users: %w

What it means

Returned by the RAFT store's Query handler when exporting the dynamic user roster fails for a TYPE_EXPORT_USERS request after the leader barrier check; the user list could not be serialized or read from the store.

Source

Thrown at cluster/store_query.go:122

		}
	case cmd.QueryRequest_TYPE_GET_USERS:
		payload, err = st.dynUserManager.GetUsers(req)
		if err != nil {
			return &cmd.QueryResponse{}, fmt.Errorf("could not get dynamic user: %w", err)
		}
	case cmd.QueryRequest_TYPE_USER_IDENTIFIER_EXISTS:
		payload, err = st.dynUserManager.CheckUserIdentifierExists(req)
		if err != nil {
			return &cmd.QueryResponse{}, fmt.Errorf("could not check user identifier: %w", err)
		}
	case cmd.QueryRequest_TYPE_EXPORT_USERS:
		// Barrier proves this node is still leader and has applied every committed
		// entry, so a fresh leader cannot return a short roster. Per-id reads skip
		// it; the apply re-checks them. raft is nil only in unit-test stores.
		if st.raft != nil {
			var sub cmd.QueryExportUsersRequest
			if err := json.Unmarshal(req.SubCommand, &sub); err != nil {
				return &cmd.QueryResponse{}, fmt.Errorf("could not export dynamic users: %w", err)
			}
			if len(sub.UserIds) == 0 {
				if err := st.raft.Barrier(st.cfg.ConsistencyWaitTimeout).Error(); err != nil {
					return &cmd.QueryResponse{}, fmt.Errorf("verify leader before export: %w", err)
				}
			}
		}
		payload, err = st.dynUserManager.ExportUsers(req)
		if err != nil {
			return &cmd.QueryResponse{}, fmt.Errorf("could not export dynamic users: %w", err)
		}
	case cmd.QueryRequest_TYPE_GET_NAMESPACES:
		payload, err = st.namespaceManager.Get(req)
		if err != nil {
			return &cmd.QueryResponse{}, fmt.Errorf("could not get namespaces: %w", err)
		}
	case cmd.QueryRequest_TYPE_GET_REPLICATION_DETAILS:
		payload, err = st.replicationManager.GetReplicationDetailsByReplicationId(req)

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Inspect the wrapped error for the export failure detail
  2. If user IDs were omitted, ensure a leader barrier can complete (see 'verify leader before export')
  3. Retry the export after the store is stable
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at cluster/store_query.go:122 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/dadfb513e3361123. Report an issue: GitHub.