octobercms/october · error · ApplicationException

Invalid hash

Error message

Invalid hash

What it means

Error "Invalid hash" thrown in octobercms/october.

Source

Thrown at modules/backend/controllers/Files.php:190

            throw new ApplicationException('File not found');
        }

        // Ensure that the file model utilized for this request is
        // the one specified in the relationship configuration
        if ($file->attachment) {
            $fileModel = $file->attachment->{$file->field}()->getRelated();

            // Only attempt to get file model through its assigned class
            // when the assigned class differs from the default one that
            // the file has already been loaded from
            if (get_class($file) !== get_class($fileModel)) {
                $file = $fileModel->find($file->id);
            }
        }

        $verifyCode = self::getUniqueCode($file);
        if ($code != $verifyCode) {
            throw new ApplicationException('Invalid hash');
        }

        /**
         * @event backend.files.get
         * Fires before a file is output.
         *
         * Example usage:
         *
         *     Event::listen('backend.files.get', function ((\System\Models\File) $file) {
         *         // Block access to this file
         *         return false;
         *
         *         // Or signal access denied
         *         throw new \ForbiddenException;
         *     });
         *
         */
        $response = Event::fire('backend.files.get', [$file], true);

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/backend/controllers/Files.php:190 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/7d0f1ec1423e5e26. Report an issue: GitHub.