Skip to content

[Bug]: [Bug]: kickstart.sh rejects every --claim-url / --claim-proxy on macOS (BSD grep: "repetition-operator operand invalid") #24045

Description

@methanoya

Bug description

On macOS, if you pass --claim-url to kickstart.sh, it aborts every time, even when the URL is the default:

grep: repetition-operator operand invalid
 ABORTED  https://app.netdata.cloud is not a valid claim URL

The cause is the regex in is_valid_url() (packaging/installer/kickstart.sh, around line 396):

(/[-A-Za-z0-9._~:/?#\[\]@!$&'()*+,;=]*)?$
In POSIX ERE, a backslash inside a bracket expression is a literal character, not an escape. BSD grep therefore ends the bracket expression at the ] that follows \[\, and reads the remainder @!$&'()*+,;=]* as a pattern. There, ()*+ applies + to a repetition, which BSD grep refuses to compile. grep -qE exits non-zero, and the URL is reported as invalid. GNU grep is lenient about this pattern, so the bug does not appear on Linux. --claim-proxy uses the same function, so it fails the same way.

Expected behavior

--claim-url https://app.netdata.cloud is accepted on macOS and FreeBSD.

Steps to reproduce

  1. On macOS, with the system /usr/bin/grep: curl https://get.netdata.cloud/kickstart.sh > /tmp/netdata-kickstart.sh && sh /tmp/netdata-kickstart.sh --stable-channel --claim-token --claim-rooms --claim-url https://app.netdata.cloud
  2. The script aborts
grep: repetition-operator operand invalid
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 A FATAL ERROR WAS ENCOUNTERED!
 \/ \/ \/ \/ \/ \/ \/ \/ \/ \/

 ABORTED  https://app.netdata.cloud/ is not a valid claim URL

 /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
 A FATAL ERROR WAS ENCOUNTERED!
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Installation method

kickstart.sh

System info

Darwin Hi.local 25.6.0 Darwin Kernel Version 25.6.0: Fri Jul 31 19:11:03 PDT 2026; root:xnu-12377.161.14~5/RELEASE_ARM64_T8132 arm64
ProductName:		macOS
ProductVersion:		26.6.2
BuildVersion:		25G83

Netdata build info

not applicable

Additional info

Workaround is

brew install grep
PATH="$(brew --prefix)/opt/grep/libexec/gnubin:$PATH" \
  sh /tmp/netdata-kickstart.sh ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triageIssues which need to be manually labelled

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions