> For the complete documentation index, see [llms.txt](https://docs.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.collibra.com/data-quality-self-hosted/installation/upgrade-data-quality-observability-self-hosted/roll-back-data-quality-observability-self-hosted/roll-back-a-data-quality-observability-self-hosted-deployment-on-google-cloud-dataproc.md).

# Roll back a Data Quality & Observability (self-hosted) deployment on Google Cloud Dataproc

In a Google Cloud Dataproc deployment, `dq-webapp` runs on a persistent GCE instance, `dq-agent` is installed on the Dataproc master node via an initialization action, and `dq-core` runs as a Spark YARN job. The Metastore is a Cloud SQL for PostgreSQL instance. Use this procedure to restore the previous version after an unsuccessful upgrade.

The preferred rollback method is an in-place JAR swap on the master node. Cluster deletion is not required and should be avoided.

{% hint style="info" %}
Before you start, confirm you completed the [Roll back Data Quality & Observability (self-hosted)](/data-quality-self-hosted/installation/upgrade-data-quality-observability-self-hosted/roll-back-data-quality-observability-self-hosted.md#pre-upgrade-checklist) before upgrading.
{% endhint %}

## Prerequisites

* SSH access to the Dataproc master node (via Cloud Shell or `gcloud compute ssh`).
* The previous version JARs available in GCS.
* The Metastore snapshot from before the upgrade (required if schema migrations ran).

## In-place rollback (preferred)

{% stepper %}
{% step %}
SSH to the Dataproc master node.

```
gcloud compute ssh <cluster-name>-m --zone <zone>
```

{% endstep %}

{% step %}
Stop the agent.

```
$OWL_BASE/owl/bin/owlmanage.sh stop=owlagent
```

{% endstep %}

{% step %}
Restore the previous JARs from GCS.

```
cd $OWL_BASE/owl/bin
 
mv dq-agent-<new-version>.jar                      dq-agent-<new-version>.jar.bad
mv dq-core-<new-version>-with-dependencies.jar     dq-core-<new-version>-with-dependencies.jar.bad
 
gsutil cp gs://<OWL_PACKAGE_LOCATION>/dq-agent-<old-version>.jar .
gsutil cp gs://<OWL_PACKAGE_LOCATION>/dq-core-<old-version>-with-dependencies.jar .
```

{% endstep %}

{% step %}
Restore the Metastore if schema migrations ran during the upgrade.

{% hint style="info" %}
Skip this step if the upgrade was a patch release with no schema migrations.
{% endhint %}

```
gcloud sql backups restore <backup-id> \
  --restore-instance=<instance-name> \
  --project=<project-id>
```

Alternatively, use `pg_restore` with a Cloud SQL Auth Proxy connection:

```
pg_restore -h 127.0.0.1 -U <METASTORE_USER> -d owldb owldb_backup_<timestamp>.dump
```

{% endstep %}

{% step %}
Restart the agent.

```
$OWL_BASE/owl/bin/owlmanage.sh start=owlagent
```

{% endstep %}

{% step %}
Roll back `dq-webapp` on the persistent GCE instance if it was upgraded separately.

Follow [Roll back a Spark standalone Data Quality & Observability (self-hosted) deployment](/data-quality-self-hosted/installation/upgrade-data-quality-observability-self-hosted/roll-back-data-quality-observability-self-hosted/roll-back-a-spark-standalone-data-quality-observability-self-hosted-deployment.md#steps) for the webapp instance.
{% endstep %}

{% step %}
Verify the rollback was successful.

```
tail -f $OWL_BASE/owl/log/owl-agent.log
 
psql -h 127.0.0.1 -U <METASTORE_USER> -d owldb \
  -c "SELECT agent_name, status, updt_ts FROM agent ORDER BY updt_ts DESC LIMIT 5;"
```

Confirm all items in the [Roll back a Data Quality & Observability (self-hosted) deployment on Google Cloud Dataproc](#verification-checklist).
{% endstep %}
{% endstepper %}

## Cluster recreation (fallback only)

Use this path only if the master node is lost or the cluster must be rebuilt. Update the initialization action URI to reference the previous version package before creating a new cluster.

{% stepper %}
{% step %}
Copy the previous version initialization action to GCS if it is not already there.

```
gsutil cp gs://<OWL_PACKAGE_LOCATION>/install-agent-dataproc-<old-version>.sh \
  gs://<OWL_PACKAGE_LOCATION>/install-agent-dataproc-rollback.sh
```

{% endstep %}

{% step %}
Delete the existing cluster.

```
gcloud dataproc clusters delete <cluster-name> --region <region>
```

{% endstep %}

{% step %}
Create a new cluster with the previous version initialization action.

```
gcloud dataproc clusters create <cluster-name> \
  --region <region> \
  --initialization-actions gs://<OWL_PACKAGE_LOCATION>/install-agent-dataproc-rollback.sh \
  --metadata "OWL_AGENT_ID=<OWL_AGENT_ID>,METASTORE_HOST=<METASTORE_HOST>,METASTORE_USER=<METASTORE_USER>,METASTORE_PASS=<METASTORE_PASS>,OWL_PACKAGE_LOCATION=<OWL_PACKAGE_LOCATION>,LICENSE_KEY=<LICENSE_KEY>" \
  ...
```

{% endstep %}
{% endstepper %}

## Rollback verification checklist

After the rollback, confirm the following before declaring success:

* `dq-webapp` health endpoint returns HTTP 200.
* `dq-webapp` logs show no Flyway version mismatch errors.
* `dq-agent` log shows a successful connection to the Metastore.
* The agent appears as `ACTIVE` in the `agent` table in the Metastore.
* A test job submits successfully and reaches `FINISHED` status in `agent_q`.
* The scheduler picks up and runs a scheduled job (check the `job_schedule_attempt` table).
* The UI loads and displays historical findings correctly.
