hashicorp/nomad · error

Failed to parse node list fields: %v

Error message

Failed to parse node list fields: %v

What it means

The /v1/nodes HTTP handler returns HTTP 400 when parseNodeListStubFields cannot interpret the fields-selection query parameters, wrapping the parse error; it is a request-parameter validation failure, not a server fault.

Source

Thrown at command/agent/node_endpoint.go:28

	"github.com/hashicorp/nomad/api"
	"github.com/hashicorp/nomad/nomad/structs"
)

func (s *HTTPServer) NodesRequest(resp http.ResponseWriter, req *http.Request) (any, error) {
	if req.Method != http.MethodGet {
		return nil, CodedError(405, ErrInvalidMethod)
	}

	args := structs.NodeListRequest{}
	if s.parse(resp, req, &args.Region, &args.QueryOptions) {
		return nil, nil
	}

	// Parse fields selection.
	fields, err := parseNodeListStubFields(req)
	if err != nil {
		return nil, CodedError(http.StatusBadRequest, fmt.Errorf("Failed to parse node list fields: %v", err).Error())
	}
	args.Fields = fields

	var out structs.NodeListResponse
	if err := s.agent.RPC("Node.List", &args, &out); err != nil {
		return nil, err
	}

	setMeta(resp, &out.QueryMeta)
	if out.Nodes == nil {
		out.Nodes = make([]*structs.NodeListStub, 0)
	}

	return out.Nodes, nil
}

func (s *HTTPServer) NodeSpecificRequest(resp http.ResponseWriter, req *http.Request) (any, error) {
	path := strings.TrimPrefix(req.URL.Path, "/v1/node/")

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Fix the fields query parameter to contain valid comma-separated node stub field names
  2. Remove the fields parameter to get all default fields
  3. Check the API client version matches the server's supported field names
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at command/agent/node_endpoint.go:28 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/d3738eb29b97e113. Report an issue: GitHub.