risingwavelabs/risingwave · error
database {database_id} does not exist while handling command
Error message
database {database_id} does not exist while handling command {command:?} What it means
While handling a command that needs a database's inflight graph info, the controller cannot find the database in its checkpoint state. The start of the affected job is failed via notify_start_failed because there is no database graph to apply the command to.
Source
Thrown at src/meta/src/barrier/checkpoint/control.rs:346
| Command::SourceChangeSplit(_)
| Command::Throttle { .. }
| Command::CreateSubscription { .. }
| Command::AlterSubscriptionRetention { .. }
| Command::ConnectorPropsChange(_)
| Command::Refresh { .. }
| Command::ListFinish { .. }
| Command::LoadFinish { .. }
| Command::ResetSource { .. }
| Command::ResumeBackfill { .. }
| Command::InjectSourceOffsets { .. } => {
if cfg!(debug_assertions) {
panic!(
"new database graph info can only be created for normal creating streaming job, but get command: {} {:?}",
database_id, command
)
} else {
warn!(%database_id, ?command, "database does not exist while handling the command");
notifier.notify_start_failed(anyhow!("database {database_id} does not exist while handling command {command:?}").into());
return Ok(());
}
}
},
};
database.handle_new_barrier(
Some((command, notifier)),
checkpoint,
span,
partial_graph_manager,
&self.hummock_version_stats,
worker_nodes,
)
} else {
let database = match self.databases.entry(database_id) {
Entry::Occupied(entry) => entry.into_mut(),
Entry::Vacant(_) => {View on GitHub (pinned to 6469eb736d)
Solutions
- Check whether the database was dropped concurrently; re-create it and re-issue the job.
- Retry the CREATE statement after confirming the database exists.
- Avoid issuing DROP DATABASE while creation jobs are in-flight in that database.
Example fix
-- before: racing drop DROP DATABASE db1; -- after: wait for pending creations SHOW JOBS IN DATABASE db1; -- ensure none creating DROP DATABASE db1;
Defensive patterns
Strategy: validation
Validate before calling
-- ensure db exists and has no dropping race before creating jobs SELECT 1 FROM rw_databases WHERE database_id = <id>;
Prevention
- Don't DROP DATABASE while creation jobs are in-flight in it.
- Check SHOW JOBS IN DATABASE before issuing DDL there.
- Retry failed CREATEs after confirming the database exists.
When it happens
Trigger: A create/reschedule command references database_id that has been dropped (or never registered) by the time handle_new_barrier processes it — e.g. DROP DATABASE raced with a pending CREATE job in that database.
Common situations: Dropping a database while streaming jobs are still being created in it; concurrent DDL racing barrier scheduling; stale command queued after database deletion.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- database of cross db upstream table {} not found
- unexpected job_type {job_type:?} for first job {} in databas
- database {} unavailable {}
- failed to cancel streaming job {id}
- Exchange executor should not have children!
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/1fb1aebf584a23c8.
Report an issue: GitHub.