expiration time unit does not parse correctly #239

Closed
opened 2025-12-29 01:24:41 +01:00 by adam · 2 comments
Owner

Originally created by @thelittlerocket on GitHub (Mar 17, 2022).

Bug description
When creating a new preauthkey with --expiration flag, if the unit is not h then it will always return the unit is not correct.

To Reproduce
Try to create a preauthkey with expiration set to 30m or 365d
docker exec -it headscale headscale preauthkeys create --namespace dev --expiration 365d
it will return
Error: invalid argument "365d" for "-e, --expiration" flag: time: unknown unit "d" in duration "365d"

Context info

  • Version of headscale
    docker exec -it headscale headscale version dev
  • OS (e.g. Linux, Mac, Cygwin, WSL, etc.) and version
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic
Originally created by @thelittlerocket on GitHub (Mar 17, 2022). **Bug description** When creating a new preauthkey with ``--expiration`` flag, if the unit is not `h` then it will always return the unit is not correct. <!-- A clear and concise description of what the bug is. Describe the expected behavior and how it is currently different. If you are unsure if it is a bug, consider discussing it on our Discord server first. --> **To Reproduce** Try to create a preauthkey with expiration set to `30m` or `365d` `docker exec -it headscale headscale preauthkeys create --namespace dev --expiration 365d` it will return `Error: invalid argument "365d" for "-e, --expiration" flag: time: unknown unit "d" in duration "365d"` <!-- Steps to reproduce the behavior. --> **Context info** - Version of headscale `` docker exec -it headscale headscale version dev `` - OS (e.g. Linux, Mac, Cygwin, WSL, etc.) and version ``` No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.6 LTS Release: 18.04 Codename: bionic ``` <!-- Please add relevant information about your system. For example: - Version of headscale used - Version of tailscale client - OS (e.g. Linux, Mac, Cygwin, WSL, etc.) and version - Kernel version - The relevant config parameters you used - Log output -->
adam added the bug label 2025-12-29 01:24:41 +01:00
adam closed this issue 2025-12-29 01:24:41 +01:00
Author
Owner

@huskyii commented on GitHub (Mar 19, 2022):

https://github.com/juanfont/headscale/issues/322 dup

@huskyii commented on GitHub (Mar 19, 2022): https://github.com/juanfont/headscale/issues/322 dup
Author
Owner

@thelittlerocket commented on GitHub (Mar 19, 2022):

thanks and sorry for the duplicated issue.
closing it now.

@thelittlerocket commented on GitHub (Mar 19, 2022): thanks and sorry for the duplicated issue. closing it now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#239