{"record":{"id":"06e7decb32dc17f7","repo":"n8n-io/n8n","slug":"property-propertypath-was-not-found-in-met-06e7de","errorCode":null,"errorMessage":"Property \"${propertyPath}\" was not found in \"${metadata.targetName}\". Make sure your query is correct.","messagePattern":"Property \"(.+?)\" was not found in \"(.+?)\"\\. Make sure your query is correct\\.","errorType":"exception","errorClass":"EntityPropertyNotFoundError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/typeorm/src/query-builder/UpdateQueryBuilder.ts","lineNumber":437,"sourceCode":"\n\t\t// it doesn't make sense to update undefined properties, so just skip them\n\t\tconst valuesSetNormalized: ObjectLiteral = {};\n\t\tfor (let key in valuesSet) {\n\t\t\tif (valuesSet[key] !== undefined) {\n\t\t\t\tvaluesSetNormalized[key] = valuesSet[key];\n\t\t\t}\n\t\t}\n\n\t\t// prepare columns and values to be updated\n\t\tconst updateColumnAndValues: string[] = [];\n\t\tconst updatedColumns: ColumnMetadata[] = [];\n\t\tif (metadata) {\n\t\t\tthis.createPropertyPath(metadata, valuesSetNormalized).forEach((propertyPath) => {\n\t\t\t\t// todo: make this and other query builder to work with properly with tables without metadata\n\t\t\t\tconst columns = metadata.findColumnsWithPropertyPath(propertyPath);\n\n\t\t\t\tif (columns.length <= 0) {\n\t\t\t\t\tthrow new EntityPropertyNotFoundError(propertyPath, metadata);\n\t\t\t\t}\n\n\t\t\t\tcolumns.forEach((column) => {\n\t\t\t\t\tif (!column.isUpdate || updatedColumns.includes(column)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tupdatedColumns.push(column);\n\n\t\t\t\t\t//\n\t\t\t\t\tlet value = column.getEntityValue(valuesSetNormalized);\n\t\t\t\t\tif (\n\t\t\t\t\t\tcolumn.referencedColumn &&\n\t\t\t\t\t\ttypeof value === 'object' &&\n\t\t\t\t\t\t!(value instanceof Date) &&\n\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t!Buffer.isBuffer(value)\n\t\t\t\t\t) {","sourceCodeStart":419,"sourceCodeEnd":455,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/typeorm/src/query-builder/UpdateQueryBuilder.ts#L419-L455","documentation":"Thrown as EntityPropertyNotFoundError from UpdateQueryBuilder during `.set(values)` when createPropertyPath yields a property path for which metadata.findColumnsWithPropertyPath returns an empty array. The update path refuses to write to a field it cannot map to a column.","triggerScenarios":"Calling `repo.createQueryBuilder().update().set({ misSpelled: value })`, or passing a DTO containing a computed field (e.g. fullName) into .set(), or a partial update built from request body keys that are not entity columns.","commonSituations":"Mass-assigning a request body to .set() without a whitelist; column renames leaving stale keys in update DTOs; embedded/nested paths spelled incorrectly.","solutions":["Whitelist update fields against the entity's column names before building the set object.","Use a mapping layer (DTO -> entity partial) that drops non-column keys.","After a rename, update every update DTO/patch handler."],"exampleFix":"// before\nawait repo.createQueryBuilder().update(User).set(req.body).where({ id }).execute();\n// after\nconst ALLOWED = ['name', 'email'];\nconst patch = Object.fromEntries(Object.entries(req.body).filter(([k]) => ALLOWED.includes(k)));\nawait repo.createQueryBuilder().update(User).set(patch).where({ id }).execute();","handlingStrategy":"validation","validationCode":"function sanitizeSet<T>(meta: EntityMetadata, patch: Record<string, unknown>): Record<string, unknown> {\n  const out: Record<string, unknown> = {};\n  for (const [k, v] of Object.entries(patch)) {\n    if (meta.findColumnsWithPropertyPath(k).length > 0) out[k] = v;\n    else throw new Error(`set key '${k}' is not a column`);\n  }\n  return out;\n}","typeGuard":"function isUpdatableColumn(meta: EntityMetadata, key: string): boolean {\n  return meta.findColumnsWithPropertyPath(key).length > 0;\n}","tryCatchPattern":"try {\n  await repo.createQueryBuilder().update().set(patch).where({ id }).execute();\n} catch (e) {\n  if (e?.name === 'EntityPropertyNotFoundError') throw new BadRequestException(`invalid update field`);\n  throw e;\n}","preventionTips":["Whitelist update fields against the entity's column names before .set().","Never mass-assign raw request bodies to .set().","Map DTOs to entity partials with a dedicated mapper that drops unknown keys."],"tags":["typeorm","query-builder","validation","metadata","update"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}