SigNoz/signoz · error · errors.base

span_attribute_mapping_invalid_input

span_attribute_mapping_invalid_input

Error message

group id is not a valid uuid

What it means

groupIDFromPath helper rejects the {groupId} path variable because valuer.NewUUID could not parse it. Raised by all mapper group endpoints (update/delete group, list/create/update/delete mapper).

Source

Thrown at pkg/modules/spanmapper/implspanmapper/handler.go:311

	}

	groups := spantypes.NewSpanMapperGroupsWithMappersFromPostable(orgID, req.Groups)
	out, collectorLogs, err := h.module.TestMappers(ctx, orgID, req.Spans, groups)
	if err != nil {
		render.Error(rw, err)
		return
	}

	render.Success(rw, http.StatusOK, &spantypes.GettableSpanMapperTest{Spans: out, CollectorLogs: collectorLogs})
}

// groupIDFromPath extracts and validates the {id} or {groupId} path variable.
func groupIDFromPath(r *http.Request) (valuer.UUID, error) {
	vars := mux.Vars(r)
	raw := vars["groupId"]
	id, err := valuer.NewUUID(raw)
	if err != nil {
		return valuer.UUID{}, errors.Wrapf(err, errors.TypeInvalidInput, spantypes.ErrCodeMappingInvalidInput, "group id is not a valid uuid")
	}
	return id, nil
}

// mapperIDFromPath extracts and validates the {mapperId} path variable.
func mapperIDFromPath(r *http.Request) (valuer.UUID, error) {
	raw := mux.Vars(r)["mapperId"]
	id, err := valuer.NewUUID(raw)
	if err != nil {
		return valuer.UUID{}, errors.Wrapf(err, errors.TypeInvalidInput, spantypes.ErrCodeMappingInvalidInput, "mapper id is not a valid uuid")
	}
	return id, nil
}

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Create the group first and use its returned uuid
  2. List groups to resolve name → groupId
  3. Client-side UUID validation on all mapper route ids

Example fix

// before
POST /api/v1/groups/my-group/mappers
// after
POST /api/v1/groups/123e4567-e89b-12d3-a456-426614174000/mappers
Defensive patterns

Strategy: validation

Validate before calling

const group = await api.createGroup(payload); // or listGroups()
assertUUID(group.uuid);
await api.createMapper(group.uuid, mapper);

Type guard

const isUUID = (s: unknown): s is string => typeof s === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(s);

Prevention

When it happens

Trigger: Any span-attribute-mapper route carrying a non-UUID {groupId}, e.g. PUT /groups/default or POST /groups/abc/mappers.

Common situations: Calling mapper endpoints before creating the group (using a placeholder id), or using a group name instead of the returned groupId.

Related errors


AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28). Data as JSON: /api/errors/80556bda2b76e222. Report an issue: GitHub.