nextcloud/server · error · InvalidArgumentException

Birthday calendars are disabled

Error message

Birthday calendars are disabled

What it means

Thrown by verifyEnabled() at the very start of occ dav:sync-birthday-calendar when the global app config value dav/generateBirthdayCalendar is anything other than 'yes' (default is 'yes'). The feature was deliberately switched off, so the command refuses to run before touching any user. The per-user key of the same name only re-enables syncing for one user and does not bypass this global gate.

Source

Thrown at apps/dav/lib/Command/SyncBirthdayCalendar.php:86

			$isEnabled = $this->config->getUserValue($userId, 'dav', 'generateBirthdayCalendar', 'yes');
			if ($isEnabled !== 'yes') {
				return;
			}

			/** @var IUser $user */
			$this->birthdayService->syncUser($user->getUID());
		});

		$p->finish();
		$output->writeln('');
		return self::SUCCESS;
	}

	protected function verifyEnabled(): void {
		$isEnabled = $this->config->getAppValue('dav', 'generateBirthdayCalendar', 'yes');

		if ($isEnabled !== 'yes') {
			throw new \InvalidArgumentException('Birthday calendars are disabled');
		}
	}
}

View on GitHub (pinned to ecdeb153ff)

Solutions

  1. Re-enable globally: `occ config:app:set dav generateBirthday-calendar --value yes` is wrong key — use `occ config:app:set dav generateBirthdayCalendar --value yes`, then re-run the sync
  2. Confirm the current value with `occ config:app:get dav generateBirthdayCalendar`
  3. If the feature must stay off, remove the sync job from cron instead of running the command

Example fix

# before
occ dav:sync-birthday-calendar alice
# InvalidArgumentException: Birthday calendars are disabled

# after
occ config:app:get dav generateBirthdayCalendar   # -> no
occ config:app:set dav generateBirthdayCalendar --value yes
occ dav:sync-birthday-calendar alice
Defensive patterns

Strategy: validation

Validate before calling

#!/usr/bin/env bash
if [ "$(occ config:app:get dav generateBirthdayCalendar)" != "yes" ]; then
  echo "Birthday calendars disabled globally — refusing to sync" >&2; exit 1
fi
occ dav:sync-birthday-calendar "$@"

Prevention

When it happens

Trigger: `occ dav:sync-birthday-calendar [uid]` after an admin ran `occ config:app:set dav generateBirthdayCalendar --value no` (common on instances that disable auto-generated birthday calendars).

Common situations: Performance tuning guides recommend disabling birthday calendars on large instances; admin re-enables per-user but forgets the global flag; inherited config from instance setup automation.

Related errors


AI-assisted analysis of nextcloud/server@ecdeb153ff (2026-08-17). Data as JSON: /api/errors/f8d0606596a812fe. Report an issue: GitHub.