weaviate/weaviate · error

marshal collections count response (namespace=%q): %w

Error message

marshal collections count response (namespace=%q): %w

What it means

Serialising the collections-count response (which is just an integer count plus namespace context) failed. As with other cluster-query marshal failures this signals corrupted or non-serializable internal state rather than a user payload problem.

Source

Thrown at cluster/schema/manager_query.go:69

	}
	return payload, nil
}

func (sm *SchemaManager) QueryCollectionsCount(req *cmd.QueryRequest) ([]byte, error) {
	// Empty SubCommand keeps the historical cluster-global behavior.
	namespace := ""
	if len(req.SubCommand) > 0 {
		subCommand := cmd.QueryCollectionsCountRequest{}
		if err := json.Unmarshal(req.SubCommand, &subCommand); err != nil {
			return []byte{}, fmt.Errorf("%w: unmarshal collections count request: %w", ErrBadRequest, err)
		}
		namespace = subCommand.Namespace
	}

	response := cmd.QueryCollectionsCountResponse{Count: sm.schema.CollectionsCount(namespace)}
	payload, err := json.Marshal(&response)
	if err != nil {
		return []byte{}, fmt.Errorf("marshal collections count response (namespace=%q): %w", namespace, err)
	}
	return payload, nil
}

func (sm *SchemaManager) QueryTenants(req *cmd.QueryRequest) ([]byte, error) {
	// Validate that the subcommand is the correct type
	subCommand := cmd.QueryTenantsRequest{}
	if err := json.Unmarshal(req.SubCommand, &subCommand); err != nil {
		return []byte{}, fmt.Errorf("%w: %w", ErrBadRequest, err)
	}

	// Read the tenants
	tenants, err := sm.schema.getTenants(subCommand.Class, subCommand.Tenants)
	if err != nil {
		return []byte{}, fmt.Errorf("could not get tenants: %w", err)
	}

	// Build the response, marshal and return

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Treat as an internal error: capture logs and the namespace in the message
  2. Restart the affected node to rebuild query state if it persists
  3. Report upstream with the namespace value that triggered it
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at cluster/schema/manager_query.go:69 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/66ab02b3f827f8b7. Report an issue: GitHub.