Netbird docker compose client not accepting valid URI as environment variables #6427
-
Before posting
Affected areaClient / Agent Deployment typeSelf-hosted - quickstart script Operating system or environmentDocker NetBird version and upgrade statusNetbird version: 0.72.4 Did this work before?Not sure Regression detailsNo response SummaryQuotes are not supported for the NB_MANAGEMENT_URL environment variable. Examples of it in use can be found here: https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables Current behaviorIncluding quotes (forcing docker to interpret the section as a string), set the Example: will yield the following error: Expected behaviorNetbird should not recognize the quotes as part of the URL, as they are used to force docker to recognize that section as a string and not interpret it. Steps to reproduceUsing the docker compose client, add your custom management URL using quotes with any format of url contained within the quotes. This will trigger an error that it is an invalid URI, as it interprets the quotes literally. Environment and topologyOfficial Netbird docker compose Self-hosted details, if availableNo response Logs, status output, or debug evidencenetbird-client | 2026-06-14T00:01:22.411Z INFO client/internal/profilemanager/config.go:259: new Management URL provided, updated to "\"https://netbird.example.domain:443\"" (old value "https://api.netbird.io:443")
netbird-client | 2026-06-14T00:01:22.411Z ERRO client/internal/profilemanager/config.go:622: failed parsing Management URL URL "https://netbird.example.domain:443": [parse "\"https://netbird.example.domain:443\"": invalid URI for request]
netbird-client | 2026-06-14T00:01:22.412Z ERRO client/server/server.go:407: failed to update profile config: parse "\"https://netbird.example.domain:443\"": invalid URI for request
netbird-client | Error: call service setConfig method: rpc error: code = Unknown desc = failed to update profile config: parse "\"https://netbird.example.domain:443\"": invalid URI for requestRelated issues or discussionsNo response ImpactCaused immense frustration as a sysad debugging for over an hour after having set up the netbird server Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
This is a Docker Compose / shell quirk, not really a netbird config bug. When you write in environment:
NB_MANAGEMENT_URL: "https://netbird.example.domain:443"Docker Compose passes the literal string // client/internal/profilemanager/config.go
input.ManagementURL = os.Getenv("NB_MANAGEMENT_URL")
// ...
URL, err := parseURL("Management URL", input.ManagementURL) // url.ParseRequestURI
The Docker docs section you linked (
So the fix in your environment:
NB_MANAGEMENT_URL: https://netbird.example.domain:443Or use the interpolation form (which also resolves environment:
NB_MANAGEMENT_URL: ${NB_MANAGEMENT_URL}If you specifically want to harden netbird against this user error, the cleanest fix in Happy to send a small PR with the trim if the maintainers agree with the defensive fix. |
Beta Was this translation helpful? Give feedback.
-
|
Just a small clarification for anyone who finds this later 🙂 The quotes don't actually leak in the mapping form you showed — there the quotes are just YAML delimiters, so Compose strips them before the value reaches the container: environment:
NB_MANAGEMENT_URL: "https://netbird.example.domain:443"
# container sees: https://netbird.example.domain:443 (no quotes)I checked with The one Compose spot where quotes do stick is the list form, because the whole environment:
- NB_MANAGEMENT_URL="https://netbird.example.domain:443"
# container sees: "https://netbird.example.domain:443" (quotes kept)So in Compose:
Either way, the defensive |
Beta Was this translation helpful? Give feedback.
This is a Docker Compose / shell quirk, not really a netbird config bug. When you write in
docker-compose.yml:Docker Compose passes the literal string
"https://netbird.example.domain:443"(with the quote characters preserved as part of the value) into the container's environment. netbird then does:url.ParseRequestURIrejects the value because"https://...:443"(literal quote + URL + literal quote) isn't a valid URI — that's exactly…