{"record":{"id":"e7d3a41afbd1d091","repo":"netbirdio/netbird","slug":"parse-service-environment-variables-w","errorCode":null,"errorMessage":"parse service environment variables: %w","messagePattern":"parse service environment variables: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/service.go","lineNumber":94,"sourceCode":"\nfunc newProgram(ctx context.Context, cancel context.CancelFunc) *program {\n\tctx = internal.CtxInitState(ctx)\n\treturn &program{ctx: ctx, cancel: cancel}\n}\n\nfunc newSVCConfig() (*service.Config, error) {\n\tconfig := &service.Config{\n\t\tName:        serviceName,\n\t\tDisplayName: \"Netbird\",\n\t\tDescription: \"NetBird mesh network client\",\n\t\tOption:      make(service.KeyValue),\n\t\tEnvVars:     make(map[string]string),\n\t}\n\n\tif len(serviceEnvVars) > 0 {\n\t\textraEnvs, err := parseServiceEnvVars(serviceEnvVars)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"parse service environment variables: %w\", err)\n\t\t}\n\t\tconfig.EnvVars = extraEnvs\n\t}\n\n\tif runtime.GOOS == \"linux\" {\n\t\tconfig.EnvVars[\"SYSTEMD_UNIT\"] = serviceName\n\t}\n\n\treturn config, nil\n}\n\nfunc newSVC(prg *program, conf *service.Config) (service.Service, error) {\n\treturn service.New(prg, conf)\n}\n\nfunc parseServiceEnvVars(envVars []string) (map[string]string, error) {\n\tenvMap := make(map[string]string)\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/service.go#L76-L112","documentation":"Error \"parse service environment variables: %w\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/cmd/service.go:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}