nextcloud/all-in-one · error · InvalidSettingConfigurationException

${DataConst::GetDataDirectory()} does not exist! Something w

Error message

${DataConst::GetDataDirectory()} does not exist! Something was set up falsely!

What it means

Thrown by ConfigurationManager::writeConfig when the AIO data directory (DataConst::GetDataDirectory()) is not a directory at commit time. Every config write (set(), password change, backup time, etc.) goes through writeConfig, so any successful settings change suddenly failing with this usually means the host-mounted volume disappeared from the container.

Source

Thrown at php/src/Data/ConfigurationManager.php:834

        if (strlen($newPassword) < 24) {
            throw new InvalidSettingConfigurationException("New passwords must be >= 24 digits.");
        }

        if (!preg_match("#^[a-zA-Z0-9 ]+$#", $newPassword)) {
            throw new InvalidSettingConfigurationException('Not allowed characters in the new password.');
        }

        // All checks pass so set the password
        $this->set('password', $newPassword);
    }

    /**
     * @throws InvalidSettingConfigurationException
     */
    private function writeConfig() : void {
        if(!is_dir(DataConst::GetDataDirectory())) {
            throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not exist! Something was set up falsely!");
        }
        // Shouldn't happen, but as a precaution we won't write an empty config to disk.
        if ($this->config === []) {
            return;
        }
        $df = disk_free_space(DataConst::GetDataDirectory());
        $content = json_encode($this->config, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR);
        $size = strlen($content) + 10240;
        if ($df !== false && (int)$df < $size) {
            throw new InvalidSettingConfigurationException(DataConst::GetDataDirectory() . " does not have enough space for writing the config file! Not writing it back!");
        }
        // Write to a temp file first to avoid truncating the config file if the
        // disk fills up mid-write. rename() is atomic on POSIX filesystems, so the
        // original config is never touched until the new content is fully on disk.
        $tempFile = DataConst::GetConfigFile() . '.tmp';
        if (file_put_contents($tempFile, $content) === false) {
            // The file probably wasn't created, but better check nonetheless.
            if (file_exists($tempFile)) {

View on GitHub (pinned to 6b788eec5e)

Solutions

  1. Verify the mount inside the container: `docker exec nextcloud-aio-nextcloud ls -ld <data-dir>` and compare with `docker inspect` Mounts.
  2. Restore the host-side mount (restart NFS/SMB, re-mount the disk) and retry the settings change.
  3. If the volume was pruned/removed, restore the data directory (configuration.json, backupsecret, borg keys) from backup before changing any settings.
  4. Fix the volume specification in the mastercontainer start command/compose file and recreate the container.
Defensive patterns

Strategy: try-catch

Validate before calling

$dir = DataConst::GetDataDirectory();
if (!is_dir($dir)) {
    // abort the settings change and alert on the missing mount
}

Type guard

function isAioDataDirMounted(string $dir): bool
{
    return is_dir($dir) && is_writable($dir);
}

Try / catch

try {
    $configurationManager->setDailyBackupTime('04:00', true, true);
} catch (\AIO\Data\InvalidSettingConfigurationException $e) {
    // message contains the data dir path; treat as environment failure, do not retry blindly
    $logger->error($e->getMessage());
}

Prevention

When it happens

Trigger: Any configuration setter is committed while is_dir() on the data directory returns false: the Docker volume backing nextcloud_aio_nextcloud_data was unmounted, the bind-mount source was removed, or the container was started with a wrong volume spec so the path never existed.

Common situations: Host reboot losing an NFS/SMB mount that backs the data directory; docker volume pruned (docker volume prune) while the container runs; migrating the data dir by moving it on the host without updating the mount; typo in the docker run/compose volume path.

Related errors


AI-assisted analysis of nextcloud/all-in-one@6b788eec5e (2026-08-21). Data as JSON: /api/errors/f55b4290021d9613. Report an issue: GitHub.