n8n-io/n8n · error · TypeORMError

Column ${propertyPath} was not found in ${metadata.targetNam

Error message

Column ${propertyPath} was not found in ${metadata.targetName} entity.

What it means

EntityManager.increment resolves the propertyPath against entity metadata via findColumnWithPropertyPath. If no column metadata matches, it throws a TypeORMError naming the propertyPath and the entity targetName. Mirrors the aggregate column-not-found case but on the write path. The DB schema is not consulted — only @Column/@Embedded-decorated properties.

Source

Thrown at packages/@n8n/typeorm/src/entity-manager/EntityManager.ts:1176

			return await queryRunner.clearTable(metadata.tablePath); // await is needed here because we are using finally
		} finally {
			if (!this.queryRunner) await queryRunner.release();
		}
	}

	/**
	 * Increments some column by provided value of the entities matched given conditions.
	 */
	async increment<Entity extends ObjectLiteral>(
		entityClass: EntityTarget<Entity>,
		conditions: any,
		propertyPath: string,
		value: number | string,
	): Promise<UpdateResult> {
		const metadata = this.connection.getMetadata(entityClass);
		const column = metadata.findColumnWithPropertyPath(propertyPath);
		if (!column)
			throw new TypeORMError(
				`Column ${propertyPath} was not found in ${metadata.targetName} entity.`,
			);

		if (isNaN(Number(value))) throw new TypeORMError(`Value "${value}" is not a number.`);

		// convert possible embeded path "social.likes" into object { social: { like: () => value } }
		const values: QueryDeepPartialEntity<Entity> = propertyPath.split('.').reduceRight(
			(value, key) => ({ [key]: value }) as any,
			() => this.connection.driver.escape(column.databaseName) + ' + ' + value,
		);

		return this.createQueryBuilder<Entity>(entityClass as any, 'entity')
			.update(entityClass)
			.set(values)
			.where(conditions)
			.execute();
	}

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Pass the @Column-decorated property name (the TS field name), not the DB column name.
  2. After schema changes, regenerate or hand-update the entity so findColumnWithPropertyPath resolves.
  3. For embedded columns, pass the full dotted path that matches an EmbeddedMetadata column.
  4. If you actually need to bump a non-decorated column, use a raw query builder update instead.

Example fix

// before
await manager.increment(Counter, { id }, 'hit_count', 1);
// entity has @Column() hitCount!: number

// after - use the decorated property name
@Entity()
class Counter { @Column() hitCount!: number; }
await manager.increment(Counter, { id }, 'hitCount', 1);
Defensive patterns

Strategy: type-guard

Validate before calling

const meta = connection.getMetadata(Entity);
if (!meta.findColumnWithPropertyPath(propertyPath)) {
  throw new Error(`Refusing increment: ${propertyPath} is not a mapped column`);
}
await manager.increment(Entity, conditions, propertyPath, value);

Type guard

function isIncrementableColumn<Entity>(meta: import('@n8n/typeorm').EntityMetadata<Entity>, path: string): boolean {
  const col = meta.findColumnWithPropertyPath(path);
  return !!col && col.type === Number;
}

Prevention

When it happens

Trigger: Calling `manager.increment(Entity, { id: 1 }, 'count', 1)` where `count` is not a @Column (maybe a getter, a relation, or a virtual field); passing a database column name instead of the property name; targeting a column added by migration but not yet decorated on the entity; passing a relation path like `'tags'`.

Common situations: Rename of a property that didn't update all increment call sites; migration added a column but the entity class wasn't regenerated; confusion between DB column names and TS property names; attempting to increment an embedded or computed field.

Related errors


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