hashicorp/nomad · error

launch lookup failed: %v

Error message

launch lookup failed: %v

What it means

Returned by StateStore.DeletePeriodicLaunchTxn when txn.First on the 'periodic_launch' table fails with an internal error while looking up the launch by (namespace, jobID). This is not 'not found' — that is a separate error — it means the memdb lookup itself errored (e.g. schema/index mismatch).

Source

Thrown at nomad/state/state_store.go:3388

// DeletePeriodicLaunch is used to delete the periodic launch
func (s *StateStore) DeletePeriodicLaunch(index uint64, namespace, jobID string) error {
	txn := s.db.WriteTxn(index)
	defer txn.Abort()

	err := s.DeletePeriodicLaunchTxn(index, namespace, jobID, txn)
	if err == nil {
		return txn.Commit()
	}
	return err
}

// DeletePeriodicLaunchTxn is used to delete the periodic launch, like DeletePeriodicLaunch
// but in a transaction.  Useful for when making multiple modifications atomically
func (s *StateStore) DeletePeriodicLaunchTxn(index uint64, namespace, jobID string, txn Txn) error {
	// Lookup the launch
	existing, err := txn.First("periodic_launch", "id", namespace, jobID)
	if err != nil {
		return fmt.Errorf("launch lookup failed: %v", err)
	}
	if existing == nil {
		return fmt.Errorf("launch not found")
	}

	// Delete the launch
	if err := txn.Delete("periodic_launch", existing); err != nil {
		return fmt.Errorf("launch delete failed: %v", err)
	}
	if err := txn.Insert("index", &IndexEntry{"periodic_launch", index}); err != nil {
		return fmt.Errorf("index update failed: %v", err)
	}

	return nil
}

// PeriodicLaunchByID is used to lookup a periodic launch by the periodic job
// ID.

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Inspect the wrapped inner error in the message for the memdb cause
  2. Verify the nomad binary version matches the state schema version (upgrade mismatch) and restart agents on the same version
  3. If persistent, restart the server to rebuild in-memory state from the raft/snapshot
  4. Report to nomad with the inner error if it recurs on a healthy cluster
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify the launch exists before deleting
launch, err := state.PeriodicLaunchByID(ws, ns, jobID)
if err != nil { return err }
if launch == nil { return nil // nothing to delete }

Type guard

if l, ok := raw.(*structs.PeriodicLaunch); ok { /* use l */ }

Try / catch

if err := state.DeletePeriodicLaunch(idx, ns, jobID); err != nil {
	if strings.Contains(err.Error(), "launch lookup failed") {
		// memdb read error: log inner cause, do not treat as missing
	}
	return err
}

Prevention

When it happens

Trigger: Calling DeletePeriodicLaunch or DeletePeriodicLaunchTxn for a job when the underlying memdb read of table 'periodic_launch' via the 'id' index returns an error instead of nil/row.

Common situations: State store schema/index mismatch after a version upgrade; corrupted in-memory DB; tests constructing a txn with the wrong table definitions.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/cad44fc178a22f64. Report an issue: GitHub.