Version output in completion script #341

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

Originally created by @FredericIV on GitHub (Sep 27, 2022).

Bug description
When generating autocompletion scripts, headscale outputs a version warning (below) into the completion script, causing an error in bash.

ESC[90m2022-09-27T17:56:46ZESC[0m ESC[31mWRNESC[0m Failed to read configuration from disk ESC[36merror=ESC[0mESC[31m"Config File "config" Not Found in "[/etc/headscale /root/.headscale /root]""ESC[0m
ESC[90m2022-09-27T17:56:46ZESC[0m ESC[31mWRNESC[0m 'ip_prefixes' not configured, falling back to default: [100.64.0.0/10]
An updated version of Headscale has been found (0.17.0-alpha4 vs. your current v0.16.4). Check it out https://github.com/juanfont/headscale/releases

To Reproduce
Execute the following as root.
headscale completion bash > /etc/bash_completion.d/headscale

Context info
Headscale: v0.16.4 (0.17.0-alpha4 is out at time of writing)
Platform: Fedora 36, Linux 5.19.11

Originally created by @FredericIV on GitHub (Sep 27, 2022). <!-- Headscale is a multinational community across the globe. Our common language is English. Please consider raising the bug report in this language. --> **Bug description** When generating autocompletion scripts, headscale outputs a version warning (below) into the completion script, causing an error in bash. ESC[90m2022-09-27T17:56:46ZESC[0m ESC[31mWRNESC[0m Failed to read configuration from disk ESC[36merror=ESC[0mESC[31m"Config File \"config\" Not Found in \"[/etc/headscale /root/.headscale /root]\""ESC[0m ESC[90m2022-09-27T17:56:46ZESC[0m ESC[31mWRNESC[0m 'ip_prefixes' not configured, falling back to default: [100.64.0.0/10] An updated version of Headscale has been found (0.17.0-alpha4 vs. your current v0.16.4). Check it out https://github.com/juanfont/headscale/releases <!-- A clear and concise description of what the bug is. Describe the expected bahavior 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** Execute the following as root. `headscale completion bash > /etc/bash_completion.d/headscale` <!-- Steps to reproduce the behavior. --> **Context info** Headscale: v0.16.4 (0.17.0-alpha4 is out at time of writing) Platform: Fedora 36, Linux 5.19.11 <!-- 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:27:20 +01:00
adam closed this issue 2025-12-29 01:27:21 +01:00
Author
Owner

@huskyii commented on GitHub (Nov 3, 2022):

set disable_check_updates: true in the config should remove the version info.

@huskyii commented on GitHub (Nov 3, 2022): set `disable_check_updates: true` in the config should remove the version info.
Author
Owner

@mhameed commented on GitHub (Nov 20, 2022):

disable_check_updates: true is a work around, but not a proper fix.

I would argue that the update check should not be performed for "completion", as the output is expected to be parsed by another process, rather than a human, either that, or don't do the update check at all, but expose it via its own commandline argument.

Thanks.

@mhameed commented on GitHub (Nov 20, 2022): disable_check_updates: true is a work around, but not a proper fix. I would argue that the update check should not be performed for "completion", as the output is expected to be parsed by another process, rather than a human, either that, or don't do the update check at all, but expose it via its own commandline argument. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#341