cube-js/cube · error
no dbt sync {sync_job_id} on deployment {deployment} (it may
Error message
no dbt sync {sync_job_id} on deployment {deployment} (it may not be visible yet, belong to another deployment, or have aged out) What it means
Raised by `cube dbt status <deployment> <sync_job_id>` (without --wait) when the status endpoint returns 404/None for the job. The CLI cannot find that sync job on the given deployment — it may not be registered yet, may belong to another deployment, or may have aged out of retention.
Source
Thrown at rust/cube-cli/src/commands/dbt.rs:449
util::one_line(&output::field(&status, "error"), util::REASON_LIMIT);
bail!(
"dbt sync {sync_job_id} failed: {}",
if util::is_blank(&error) {
"(no reason reported)".to_string()
} else {
error
}
);
}
return Ok(());
}
let query: Query = Vec::new();
let path = format!("{}/{sync_job_id}", base(deployment));
match api.get_optional(&path, &query).await? {
Some(status) => print_status(ctx.json, &status),
None => bail!(
"no dbt sync {sync_job_id} on deployment {deployment} \
(it may not be visible yet, belong to another deployment, or have aged out)"
),
}
}
Cmd::Result {
deployment,
sync_job_id,
} => {
let path = format!("{}/{sync_job_id}/result", base(deployment));
match available_result(api.get_optional(&path, &Vec::new()).await?) {
Some(result) => print_result(ctx.json, &result),
// A running sync, `200 null`, and `{}` all mean "not available yet".
None => bail!(
"no result for dbt sync {sync_job_id} yet — check \
`cube dbt status {deployment} {}`",
util::shell_quote(&sync_job_id)
),View on GitHub (pinned to 7d981676b3)
Solutions
- If the sync was started moments ago, wait a beat and retry the status command.
- Re-check the sync_job_id against the output of the sync command that created it.
- Confirm the deployment argument matches the deployment that owns the sync.
- If the job is old, assume it aged out and start a new sync.
Example fix
// before: status immediately after start
let started = api.post(&base, Some(&body)).await?;
let status = api.get_optional(&format!("{base}/{id}"), &query).await?; // may 404
// after: retry with backoff before concluding the job is missing
let status = wait::poll(Wait::new("dbt sync", timeout, interval), || async {
match api.get_optional(&path, &query).await? {
Some(s) => Ok(Progress::Done(s)),
None => Ok(Progress::Waiting("not visible yet".into())),
}
}).await?; Defensive patterns
Strategy: retry
Validate before calling
// Verify job visibility once before treating absence as fatal
if api.get_optional(&format!("{base}/{id}"), &query).await?.is_none() {
eprintln!("sync {id} not visible yet; will retry");
} Try / catch
match result {
Err(e) if e.to_string().contains("no dbt sync") => {
tokio::time::sleep(grace).await; // short retry in case registration lagged
}
other => other?,
} Prevention
- Insert a brief delay/retry between starting a sync and first reading its status.
- Pass the deployment explicitly and validate it in scripts.
- Copy syncJobId values programmatically from command output, not by hand.
- Assume retention purges old jobs; never index long-term state by sync_job_id.
When it happens
Trigger: A single GET of /deployments/<deployment>/.../<sync_job_id> returns None: querying immediately after POST /sync before the job is visible, wrong deployment number, wrong/typo'd job ID, or a job past retention.
Common situations: Scripting that reads the sync status a split second after starting the sync; copying a syncJobId from logs of a different environment; checking a sync from days ago that the backend purged.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- no dbt sync {sync_job_id} on deployment {deployment}. It may
- dbt sync {sync_job_id} failed: {}
- no result for dbt sync {sync_job_id} yet — check `cube dbt s
- ${pkg} dependency not found. Please run this command from pr
- No app secret found
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/93b979d78b26de20.
Report an issue: GitHub.