{"record":{"id":"3b69bb5ed949a9fb","repo":"SigNoz/signoz","slug":"codelicenseunavailable-3b69bb","errorCode":"CodeLicenseUnavailable","errorMessage":"a valid license is not available","messagePattern":"a valid license is not available","errorType":"error_code","errorClass":"errors.Error","httpStatus":null,"severity":"error","filePath":"ee/authz/openfgaauthz/provider.go","lineNumber":181,"sourceCode":"\treturn provider.pkgAuthzService.CreateManagedRoles(ctx, orgID, managedRoles)\n}\n\nfunc (provider *provider) CreateManagedUserRoleTransactions(ctx context.Context, orgID valuer.UUID, userID valuer.UUID) error {\n\ttuples := make([]*openfgav1.TupleKey, 0)\n\n\tgrantTuples := provider.getManagedRoleGrantTuples(orgID, userID)\n\ttuples = append(tuples, grantTuples...)\n\n\tmanagedRoleTuples := provider.getManagedRoleTransactionTuples(orgID)\n\ttuples = append(tuples, managedRoleTuples...)\n\n\treturn provider.Write(ctx, tuples, nil)\n}\n\nfunc (provider *provider) Create(ctx context.Context, orgID valuer.UUID, role *authtypes.Role) error {\n\t_, err := provider.licensing.GetActive(ctx, orgID)\n\tif err != nil {\n\t\treturn errors.New(errors.TypeLicenseUnavailable, errors.CodeLicenseUnavailable, \"a valid license is not available\").WithAdditional(\"this feature requires a valid license\").WithAdditional(err.Error())\n\t}\n\n\texistingRole, err := provider.GetByOrgIDAndName(ctx, orgID, role.Name)\n\tif err != nil && !errors.Asc(err, authtypes.ErrCodeRoleNotFound) {\n\t\treturn err\n\t}\n\n\tif existingRole != nil {\n\t\treturn errors.Newf(errors.TypeAlreadyExists, authtypes.ErrCodeRoleAlreadyExists, \"role with name: %s already exists\", existingRole.Name)\n\t}\n\n\ttuples, err := authtypes.NewTuplesFromTransactionGroups(role.Name, orgID, role.TransactionGroups)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = provider.Write(ctx, tuples, nil)\n\tif err != nil {","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/ee/authz/openfgaauthz/provider.go#L163-L199","documentation":"parseMetricsDuration accepts either a float interpreted as seconds or a Prometheus-style duration string (prommodel.ParseDuration: '5m', '1h30m', '1d'); if both fail it returns 'cannot parse %q to a valid duration'. Used for step and similar parameters of the metrics query APIs.","triggerScenarios":"Calling queryRangeMetrics/queryMetrics with a step value like '60s ' (trailing space), '1 hr' (space inside), ISO durations ('PT1H'), or a non-numeric string such as 'hour' — none parse as float or Prometheus duration.","commonSituations":"Copy-pasting ISO-8601 durations from other systems; frontend formatting bugs inserting spaces or unicode; assuming Go's time.ParseDuration syntax ('1h30m') where only Prometheus units (no 'us', different day handling) are supported.","solutions":["Use Prometheus duration syntax: '10s', '5m', '1h', '1d' or combinations like '1h30m'","Or send a plain number meaning seconds ('60')","Sanitize whitespace and validate with a regex like ^[0-9]+(ms|s|m|h|d)$ or ^[0-9.]+$ client-side"],"exampleFix":"# before\ncurl '.../api/v1/query_range?step=PT5M'\n\n# after\ncurl '.../api/v1/query_range?step=5m'","handlingStrategy":"validation","validationCode":"var stepRe = regexp.MustCompile(`^([0-9]+(\\.[0-9]+)?|([0-9]+(ms|s|m|h|d))+)$`)\nif !stepRe.MatchString(stepParam) { /* reject before request */ }","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Use Prometheus duration syntax, not ISO-8601 or Go duration","Trim whitespace client-side","Send plain seconds for fixed steps"],"tags":["signoz","metrics","api-params","duration","parser","prometheus"],"backgroundTag":"invalid-duration-format","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}