juanfont/headscale · error

getting node: %w

Error message

getting node: %w

What it means

Error "getting node: %w" thrown in juanfont/headscale.

Source

Thrown at cmd/headscale/cli/nodes.go:271

		if resp.StatusCode() != http.StatusOK {
			return apiError(resp.StatusCode(), resp.ApplicationproblemJSONDefault)
		}

		return printOutput(cmd, resp.JSON200.Node, "Node renamed")
	}),
}

var deleteNodeCmd = &cobra.Command{
	Use:     cmdDelete,
	Short:   "Delete a node",
	Aliases: []string{aliasDel},
	RunE: clientRunE(func(ctx context.Context, client *clientv1.ClientWithResponses, cmd *cobra.Command, args []string) error {
		identifier, _ := cmd.Flags().GetUint64("identifier")
		nodeID := strconv.FormatUint(identifier, util.Base10)

		getResponse, err := client.GetNodeWithResponse(ctx, nodeID)
		if err != nil {
			return fmt.Errorf("getting node: %w", err)
		}

		if getResponse.StatusCode() != http.StatusOK {
			return apiError(getResponse.StatusCode(), getResponse.ApplicationproblemJSONDefault)
		}

		if !confirmAction(cmd, fmt.Sprintf(
			"Do you want to remove the node %s?",
			getResponse.JSON200.Node.Name,
		)) {
			return printOutput(cmd, map[string]string{colResult: "Node not deleted"}, "Node not deleted")
		}

		deleteResponse, err := client.DeleteNodeWithResponse(ctx, nodeID)
		if err != nil {
			return fmt.Errorf("deleting node: %w", err)
		}

View on GitHub (pinned to 565fd254d0)

Solutions

  1. Inspect the wrapped error for the underlying cause and correct the failing condition (getting node); retry the operation after fixing the input, configuration, or environment.

Example fix

Inspect the wrapped error for the underlying cause and correct the failing condition (getting node); retry the operation after fixing the input, configuration, or environment.

When it happens

Trigger: Thrown at cmd/headscale/cli/nodes.go:271 when the library encounters an invalid state.

Common situations: Fetching the node failed. Verify the node identifier (ID) is correct via headscale nodes list.


AI-assisted analysis of juanfont/headscale@565fd254d0 (2026-08-15). Data as JSON: /api/errors/4eeb166e485533ab. Report an issue: GitHub.