juanfont/headscale · error

disabling node expiry: %w

Error message

disabling node expiry: %w

What it means

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

Source

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

	Short: "Expire (log out) a node in your network",
	Long: `Expiring a node will keep the node in the database and force it to reauthenticate.

Use --disable to disable key expiry (node will never expire).`,
	Aliases: []string{"logout", aliasExp, "e"},
	RunE: clientRunE(func(ctx context.Context, client *clientv1.ClientWithResponses, cmd *cobra.Command, args []string) error {
		identifier, _ := cmd.Flags().GetUint64("identifier")
		disableExpiry, _ := cmd.Flags().GetBool("disable")
		nodeID := strconv.FormatUint(identifier, util.Base10)

		// Handle disable expiry - node will never expire.
		if disableExpiry {
			disable := true

			resp, err := client.ExpireNodeWithResponse(ctx, nodeID, clientv1.ExpireNodeJSONRequestBody{
				DisableExpiry: &disable,
			})
			if err != nil {
				return fmt.Errorf("disabling node expiry: %w", err)
			}

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

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

		expiry, _ := cmd.Flags().GetString("expiry")

		now := time.Now()

		expiryTime := now

		if expiry != "" {
			var err error

View on GitHub (pinned to 565fd254d0)

Solutions

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

When it happens

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

Common situations: The request to disable node expiry failed. Confirm the node ID exists and the node actually has an expiry set.


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