Update message breaks bash completion #376

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

Originally created by @oscrx on GitHub (Nov 24, 2022).

Bug description

In my .bashrc file I defined autocompletion for headscale.
I logged in just now to my server and got an error message:

Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1021-gcp x86_64)

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

17 updates can be applied immediately.
To see these additional updates run: apt list --upgradable

*** System restart required ***
Last login: Fri Nov 18 13:24:32 2022 from 2a02:a470:xxxx::1337
-bash: /dev/fd/63: line 1: syntax error near unexpected token `('
-bash: /dev/fd/63: line 1: `An updated version of Headscale has been found (0.17.0-beta4 vs. your current 0.17.0-beta3). Check it out https://github.com/juanfont/headscale/releases'

This is caused by the message that I need to update the version.
Can this message be excluded for generating completion data or be turned off in the config?
I auto-update to the latest docker container with watchtower so the message should be less critical in my case.

To Reproduce

Use bash autocomplete when using an older version.

root@headscale:~# headscale completion bash
An updated version of Headscale has been found (0.17.0-beta4 vs. your current 0.17.0-beta3). Check it out https://github.com/juanfont/headscale/releases
# bash completion V2 for headscale                            -*- shell-script -*-

__headscale_debug()
{
    if [[ -n ${BASH_COMP_DEBUG_FILE:-} ]]; then
        echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
    fi
...

Context

.bashrc:

...
...
alias headscale='docker compose --project-directory /opt/headscale exec headscale headscale'
source <(docker compose --project-directory /opt/headscale exec headscale headscale completion bash)

docker-compose.yaml:

version: '3.5'
services:
  watchtower:
    image: containrrr/watchtower
    restart: unless-stopped
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    environment:
      WATCHTOWER_CLEANUP: true
  headscale:
    image: headscale/headscale:latest
    volumes:
      - ./config:/etc/headscale/
      - ./data:/var/lib/headscale
    ports:
      - 443:8443/tcp
      - 443:8443/udp
      - 80:8080/tcp
      - 80:8080/udp
    command: headscale serve
    restart: unless-stopped

versions:

root@headscale:~# docker version
Client: Docker Engine - Community
 Version:           20.10.20
 API version:       1.41
 Go version:        go1.18.7
 Git commit:        9fdeb9c
 Built:             Tue Oct 18 18:20:18 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.20
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.7
  Git commit:       03df974
  Built:            Tue Oct 18 18:18:08 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.8
  GitCommit:        9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
root@headscale:~# docker compose version
Docker Compose version v2.12.0
root@headscale:~# headscale version
0.17.0-beta3

Originally created by @oscrx on GitHub (Nov 24, 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** <!-- 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. --> In my .bashrc file I defined autocompletion for headscale. I logged in just now to my server and got an error message: ```bash Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1021-gcp x86_64) This system has been minimized by removing packages and content that are not required on a system that users do not log into. 17 updates can be applied immediately. To see these additional updates run: apt list --upgradable *** System restart required *** Last login: Fri Nov 18 13:24:32 2022 from 2a02:a470:xxxx::1337 -bash: /dev/fd/63: line 1: syntax error near unexpected token `(' -bash: /dev/fd/63: line 1: `An updated version of Headscale has been found (0.17.0-beta4 vs. your current 0.17.0-beta3). Check it out https://github.com/juanfont/headscale/releases' ``` This is caused by the message that I need to update the version. Can this message be excluded for generating completion data or be turned off in the config? I auto-update to the latest docker container with watchtower so the message should be less critical in my case. **To Reproduce** <!-- Steps to reproduce the behavior. --> Use bash autocomplete when using an older version. ```bash root@headscale:~# headscale completion bash An updated version of Headscale has been found (0.17.0-beta4 vs. your current 0.17.0-beta3). Check it out https://github.com/juanfont/headscale/releases # bash completion V2 for headscale -*- shell-script -*- __headscale_debug() { if [[ -n ${BASH_COMP_DEBUG_FILE:-} ]]; then echo "$*" >> "${BASH_COMP_DEBUG_FILE}" fi ... ``` **Context** .bashrc: ```bash ... ... alias headscale='docker compose --project-directory /opt/headscale exec headscale headscale' source <(docker compose --project-directory /opt/headscale exec headscale headscale completion bash) ``` docker-compose.yaml: ```yaml version: '3.5' services: watchtower: image: containrrr/watchtower restart: unless-stopped volumes: - "/var/run/docker.sock:/var/run/docker.sock" environment: WATCHTOWER_CLEANUP: true headscale: image: headscale/headscale:latest volumes: - ./config:/etc/headscale/ - ./data:/var/lib/headscale ports: - 443:8443/tcp - 443:8443/udp - 80:8080/tcp - 80:8080/udp command: headscale serve restart: unless-stopped ``` versions: ```bash root@headscale:~# docker version Client: Docker Engine - Community Version: 20.10.20 API version: 1.41 Go version: go1.18.7 Git commit: 9fdeb9c Built: Tue Oct 18 18:20:18 2022 OS/Arch: linux/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.20 API version: 1.41 (minimum version 1.12) Go version: go1.18.7 Git commit: 03df974 Built: Tue Oct 18 18:18:08 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.8 GitCommit: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0 root@headscale:~# docker compose version Docker Compose version v2.12.0 root@headscale:~# headscale version 0.17.0-beta3 ```
adam added the bug label 2025-12-29 01:27:55 +01:00
adam closed this issue 2025-12-29 01:27:55 +01:00
Author
Owner

@juanfont commented on GitHub (Nov 29, 2022):

Hi @oscrx, this should be fixed in the v0.17.0 version.

Can you give it a try?

@juanfont commented on GitHub (Nov 29, 2022): Hi @oscrx, this should be fixed in the v0.17.0 version. Can you give it a try?
Author
Owner

@oscrx commented on GitHub (Nov 30, 2022):

I noticed a couple of hours ago or so that autocomplete fixed itself.
My instance auto-updated to 0.17.0 so there is no version skew right now.
Thanks for fixing the issue!

@oscrx commented on GitHub (Nov 30, 2022): I noticed a couple of hours ago or so that autocomplete fixed itself. My instance auto-updated to 0.17.0 so there is no version skew right now. Thanks for fixing the issue!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#376