passbolt/passbolt_api · error · ValidationException
Could not validate group data.
Error message
Could not validate group data.
What it means
GroupsUpdateDryRunService::handleValidationErrors() throws App\Error\Exception\ValidationException with this message when a Group entity accumulated errors during the dry-run save. The exception carries the entity and table so the API can report per-field errors.
Solutions
- Inspect the errors object in the response for the exact failing fields
- Fix the offending fields (e.g. choose a unique group name)
- Re-fetch group state before resubmitting to avoid stale changesets
Defensive patterns
Strategy: try-catch
Validate before calling
// pre-checks before dry-run update
const names = (await api.get('/groups')).map(g => g.name);
if (names.includes(newName)) throw new Error('group name already taken');
if (!newMembers.every(u => existingUserIds.has(u.id))) throw new Error('unknown user in changeset'); Try / catch
try {
await api.post(`/groups/${id}/dry-run`, changes);
} catch (e) {
if (e.response?.body?.errors || e.response?.data?.errors) {
console.error('Dry-run validation errors:', e.response.body.errors);
}
throw e;
} Prevention
- Always run the dry-run first and fix all reported errors before the real update
- Re-fetch group state right before submitting changesets
- Keep group names unique and validate member ids against the users API
When it happens
Trigger: During a dry-run group update (e.g. adding/removing group users in simulation mode) when entity save fails validation — invalid group name, invalid user modifications, rules like unique name failing.
Common situations: Renaming a group to a name that already exists; submitting changesets referencing users already in the group or nonexistent; seeding API payloads from outdated group state.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- group(s) returned by your directory are invalid and will be…
- Cannot delete group user.
- Cannot update group user.
- Could not validate group data.
- Could not validate group data.
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/783d114637d35b6a.
Report an issue: GitHub.
Appendix: source
Thrown at src/Service/Groups/GroupsUpdateDryRunService.php:138
if (!empty($errors)) {
$group->setError('groups_users', [$rowIndexRef => $errors]);
$this->handleValidationErrors($group);
}
}
}
/**
* Handle group validation errors.
*
* @param \App\Model\Entity\Group $group The target group
* @return void
* @throws \App\Error\Exception\ValidationException If the provided data does not validate.
*/
private function handleValidationErrors(Group $group): void
{
$errors = $group->getErrors();
if (!empty($errors)) {
throw new ValidationException(__('Could not validate group data.'), $group, $this->groupsTable);
}
}
/**
* Get the secrets that will require to be encrypted for the users added to the group.
*
* @param \App\Model\Entity\Group $group The group to update.
* @param array $changes The list of group users changes.
* @return array A list of secrets to request to the client
* [
* [
* 'resource_id' => uuid,
* 'user_id' => uuid
* ],
* ...
* ]
*/
private function getAddedGroupsUsersMissingSecrets(Group $group, array $changes = []): arrayView on GitHub (pinned to 31c1bbc10f)