juanfont/headscale · error

listing users: %w

Error message

listing users: %w

What it means

Error "listing users: %w" thrown in juanfont/headscale.

Source

Thrown at cmd/headscale/cli/users.go:69

) (uint64, *clientv1.User, error) {
	id, username, err := usernameAndIDFromFlag(cmd)
	if err != nil {
		return 0, nil, err
	}

	params := &clientv1.ListUsersParams{}
	if username != "" {
		params.Name = &username
	}

	if id != 0 {
		idStr := strconv.FormatUint(id, util.Base10)
		params.Id = &idStr
	}

	resp, err := client.ListUsersWithResponse(ctx, params)
	if err != nil {
		return 0, nil, fmt.Errorf("listing users: %w", err)
	}

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

	users := resp.JSON200.Users
	if len(users) != 1 {
		return 0, nil, errMultipleUsersMatch
	}

	return id, &users[0], nil
}

func init() {
	rootCmd.AddCommand(userCmd)
	userCmd.AddCommand(createUserCmd)
	createUserCmd.Flags().StringP("display-name", "d", "", "Display name")

View on GitHub (pinned to 565fd254d0)

Solutions

  1. Inspect the wrapped error for the underlying cause and correct the failing condition (listing users); 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 (listing users); retry the operation after fixing the input, configuration, or environment.

When it happens

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

Common situations: The gRPC ListUsers call failed. Check server connectivity and that the CLI API key or socket permissions are valid.


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