SigNoz/signoz · warning · model.ApiError

invalid org id: %w

Error message

invalid org id: %w

What it means

Bad Request error returned by Manager.InstallIntegration when the orgId string cannot be parsed as a UUID by valuer.NewUUID. This guards against malformed tenant identifiers before the transactional install.

Source

Thrown at pkg/query-service/app/integrations/manager.go:250

	return integrationDetails.ConnectionTests, nil
}

func (m *Manager) InstallIntegration(
	ctx context.Context,
	orgId string,
	integrationId string,
	config cloudintegrationtypes.InstalledIntegrationConfig,
	createdBy string,
	creator valuer.UUID,
) (*IntegrationsListItem, *model.ApiError) {
	integrationDetails, apiErr := m.getIntegrationDetails(ctx, integrationId)
	if apiErr != nil {
		return nil, apiErr
	}

	orgUUID, err := valuer.NewUUID(orgId)
	if err != nil {
		return nil, model.BadRequest(fmt.Errorf("invalid org id: %w", err))
	}

	err = m.installedIntegrationsRepo.runInTx(ctx, func(ctx context.Context) error {
		_, apiErr = m.installedIntegrationsRepo.upsert(ctx, orgId, integrationId, config)
		if apiErr != nil {
			return model.WrapApiError(apiErr, "could not insert installed integration")
		}

		return m.provisionDashboards(ctx, orgUUID, createdBy, creator, integrationId, integrationDetails)
	})
	if err != nil {
		return nil, model.WrapApiError(model.InternalError(err), "could not install integration")
	}

	return &IntegrationsListItem{
		IntegrationSummary: integrationDetails.IntegrationSummary,
		IsInstalled:        true,
	}, nil

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Verify the orgId passed to Install comes from authenticated context and is a valid UUID
  2. Check middleware/tenant resolution configuration
  3. Log the offending orgId at the call site for diagnosis

Example fix

// before
apiErr := mgr.InstallIntegration(ctx, "org-1", integrationId, config)

// after
import "github.com/google/uuid"
apiErr := mgr.InstallIntegration(ctx, uuid.NewString(), integrationId, config)
Defensive patterns

Strategy: validation

Validate before calling

if _, err := uuid.Parse(orgId); err != nil { return errors.New("invalid org id") }

Type guard

func isUUID(s string) bool { _, err := uuid.Parse(s); return err == nil }

Prevention

When it happens

Trigger: Calling InstallIntegration with an orgId that is not a valid UUID format (wrong length, non-hex characters, empty).

Common situations: Misconfigured auth/middleware forwarding a malformed org header, test code using placeholder org IDs, or multi-tenancy config mistakes.

Related errors


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