n8n-io/n8n · error · EntityPropertyNotFoundError

Property "${propertyPath}" was not found in "${metadata.targ

Error message

Property "${propertyPath}" was not found in "${metadata.targetName}". Make sure your query is correct.

What it means

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.

Source

Thrown at packages/@n8n/typeorm/src/query-builder/UpdateQueryBuilder.ts:437

		// it doesn't make sense to update undefined properties, so just skip them
		const valuesSetNormalized: ObjectLiteral = {};
		for (let key in valuesSet) {
			if (valuesSet[key] !== undefined) {
				valuesSetNormalized[key] = valuesSet[key];
			}
		}

		// prepare columns and values to be updated
		const updateColumnAndValues: string[] = [];
		const updatedColumns: ColumnMetadata[] = [];
		if (metadata) {
			this.createPropertyPath(metadata, valuesSetNormalized).forEach((propertyPath) => {
				// todo: make this and other query builder to work with properly with tables without metadata
				const columns = metadata.findColumnsWithPropertyPath(propertyPath);

				if (columns.length <= 0) {
					throw new EntityPropertyNotFoundError(propertyPath, metadata);
				}

				columns.forEach((column) => {
					if (!column.isUpdate || updatedColumns.includes(column)) {
						return;
					}

					updatedColumns.push(column);

					//
					let value = column.getEntityValue(valuesSetNormalized);
					if (
						column.referencedColumn &&
						typeof value === 'object' &&
						!(value instanceof Date) &&
						value !== null &&
						!Buffer.isBuffer(value)
					) {

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Whitelist update fields against the entity's column names before building the set object.
  2. Use a mapping layer (DTO -> entity partial) that drops non-column keys.
  3. After a rename, update every update DTO/patch handler.

Example fix

// before
await repo.createQueryBuilder().update(User).set(req.body).where({ id }).execute();
// after
const ALLOWED = ['name', 'email'];
const patch = Object.fromEntries(Object.entries(req.body).filter(([k]) => ALLOWED.includes(k)));
await repo.createQueryBuilder().update(User).set(patch).where({ id }).execute();
Defensive patterns

Strategy: validation

Validate before calling

function sanitizeSet<T>(meta: EntityMetadata, patch: Record<string, unknown>): Record<string, unknown> {
  const out: Record<string, unknown> = {};
  for (const [k, v] of Object.entries(patch)) {
    if (meta.findColumnsWithPropertyPath(k).length > 0) out[k] = v;
    else throw new Error(`set key '${k}' is not a column`);
  }
  return out;
}

Type guard

function isUpdatableColumn(meta: EntityMetadata, key: string): boolean {
  return meta.findColumnsWithPropertyPath(key).length > 0;
}

Try / catch

try {
  await repo.createQueryBuilder().update().set(patch).where({ id }).execute();
} catch (e) {
  if (e?.name === 'EntityPropertyNotFoundError') throw new BadRequestException(`invalid update field`);
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: Mass-assigning a request body to .set() without a whitelist; column renames leaving stale keys in update DTOs; embedded/nested paths spelled incorrectly.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/06e7decb32dc17f7. Report an issue: GitHub.