octobercms/october · error · ValidationException

Error creating directory :name. Please check write…

Error message

Error creating directory :name. Please check write permissions.

What it means

Exception translation in throwHalcyonException: a Halcyon create-directory failure (permissions/disk) was caught and mapped to a ValidationException so the backend shows which directory could not be created. The named directory is where the template write failed.

Solutions

  1. Grant write permission on the themes directory to the web server user
  2. Create the directory manually with correct ownership
  3. Check disk space and path validity
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at modules/cms/classes/CmsObject.php:343 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/28e3f069c2fe3a3a. Report an issue: GitHub.

Appendix: source

Thrown at modules/cms/classes/CmsObject.php:343

            ]);
        }
        elseif ($ex instanceof \October\Rain\Halcyon\Exception\InvalidFileNameException) {
            throw new ValidationException([
               'fileName' => Lang::get('cms::lang.cms_object.invalid_file', ['name'=>$ex->getInvalidFileName()])
            ]);
        }
        elseif ($ex instanceof \October\Rain\Halcyon\Exception\InvalidDirectoryNameException) {
            throw new ValidationException([
               'fileName' => Lang::get('cms::lang.cms_object.invalid_file', ['name'=>$ex->getInvalidDirectoryName()])
            ]);
        }
        elseif ($ex instanceof \October\Rain\Halcyon\Exception\FileExistsException) {
            throw new ValidationException(['fileName' =>
                Lang::get('cms::lang.cms_object.file_already_exists', ['name' => $ex->getInvalidPath()])
            ]);
        }
        elseif ($ex instanceof \October\Rain\Halcyon\Exception\CreateDirectoryException) {
            throw new ValidationException(['fileName' =>
                Lang::get('cms::lang.cms_object.error_creating_directory', ['name' => $ex->getInvalidPath()])
            ]);
        }
        elseif ($ex instanceof \October\Rain\Halcyon\Exception\CreateFileException) {
            throw new ValidationException(['fileName' =>
                Lang::get('cms::lang.cms_object.error_saving', ['name' => $ex->getInvalidPath()])
            ]);
        }
        else {
            throw $ex;
        }
    }
}

View on GitHub (pinned to b608633a7e)