SigNoz/signoz · error · model.ApiError

failed to update deploy status

Error message

failed to update deploy status

What it means

The agentConf updateDeployStatus gorm Exec (update filtered by version, element_type, org_id) returned an error; the DB failure is logged and surfaced as a BadRequest 'failed to update deploy status'. Triggered on the deployment path of agent config operations.

Source

Thrown at pkg/query-service/agentConf/db.go:226

	// check if it has org orgID prefix
	// ensuring it here and also ensuring in coordinator.go
	if !strings.HasPrefix(lastHash, orgId.String()) {
		lastHash = orgId.String() + lastHash
	}

	_, err := r.store.BunDB().NewUpdate().
		Model(new(opamptypes.AgentConfigVersion)).
		Set("deploy_status = ?", status).
		Set("deploy_result = ?", result).
		Set("hash = COALESCE(?, hash)", lastHash).
		Set("config = ?", lastconf).
		Where("version = ?", version).
		Where("element_type = ?", elementType).
		Where("org_id = ?", orgId).
		Exec(ctx)
	if err != nil {
		slog.ErrorContext(ctx, "failed to update deploy status", errors.Attr(err))
		return model.BadRequest(fmt.Errorf("failed to update deploy status"))
	}

	return nil
}

// GetDeployStatusByHash returns the DeployStatus for the given config hash
// (stored with orgId prefix). Returns DeployStatusUnknown when no matching row exists.
func (r *Repo) GetDeployStatusByHash(ctx context.Context, orgId valuer.UUID, configHash string) (opamptypes.DeployStatus, error) {
	var version opamptypes.AgentConfigVersion
	err := r.store.BunDB().NewSelect().
		Model(&version).
		ColumnExpr("deploy_status").
		Where("hash = ?", configHash).
		Where("org_id = ?", orgId).
		Scan(ctx)
	if err != nil {
		if errors.Is(err, sql.ErrNoRows) {
			return opamptypes.DeployStatusUnknown, nil

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Check query-service logs for the logged underlying error (errors.Attr)
  2. Verify DB connectivity and agent-conf migrations
  3. Retry the deploy operation once the DB is healthy
  4. Avoid concurrent config deploys for the same org/version
Defensive patterns

Strategy: retry

Try / catch

Retry the deploy operation with backoff for transient DB errors; surface the logged underlying error when persisting.

Prevention

When it happens

Trigger: RecommendAgentConfig, Redeploy, UpsertFilterProcessor, or UpsertSamplingProcessor reaching the status update when the DB is unavailable, the row is locked, or the schema is missing.

Common situations: DB outages, pending migrations for the agent config tables, lock contention with concurrent deploys, or an org/version combination that violates constraints.

Related errors


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