nocobase/nocobase · error
password is empty
Error message
password is empty
What it means
The password transform requires an explicit password cell in the import data when the password field is being imported and throws if the value is undefined or null. Unlike other transforms it does not tolerate absence — a password field with no value cannot be persisted safely, so import fails for that row.
Source
Thrown at packages/plugins/@nocobase/plugin-action-import/src/server/utils/transform.ts:31
export async function _({ value, field }) {
return value;
}
export async function email({ value, field, ctx }) {
if (!value?.trim()) {
return value;
}
const emailReg = /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
if (!emailReg.test(value)) {
throw new Error(ctx.t('Incorrect email format', { ns: namespace }));
}
return value;
}
export async function password({ value, field, ctx }) {
if (value === undefined || value === null) {
throw new Error(ctx.t('password is empty', { ns: namespace }));
}
return `${value}`;
}
export async function o2o({ value, column, field, ctx }) {
const { dataIndex, enum: enumData } = column;
const repository = ctx.db.getRepository(field.options.target);
let enumItem = null;
if (enumData?.length > 0) {
enumItem = enumData.find((e) => e.label === value);
}
const val = await repository.findOne({ filter: { [dataIndex[1]]: enumItem?.value ?? value } });
return val;
}
export const oho = o2o;
export const obo = o2o;
export async function o2m({ value, column, field, ctx }) {View on GitHub (pinned to fa42722fef)
Solutions
- Fill in a password value for every row in the password column before importing
- Remove the password column from the import mapping if you do not intend to set passwords via import
- Use a placeholder policy: generate passwords in the sheet (e.g. a formula) and communicate them to users
- If empty passwords are legitimate, change the import config to skip the password field entirely rather than import it with nulls
Example fix
// before | name | password | | alice | | // after | name | password | | alice | S3cure!Pass|
Defensive patterns
Strategy: validation
Validate before calling
// before import, ensure every row has a password when the field is mapped
const rowsWithoutPassword = rows.filter((r) => r.password === undefined || r.password === null);
if (rowsWithoutPassword.length) {
throw new Error(`${rowsWithoutPassword.length} rows are missing a password`);
} Type guard
function hasPassword(row: { password?: unknown }): row is { password: string | number } {
return row.password !== undefined && row.password !== null;
} Try / catch
try {
await importer.import(file);
} catch (err) {
if (String(err.message).includes('password is empty')) {
// abort and ask user to fill the password column
}
throw err;
} Prevention
- Fill every password cell in the template before upload
- Do not map the password field if you don't intend to set passwords via import
- Use generated placeholder passwords and force reset on first login
- Validate the sheet with a 'blank cell' check before submitting
When it happens
Trigger: Importing users where the password column exists but the cell is empty (null/undefined after parsing), i.e. the column header is present but no value was provided for that row.
Common situations: Admins bulk-creating users from a template and leaving password cells blank for 'we'll set them later'; exported user data that strips password columns (exports never include real passwords) then being re-imported without filling passwords in.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- columns is empty
- Columns configuration is empty
- Invalid field: {{field}}
- Field not found: {{field}}
- Import validation. Field not found
AI-assisted analysis of nocobase/nocobase@fa42722fef (2026-09-01).
Data as JSON: /api/errors/e290c97ea69d2a62.
Report an issue: GitHub.