Incident Library

IL-0576 CareNet · 2025-10-07 (published)databasegcp

Every dataset in CareNet's production BigQuery data warehouse was deleted, and UNDROP SCHEMA could not restore them

CareNet uses BigQuery as its production data warehouse for analysis, shared by several departments in one Google Cloud project. Test code from the AI technology development team, meant to initialise test-environment data, ran against production because of a configuration mistake, using the team's service account, which held more permissions than it needed. The code deleted each production dataset and created a new one with the same name.

UNDROP SCHEMA failed because a dataset with the same name already existed again. At 13:06 the AI technology development team found that running bq cp in Cloud Shell could restore individual tables through BigQuery time travel, which can return a table to its state at a point within the past 7 days, and that this worked even after the same-name dataset had been recreated. The teams restored the tables one at a time to a point before the incident, which required knowing the name of every table, and by 16:00 most tables were back without losing most of the data. bq cp cannot restore views or table functions, so these were recreated from the creation queries kept in BigQuery saved queries. The AI technology development team then held a postmortem and shared the causes and the prevention measures with the other departments.

Severity
–
Scope
All datasets of the production BigQuery data warehouse used for data analysis by several departments; it is not connected to user-facing services
Users affected
–
Region
–
Time to detect
–
Time to resolve
–

Symptoms

On a day in August 2025, at 10:41, CareNet's system development division posted a first report on Slack that a failure was occurring in BigQuery, the production data warehouse. At 11:47 the division's investigation found that the production datasets had been deleted by a service account belonging to the AI technology development team.

The data warehouse is used for data analysis and is not connected to user-facing services; several departments share a single Google Cloud project to collect their data in it. At 11:00 the AI technology development team talked about the failure in a meeting but did not suspect its own team and only watched.

At 12:44 the system development division reported that an UNDROP SCHEMA query, the BigQuery feature for restoring a deleted dataset, did not work. The deleting process had created a new dataset with the same name right after deleting each one, and BigQuery appeared to treat the dataset to be restored as not existing.

Symptom Data loss

Root cause

Root cause Operator error

Component Database
Trigger
Test code that was being modified contained a step that resets test data by deleting a dataset and recreating it with the same name. Because of a configuration mistake, the step ran against production and deleted and recreated every production dataset.

Detection

The system development division posted the first report of a BigQuery failure on Slack at 10:41, and its investigation found at 11:47 that the AI technology development team's service account had deleted the production datasets.

Remediation

Action items

Lessons

BigQuery time travel with bq cp recovered most of the data, but only because the table names were known, and it does not bring back views or table functions. Test code should not be able to reach production, and service accounts should not hold more permissions than they need.

Sources

Related cases

Check your cluster for this

kubegap audits a Kubernetes cluster for conditions like the ones in this case, Database among them, read-only, from Claude Code or Codex. Its checks cite public reports like this one.

For AI tools and scripts

The API needs no key. The MCP server offers search_incidents, get_incident, list_incidents, get_topic and vocab; both are explained on API and MCP.