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
- 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
- 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
Additional info
Workaround is
brew install grep
PATH="$(brew --prefix)/opt/grep/libexec/gnubin:$PATH" \
sh /tmp/netdata-kickstart.sh ...
Bug description
On macOS, if you pass
--claim-urlto kickstart.sh, it aborts every time, even when the URL is the default: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 -qEexits 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-proxyuses the same function, so it fails the same way.Expected behavior
--claim-url https://app.netdata.cloudis accepted on macOS and FreeBSD.Steps to reproduce
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: 25G83Netdata build info
Additional info
Workaround is