{"record":{"id":"c11300e8c30886ea","repo":"hcengineering/platform","slug":"process-error-objectnotfound-c11300","errorCode":"process.error.ObjectNotFound","errorMessage":"Object not found: {_id}","messagePattern":"Object not found: (.+?)","errorType":"exception","errorClass":"ProcessError","httpStatus":null,"severity":"error","filePath":"server-plugins/process-resources/src/utils.ts","lineNumber":81,"sourceCode":"      value[key] = await getContextValue(value[key], control, execution)\n    }\n    return value\n  } else {\n    return value\n  }\n}\n\nexport function resolveAttributeId<T extends string> (_process: Process, key: T): T {\n  if (_process.bindings?.[key] !== undefined) {\n    return _process.bindings[key] as T\n  }\n  return key\n}\n\nfunction getValue (control: ProcessControl, execution: Execution, rawKey: string, card: Doc): any {\n  const hierarchy = control.client.getHierarchy()\n  const _process = control.client.getModel().findObject(execution.process)\n  if (_process === undefined) throw processError(process.error.ObjectNotFound, { _id: execution.process })\n  const realKey = resolveAttributeId(_process, rawKey)\n  const key = checkMixinKey(realKey, _process.masterTag, hierarchy)\n  return getObjectValue(key, card)\n}\n\nfunction getConstValue (control: ProcessControl, execution: Execution, context: SelectedConst): any {\n  return context.value\n}\n\nfunction getAttributeValue (control: ProcessControl, execution: Execution, context: SelectedContext): any {\n  const card = control.cache.get(execution.card)\n  if (card !== undefined) {\n    const val = getValue(control, execution, context.key, card)\n    if (val == null) {\n      const attr = control.client.getHierarchy().findAttribute(card._class, context.key)\n      throw processError(\n        process.error.EmptyAttributeContextValue,\n        {},","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/server-plugins/process-resources/src/utils.ts#L63-L99","documentation":"Thrown by getValue in server-plugins/process-resources when the process document referenced by execution.process cannot be found via control.client.getModel().findObject(). The process execution context points to a process object that no longer exists (or the model hasn't loaded it), so attribute resolution cannot proceed.","triggerScenarios":"Calling getContextValue/getAttributeValue/getValue for a control value where execution.process contains an _id that findObject on the model cannot resolve: the process object was deleted, the _id is stale/corrupted, or the model was not fully loaded/updated in this client.","commonSituations":"A process was deleted or migrated while executions referencing it still exist; working against a workspace snapshot/backup where process objects were purged; a frontend or automation passing an invalid process id into the process-resources plugin; model synchronization lag after upgrades.","solutions":["Verify execution.process points to an existing process object (query the model directly with the _id).","Restore or recreate the missing process object, or delete/cancel the orphaned execution.","Reload/refresh the client model to rule out incomplete model loading.","Check for migrations or workspace cleanup that removed process objects referenced by live executions."],"exampleFix":"// before: stale execution\nconst exec = { process: 'deleted-process-id', card: cardId }\nconst val = await getValue(control, exec, 'Status', card)\n// after: validate process exists first\nconst proc = control.client.getModel().findObject(exec.process)\nif (proc === undefined) throw new Error('Process missing: ' + exec.process)\nconst val = await getValue(control, exec, 'Status', card)","handlingStrategy":"validation","validationCode":"const proc = control.client.getModel().findObject(execution.process)\nif (proc === undefined) throw new Error('Process not found: ' + execution.process)","typeGuard":"function processExists(control: ProcessControl, id: Ref<Doc>): boolean {\n  return control.client.getModel().findObject(id) !== undefined\n}","tryCatchPattern":"try {\n  const value = getValue(control, execution, key, card)\n} catch (err) {\n  if ((err as Error).message.includes('Object not found')) {\n    // repair or cancel orphaned execution\n  } else throw err\n}","preventionTips":["Validate execution.process exists in the model before starting an execution","Avoid deleting process objects that have live executions","Reload the client model after migrations/plugin upgrades","Log and alert on executions referencing missing processes"],"tags":["process","object-lookup","data-integrity"],"backgroundTag":"object-not-found","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}