octobercms/october · error · ValidationException

Error saving file ':name'. Please check write permissions.

Error message

Error saving file ':name'. Please check write permissions.

What it means

Exception translation in throwHalcyonException: the underlying Halcyon write failed (permissions/disk), and it is reported as a ValidationException naming the file that could not be saved. The file write target is the input at fault.

Solutions

  1. Make the themes directory writable by the PHP process
  2. Check free disk space
  3. Verify the file path is within allowed boundaries (not blocked by open_basedir)
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at modules/cms/classes/CmsObject.php:348 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/0e41626507849e8d. Report an issue: GitHub.

Appendix: source

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

            ]);
        }
        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)